Overview to breve's Simulation Structure: For All Frontend Languages
This section discusses the conceptual structure of a breve simulation, which are common to both steve and Python language simulations. Familiarize yourself with the concepts in this section before proceeding, regardless of which frontend language you intend to use.
breve is an agent based modelling environment in which the behaviors of agents are simulated at each time-step. In order to write a simulation in breve, you must define these agents in terms of how they behave and how they interact. These behaviors are updated at each time-step such that the agents are continuously reacting to their environment. In addition to behaviors at each time-step, behaviors can be specified to correspond to other events as well. The most notably of these other events is object initialization each agent has a set of behaviors that are executed when the agent is created.
Writing simulations in breve is thus nothing more than specifying the behavior of agents there is no code written that does not correspond to an agent. In order to specify agent behaviors, breve uses object-oriented languages, either the breve-specific steve language, or the popular (and externally developed) scripting language Python. In either case, you'll create an object type corresponding to each agent in the world, and you'll implement specific methods to specify the behaviors of these agents.
As mentioned above, the behavior of agents is specified based on certain events. The "init" event happens when the object is created, and the "iterate" event happens at each time-step. In terms of the object oriented language frontends, these behaviors are specified by creating methods called "init" and "iterate" for the agent classes.
The program logic of a single agent.
The image above illustrates the program logic of a single agent. The agent is first initialized via its init method (__init__ in Python). Then at each time-step, the agent uses its iterate method to perform a series of tasks: obtain information about the world via sensors, perform computation on the information, and finally change its behavior or state based on the computed information.
