edu.ou.mlfw
Interface Simulator<STATE>

All Known Implementing Classes:
MancalaSimulator, PacmanSimulator

public interface Simulator<STATE>

The Simulator interface provides the minimal set of features and several convenient hooks necessary to define a simulation engine that can be handed to an instance of World. The basic contract of a Simulator is that it must advance by steps, which may make use of a "simulated seconds" argument to handle continuous simulators, that it must advertise when is completed by returning false for isRunning(), that it must return a representation of its state when asked, and that it must provide a list of Controllables, either only the active ones, or every Controllable in the system. Also, a Simulator is given hooks to initialize from a configuration file as well as shutdown and serialize to an output stream. Additionally, a simulator may provide an implementation of a gui (as a JComponent).


Method Summary
 void advance()
           
 java.util.Collection<Controllable> getAllControllables()
          Return all of the simulator's controllables, even those that are not currently active.
 java.util.Collection<Controllable> getControllables()
          Return the simulator's currently active controllables
 javax.swing.JComponent getGUI()
           
 STATE getState()
           
 void initialize(java.io.File configfile)
           
 boolean isRunning()
           
 void shutdown()
           
 

Method Detail

initialize

void initialize(java.io.File configfile)

shutdown

void shutdown()

isRunning

boolean isRunning()

advance

void advance()

getState

STATE getState()

getControllables

java.util.Collection<Controllable> getControllables()
Return the simulator's currently active controllables

Returns:

getAllControllables

java.util.Collection<Controllable> getAllControllables()
Return all of the simulator's controllables, even those that are not currently active.

Returns:

getGUI

javax.swing.JComponent getGUI()