|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Simulation
public class Simulation
Class that implements a general Simulation
Constructor Summary | |
---|---|
Simulation()
Constructor to set output to null |
|
Simulation(Picture bg)
Constructor to set output to null |
Method Summary | |
---|---|
void |
add(Agent newOne)
Add this actor to the agents list |
void |
closeFile()
close the file and clear the output stream |
void |
endStep(int t)
End of step processing |
LinkedList |
getAgents()
Get a linked list of all agents |
BufferedWriter |
getOutput()
Method to get the BufferedOutput to write to |
World |
getWorld()
Method to get the world |
void |
openFile(String filename)
Open the input file and set the BufferedWriter to speak to it. |
void |
openFrames(String dir)
Open a frame sequencer using the given directory |
void |
remove(Agent newOne)
Remove this actor from the agents list |
void |
run()
Run for a default of 50 timesteps |
void |
run(int numSteps)
Ask all agents to run for the number of input steps |
void |
setUp()
setUp the simulation. |
String |
toString()
Return a string with information on the number of agents. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Simulation()
public Simulation(Picture bg)
Method Detail |
---|
public World getWorld()
public BufferedWriter getOutput()
public LinkedList getAgents()
public void add(Agent newOne)
newOne
- agent to add to the listpublic void remove(Agent newOne)
newOne
- the agent to remove from the listpublic void setUp()
public void openFile(String filename)
filename
- the filename to openpublic void openFrames(String dir)
dir
- name of the directorypublic void run(int numSteps)
numSteps
- the number of timesteps to runpublic void run()
public void endStep(int t)
t
- the current timestep numberpublic String toString()
toString
in class Object
public void closeFile()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |