de.cesr.lara.houseplant
Class HouseplantModel
java.lang.Object
de.cesr.lara.components.model.impl.LAbstractModel
de.cesr.lara.components.model.impl.LAbstractStandaloneSynchronisedModel
de.cesr.lara.houseplant.HouseplantModel
- All Implemented Interfaces:
- LaraAbstractEventSubscriber, LaraEventSubscriber, LaraInternalEventSubscriber, LaraModel
public class HouseplantModel
- extends LAbstractStandaloneSynchronisedModel
- implements LaraModel, LaraEventSubscriber
TODO organise classes in packages according to LARA_Base (SH)
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.
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 |
HouseplantModel
public HouseplantModel(SimulationConfig simulationConfig)
- Constructor
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)
createAgents
public void createAgents(List<AgentInitialData> agentInitialData)
- Create the agents used in this model
initDecisions
public void initDecisions(Set<Class<? extends LaraPreference>> goals)
createEnvironment
public void createEnvironment(List<AgentInitialData> agentInitialData)
- See Also:
de.cesr.lara.components.model.LaraModel#initEnvironment()
processStep
public void processStep()
- simulates one tick. currently our agents decide about "decision one" and
log the best behavioural option
processDecision
public void processDecision(LaraDecisionConfiguration decisionConfiguration)
- processes a given decision by firing the corresponding events
- Parameters:
decisionConfiguration
-