How it’s working¶
Introduction¶
Synergine is designed to simulate interaction between object in time. With iterations (cycles
) synergine execute your events and associated actions.
Synergies object¶
Your simulation have to be populated by SynergyObject
. These objects will evolute according of your events.
You can found usage example in LifeGame HowTo.
Cycles¶
Each cycle, synergine will repeat this procedure:
# Main process
actions = empty list
# Sub processes
for each mechanism in mechanisms:
for each event in events associated to mechanism:
if event is trig:
add event actions to actions
# Main processes
for each action in actions:
execute action
Mechanisms, Events and Actions¶
Your synergies objects will evolute according of your event, when actions are executed. To optimize compute timing, mechanisms have been introduced. The principle: One mechanism compute once what multiple events need.
You can found usage example in LifeGame HowTo.
Context, Metas¶
To optimize parallel computing, simulation information have to be stored in metas data. The data are used by Mechanisms and Event to do their job.
You can find usage example of metas data in:
- LifeGame Cell where metas data are feed (see
self.add_col
,self.remove_col
,self.add_state
,self.remove_state
usages). - LifeGame Born Event where
Event
concern theCOL_DIED
collection of synergies object. - LifeGame AliveAroundEvent where
_get_alive_cell_around_count
method read metas data (seecontext.metas
usage)