Skip to content

EventManager.gaml

Loïc SADOU edited this page Sep 22, 2020 · 2 revisions

EventManager.gaml is a particular species. The main purpose of this species is to manage the event paradigm. The event paradigm allows inactive agents to not be called at each step because they have not reflex anymore. This species can be seen as an alarm: an agent want to send a message at a specific time to an agent (can be himself), this agent register an event to the EventManager, once the registered time for the message is reached, the EventManager will send the message/signal.

  • Attributes.

    • events_map (SortedMap): stores all the events sorted by the time they have to be triggered.
  • Reflex

    • void sendSignal (void): reflex triggered each step when the events_map is not empty. This reflex send signals to species that inherit from EventListener.
  • Action

    • void registerEvent (float signal_time, EventListener signal_target, string signal_type): action that stores event in a events_map.
    • EventListener getEventTarget (int event_index): return the signal target presents at event_index in events_map.
    • float getEventTime (int event_index): return the signal time presents at event_index in events_map.
    • string getEventType (int event_index): return the signal message presents at event_index in events_map.
  • Experiment

Clone this wiki locally