LARA is intended for the simulation of citizens decision making in the arena of policy modeling. Being a Java library that integrates well with existing ABM frameworks such as Repast Simphony, LARA fills a gap between such frameworks with no built-in psychological foundations and full-fledged cognitive architectures. Its components of perception, memory, preprocessor, decision-making, and post-processor interact via interfaces and thus, the implementation of each one can be adapted or replaced independently.
Besides the conceptual components this pages gives an overview about central model objects (as usually exogenous to the framework), the LARA process flow, and technical components. Information about specific LARA classes is contained in the JavaDoc (see the interface starting with LARA to start).
Basically, LARA consists of four major conceptual components:
Model objects are usually not a genuine part of LARA, but the simulations model that utilises LARA. However, there are crucial interactions between LARA and these model objects, and LARA requires the realisation of certain interfaces at these objects.
To enable the parallel simulation of different decision configurations (and preferences) several LaraModels can co-exist, referenced by an id object. To reduce the hassle of passing the object id to each and every LARA component, and because some components are singletons, often the agent's mandatory getIdObject() method (a method of an agent's LataComponent to be precise) is used to obtain the id object. Consequently, an agents needs to be assigned to an id object uniquely.
For may applications it is reasonable to use the agent's LaraEnvironment as id object (in case the definition of LaraEnvironments corresponds to the devision of parallel simulations).
The model controller sets up and initialises the model, and triggers the Eventbus (by publishing LModelInstantiatedEvent). It then drives the simulation by publishing LModelStepEvent.
Initialised by the model controller before it publishes . That event causes LARA to initialise its internal components.
Usually initialised by the realisation of LaraModel on event of LModelInstantiatedEvent.
Instantiate LDecisionConfiguration and set LaraPreferences.
Usually initialised by the realisation of LaraModel on event of LModelInstantiatedEvent. Also assign LaraDeliberativeChoiceComponent and LBehaviouralOptions.
To understand the internal framework and implementation, knowledge about some technical components is very useful.
The LaraEventbus provides an easy and efficient way for components to communicate with each other. The Model cycle is triggered by Events, applying a Publisher/Subscriber model:
The eventbus was introduced to avoid complicated dependencies between components (decoupling) and to make it easy to execute tasks in parallel. Benefits include:
The eventbus distinguishes between internal and non-internal subscriptions to prevent the user from disturbing the LARA internal process chain. LARA internal events are pushed only to those subscribers that implement the LaraInternalEventSubscriber interface and calls the onInternalEvent() method there.
See here for more information to apply the eventbus.