de.cesr.lara.template
Class MyModel
java.lang.Object
de.cesr.lara.components.model.impl.LAbstractModel
de.cesr.lara.components.model.impl.LAbstractStandaloneSynchronisedModel
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.
Constructor Summary |
MyModel()
Constructor |
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 |
MyModel
public MyModel()
- Constructor
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