|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mrd.repast.landscape.Landscape
Landscape Encapsulates much of the Internal Datastructure management of a spatial simulation. It takes care of traking agents that are dead and need to be added or removed from the simulation landscape. It is composed of Three primary data structures: 1.) LandscapeAgent Grid - used to track nieghorhood relationships 2.) Resource Grid - represents available resources in an area 3.) LandscapeAgent List - A randomizable or sortable list that is iterated over to update the agents. There is one secondary datastructure, a birth queue, this store new agents that need to be added to the model at the end of a iteration.
Field Summary | |
protected uchicago.src.sim.space.Object2DGrid |
agentGrid
Grid that holds the Agents. |
protected java.util.ArrayList |
agents
A list of all the agents. |
protected java.util.Vector |
birthQueue
This queue holds new agents that need to be added to the simulation at the end of the iteration. |
protected uchicago.src.sim.space.Object2DGrid |
habitatGrid
Grid that holds the Habitat Resources |
protected org.apache.commons.logging.Log |
log
|
Constructor Summary | |
Landscape(java.lang.String habitatFile)
Creates a new Landscape |
Method Summary | |
void |
birthAgents()
This will update the landscape by adding the new agents to the Grid and the agent list. |
LandscapeAgent |
getAgentAt(int x,
int y)
|
uchicago.src.sim.space.Object2DGrid |
getAgentGrid()
Getter for property agentGrid. |
java.util.ArrayList |
getAgents()
Getter for property agents. |
uchicago.src.sim.space.Object2DGrid |
getHabitatGrid()
Getter for property habitatGrid. |
org.apache.commons.pool.ObjectPool |
getPool()
Getter for property pool. |
java.lang.Object |
getResourceAt(int x,
int y)
This gets the Resource Object available at a (x, y) coordinate |
double |
getResourceValueAt(int x,
int y)
This gets the Resource double value available at a (x, y) coordinate |
int |
getSizeX()
Getter for property sizeX. |
int |
getSizeY()
Getter for property sizeY. |
void |
moveAgentTo(int old_x,
int old_y,
int x,
int y)
|
void |
moveAgentTo(LandscapeAgent agent,
int x,
int y)
|
void |
putAgentAt(int x,
int y,
LandscapeAgent agent)
|
void |
reapAgents()
This will update the landscape by removing the dead agents from the Grid and the agent list. |
void |
setPool(org.apache.commons.pool.ObjectPool pool)
Setter for property pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.apache.commons.logging.Log log
protected uchicago.src.sim.space.Object2DGrid agentGrid
protected uchicago.src.sim.space.Object2DGrid habitatGrid
protected java.util.ArrayList agents
protected java.util.Vector birthQueue
Constructor Detail |
public Landscape(java.lang.String habitatFile)
habitatFile
- The Habitat File that will initialize the resources in this landscape.Method Detail |
public void birthAgents()
public void reapAgents()
public java.lang.Object getResourceAt(int x, int y)
x
- coordinatey
- coordinate
public double getResourceValueAt(int x, int y)
x
- coordinatey
- coordinate
public LandscapeAgent getAgentAt(int x, int y)
x
- y
-
public void moveAgentTo(LandscapeAgent agent, int x, int y) throws java.lang.Exception
x
- y
- agent
-
java.lang.Exception
public void moveAgentTo(int old_x, int old_y, int x, int y) throws java.lang.Exception
x
- y
-
java.lang.Exception
public void putAgentAt(int x, int y, LandscapeAgent agent) throws java.lang.Exception
x
- y
- agent
-
java.lang.Exception
public int getSizeX()
public int getSizeY()
public java.util.ArrayList getAgents()
public uchicago.src.sim.space.Object2DGrid getHabitatGrid()
public uchicago.src.sim.space.Object2DGrid getAgentGrid()
public org.apache.commons.pool.ObjectPool getPool()
public void setPool(org.apache.commons.pool.ObjectPool pool)
pool
- New value of property pool.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |