de.cesr.lara.template.rs
Class MyRsContextBuilder
java.lang.Object
de.cesr.lara.components.model.impl.LAbstractModel
de.cesr.lara.toolbox.adapter.rs.LAbstractRsModel<MyAgent,MyAbstractBehaviouralOption<MyAgent>,MyAgent>
de.cesr.lara.template.rs.MyRsContextBuilder
- All Implemented Interfaces:
- LaraAbstractEventSubscriber, LaraEventSubscriber, LaraInternalEventSubscriber, LaraModel, repast.simphony.dataLoader.ContextBuilder<MyAgent>
public class MyRsContextBuilder
- extends LAbstractRsModel<MyAgent,MyAbstractBehaviouralOption<MyAgent>,MyAgent>
Some Notes: - If MyAgents extends LAbstractAgent, the
getLaraComp()
may be omitted in most cases to improve
readability.
Methods inherited from class de.cesr.lara.components.model.impl.LAbstractModel |
advanceCalender, getCurrentDate, getCurrentSimulationStage, getCurrentStep, getFloatPointFormat, getIntegerFormat, getLRandom, init, setCurrentStep, step, step |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MyRsContextBuilder
public MyRsContextBuilder()
build
public repast.simphony.context.Context<MyAgent> build(repast.simphony.context.Context<MyAgent> context)
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 }
createEnvironment
public void createEnvironment()
- See Also:
de.cesr.lara.components.model.LaraModel#initEnvironment()
initDecisions
public void initDecisions(Set<Class<? extends LaraPreference>> goals)
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
-
getAgentIterable
protected Iterable<MyAgent> getAgentIterable()
- Description copied from class:
LAbstractRsModel
- Returns an object that may iterate over all agents.
- Specified by:
getAgentIterable
in class LAbstractRsModel<MyAgent,MyAbstractBehaviouralOption<MyAgent>,MyAgent>
- Returns:
- iterable over agents