|
|||||||||
| Home >> All >> org >> mrd >> repast >> [ landscape overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.mrd.repast.landscape
Class Landscape

java.lang.Objectorg.mrd.repast.landscape.Landscape
- public class Landscape
- extends java.lang.Object
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 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 Object2DGrid |
habitatGrid
Grid that holds the Habitat Resources |
protected org.apache.commons.logging.Log |
log
|
private org.apache.commons.pool.ObjectPool |
pool
Holds value of property pool. |
| 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)
|
Object2DGrid |
getAgentGrid()
Getter for property agentGrid. |
java.util.ArrayList |
getAgents()
Getter for property agents. |
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 |
log
protected org.apache.commons.logging.Log log
agentGrid
protected Object2DGrid agentGrid
- Grid that holds the Agents.
habitatGrid
protected Object2DGrid habitatGrid
- Grid that holds the Habitat Resources
agents
protected java.util.ArrayList agents
- A list of all the agents. Convenient for any method that
iterates through a list of agents. A least one list like this is common
to most simulations. See below for examples of its use.
birthQueue
protected java.util.Vector birthQueue
- This queue holds new agents that need to be added to the simulation at the end
of the iteration.
pool
private org.apache.commons.pool.ObjectPool pool
- Holds value of property pool.
| Constructor Detail |
Landscape
public Landscape(java.lang.String habitatFile)
- Creates a new Landscape
| Method Detail |
birthAgents
public void birthAgents()
- This will update the landscape by adding the new agents to the Grid and the agent
list.
reapAgents
public void reapAgents()
- This will update the landscape by removing the dead agents from the Grid and the agent
list.
getResourceAt
public java.lang.Object getResourceAt(int x, int y)
- This gets the Resource Object available at a (x, y) coordinate
getResourceValueAt
public double getResourceValueAt(int x,
int y)
- This gets the Resource double value available at a (x, y) coordinate
getAgentAt
public LandscapeAgent getAgentAt(int x, int y)
moveAgentTo
public void moveAgentTo(LandscapeAgent agent, int x, int y) throws java.lang.Exception
moveAgentTo
public void moveAgentTo(int old_x,
int old_y,
int x,
int y)
throws java.lang.Exception
putAgentAt
public void putAgentAt(int x,
int y,
LandscapeAgent agent)
throws java.lang.Exception
getSizeX
public int getSizeX()
- Getter for property sizeX.
getSizeY
public int getSizeY()
- Getter for property sizeY.
getAgents
public java.util.ArrayList getAgents()
- Getter for property agents.
getHabitatGrid
public Object2DGrid getHabitatGrid()
- Getter for property habitatGrid.
getAgentGrid
public Object2DGrid getAgentGrid()
- Getter for property agentGrid.
getPool
public org.apache.commons.pool.ObjectPool getPool()
- Getter for property pool.
setPool
public void setPool(org.apache.commons.pool.ObjectPool pool)
- Setter for property pool.
|
|||||||||
| Home >> All >> org >> mrd >> repast >> [ landscape overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.mrd.repast.landscape.Landscape