de.cesr.lara.template.rs
Class MyRsContextBuilder

java.lang.Object
  extended by de.cesr.lara.components.model.impl.LAbstractModel
      extended by de.cesr.lara.toolbox.adapter.rs.LAbstractRsModel<MyAgent,MyAbstractBehaviouralOption<MyAgent>,MyAgent>
          extended by 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.


Field Summary
 
Fields inherited from class de.cesr.lara.components.model.impl.LAbstractModel
calendar, currentSimStage, eventBus, floatPointFormat, integerFormat, randomMan, step
 
Constructor Summary
MyRsContextBuilder()
           
 
Method Summary
 repast.simphony.context.Context<MyAgent> build(repast.simphony.context.Context<MyAgent> context)
           
 void createEnvironment()
           
protected  Iterable<MyAgent> getAgentIterable()
          Returns an object that may iterate over all agents.
 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.toolbox.adapter.rs.LAbstractRsModel
finish, initRsModel, onInternalEvent, stepIt
 
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
 

Constructor Detail

MyRsContextBuilder

public MyRsContextBuilder()
Method Detail

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