|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
---|
void initialize(java.io.File configfile)
void shutdown()
boolean isRunning()
void advance()
STATE getState()
java.util.Collection<Controllable> getControllables()
java.util.Collection<Controllable> getAllControllables()
javax.swing.JComponent getGUI()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |