vitro
Class Model

java.lang.Object
  extended by vitro.Model
Direct Known Subclasses:
Graph, Grid, Plane

public abstract class Model
extends Object

A Model is a representation of the state of a simulation. All models expose a collection of Actors which can inspect and modify the state of the Model through atomic Actions. Any other useful state or meaningful constraints can be expressed by extending this basic class.


Field Summary
 Set<Actor> actors
          A Collection of the Actors in this Model.
 
Constructor Summary
Model(Set<Actor> actors)
          Create a new Model, providing a collection for storing Actors.
 
Method Summary
 List<Action> cleanup()
          This method will be called by the Controller after all Agents have made their decisions for their respective Actors.
 boolean done()
          Generically determine when this simulation is complete.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actors

public final Set<Actor> actors
A Collection of the Actors in this Model.

Constructor Detail

Model

public Model(Set<Actor> actors)
Create a new Model, providing a collection for storing Actors. This collection should generally be mutable.

Method Detail

done

public boolean done()
Generically determine when this simulation is complete. Simulations that have no meaningful terminal state can return false (the default).

Returns:
true if this Model is in a final state.

cleanup

public List<Action> cleanup()
This method will be called by the Controller after all Agents have made their decisions for their respective Actors. The returned list of Actions will be applied in the order given.

Returns:
cleanup Actions to perform.