de.cesr.lara.template
Class MyModel

java.lang.Object
  extended by de.cesr.lara.components.model.impl.LAbstractModel
      extended by de.cesr.lara.components.model.impl.LAbstractStandaloneSynchronisedModel
          extended by de.cesr.lara.template.MyModel
All Implemented Interfaces:
LaraAbstractEventSubscriber, LaraEventSubscriber, LaraInternalEventSubscriber, LaraModel

public class MyModel
extends LAbstractStandaloneSynchronisedModel
implements LaraModel, LaraEventSubscriber

The model class glues together the single agents to one model. It extends the LARA component LAbstractStandaloneSynchronisedModel. The models cycle is triggered by MyModelControler through the eventbus. To make LARA able to interact with the model, the interface LaraModel has to be implemented.


Field Summary
 
Fields inherited from class de.cesr.lara.components.model.impl.LAbstractStandaloneSynchronisedModel
agents
 
Fields inherited from class de.cesr.lara.components.model.impl.LAbstractModel
calendar, currentSimStage, eventBus, floatPointFormat, integerFormat, randomMan, step
 
Constructor Summary
MyModel()
          Constructor
 
Method Summary
 void createAgents()
          Create the agents used in this model
 void createEnvironment()
           
 void initDecisions(Set<Class<? extends LaraPreference>> goals)
           
<T extends LaraEvent>
void
onEvent(T event)
          Will be called with an event as a parameter when an event the subscriber subscribed to occurs.
 void processDecision(LaraDecisionConfiguration decisionConfiguration)
          processes a given decision by firing the corresponding events
 void processStep()
          simulates one tick. currently our agents decide about "decision one" and log the best behavioural option
 
Methods inherited from class de.cesr.lara.components.model.impl.LAbstractStandaloneSynchronisedModel
addAgent, init
 
Methods inherited from class de.cesr.lara.components.model.impl.LAbstractModel
advanceCalender, getCurrentDate, getCurrentSimulationStage, getCurrentStep, getFloatPointFormat, getIntegerFormat, getLRandom, onInternalEvent, setCurrentStep, step, step
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.cesr.lara.components.model.LaraModel
getCurrentDate, getCurrentSimulationStage, getCurrentStep, getFloatPointFormat, getIntegerFormat, getLRandom, setCurrentStep, step, step
 

Constructor Detail

MyModel

public MyModel()
Constructor

Method Detail

createAgents

public void createAgents()
Create the agents used in this model


createEnvironment

public void createEnvironment()
See Also:
de.cesr.lara.components.model.LaraModel#initEnvironment()

initDecisions

public void initDecisions(Set<Class<? extends LaraPreference>> goals)

onEvent

public <T extends LaraEvent> void onEvent(T event)
Description copied from interface: LaraEventSubscriber
Will be called with an event as a parameter when an event the subscriber subscribed to occurs. Implement this to react on events. Typically you would start doing something like if (event instanceof VeryInterestingEvent) { //do something smart }

Specified by:
onEvent in interface LaraEventSubscriber
See Also:
LaraEventSubscriber.onEvent(de.cesr.lara.components.eventbus.events.LaraEvent)

processDecision

public void processDecision(LaraDecisionConfiguration decisionConfiguration)
processes a given decision by firing the corresponding events

Parameters:
decisionConfiguration -

processStep

public void processStep()
simulates one tick. currently our agents decide about "decision one" and log the best behavioural option