|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--World
This class is the simulation object; Animal is the root class of the dweller hierarchy provided by the user worldGrid is the representation of the World object there are worldSize*worldSize points in the World current is the encoded direction of the ocean current time is the current time step kint sets the interval of steps on which reproduction is tried timeStep is a static variable to keep track of number of time steps so far in the World simulation.
Method Summary | |
char |
getChar(int row,
int col)
this method returns the character representation of the Animal which is at position |
int |
getCurrent()
observer for current |
int |
getCurrentTimeStep()
observer for time |
WorldGrid |
getWorldGrid()
observer for worldGrid |
int |
getWorldSize()
observer for worldSize |
void |
nextTimeStep()
This method simply iterates through all objects in the World and calls processTimeStepForObject(obj,loc) on each object Gui.main() calls this nextTimeStep function for each time step in the simulation |
void |
populate(int numObjects)
this function places Animals in the World called by Gui.main() needs to be rewritten for every simulation |
Animal |
whatIs(Location loc)
function checks location loc in simulation |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public WorldGrid getWorldGrid()
public int getWorldSize()
public int getCurrent()
public void nextTimeStep()
public char getChar(int row, int col)
row
- is x co-ordinatecol
- is y co-ordinatepublic void populate(int numObjects)
numObjects
- is total number of dwellers to be created
in the simulationpublic int getCurrentTimeStep()
public Animal whatIs(Location loc)
loc
- is location in question
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |