massim.framework
Class DefaultController

java.lang.Object
  extended by massim.framework.DefaultController
All Implemented Interfaces:
Component, Controller
Direct Known Subclasses:
ConfigurationDelivererController

public abstract class DefaultController
extends java.lang.Object
implements Controller

This class provides some reasonable defaults for concurrentGetSimulationConfiguration, by delegating it to its blocking sibling using a new thread.


Constructor Summary
DefaultController()
           
 
Method Summary
 java.util.concurrent.Future<SimulationConfiguration> concurrentGetSimulationConfiguration()
          non-blocking version of getSimulationConfiguration, return a Future object.
 ControllerReturnValue controlSimulation(Simulation simulation)
          This method will be called whenever the controller may influence the simulation in any way.
 boolean onSimulationReady()
           
 void start()
          Tell the component to start activity.
 void stop()
          Tell the component to cease activity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface massim.framework.Controller
getSimulationConfiguration
 

Constructor Detail

DefaultController

public DefaultController()
Method Detail

onSimulationReady

public boolean onSimulationReady()

concurrentGetSimulationConfiguration

public java.util.concurrent.Future<SimulationConfiguration> concurrentGetSimulationConfiguration()
Description copied from interface: Controller
non-blocking version of getSimulationConfiguration, return a Future object.

Specified by:
concurrentGetSimulationConfiguration in interface Controller
Returns:
future of simulation configuration

controlSimulation

public ControllerReturnValue controlSimulation(Simulation simulation)
Description copied from interface: Controller
This method will be called whenever the controller may influence the simulation in any way. If you plan to change the simulation while it is running (for agent development purposes for example) then you should put something non-trivial in this method.

Specified by:
controlSimulation in interface Controller
Returns:
true iff the controller doesn't want to abort the simulation

start

public void start()
Description copied from interface: Component
Tell the component to start activity.

Specified by:
start in interface Component

stop

public void stop()
Description copied from interface: Component
Tell the component to cease activity.

Specified by:
stop in interface Component


Copyright © 2012. All Rights Reserved.