public class Simulation
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<Agent> |
agents
List of all the agents registered for the simulation
|
Constructor and Description |
---|
Simulation()
Creates a simulation with an empty list of agents
|
Modifier and Type | Method and Description |
---|---|
int |
getSize()
Returns the number of the agents in the simulation
|
void |
live()
Run an iteration of the simulation by calling live
method of all agents.
|
void |
register(Agent agent)
Register an agent in the simulation
|
void |
run(int numIterations)
Runs the whole simulation with the left number of iterations
indicated in the parameter.
|
private java.util.List<Agent> agents
public void register(Agent agent)
public void live()
public void run(int numIterations)
public int getSize()