Last week I worked on writing some foundational code for my simulation - creating Tern agent objects and a swarm to contain them. This week I actually tried to compile the results and realized I was not as familiar with the quirks of the Swarm framework as I needed to be.
Over the past week I looked at pages of documentation, numerous tutorials, and several example simulations with the aim of adapting and adopting previously used code as much as I could. One of the things I had to work my way through and dig deep to find information on was how to make a Swarm simulation discrete event rather than discrete time. Most demo code I saw was discrete time. I also had some issues arise from my lack of experience with Objective-C.
Now I have a "stupid" model running. My simulated terns simple start out stationary (except for one that moves from the start) and then move randomly once touched by another tern. The purpose of this arbitrary and meaningless exercise was two-fold. First, the fact that terns move when touched by other terns illustrates event-driven rather than time-driven actions (the basis for discrete-event simulation). Second, as well as learning how to create a simple 2D display of tern activity (less important, probably) I figured out how to create a histogram that tracks a piece of information from the simulation in real time (more important).
EDIT: next week will be about both research on the previously mentioned questions and working towards more meaningful actions and interactions for the terns.
No comments:
Post a Comment