|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.brook.ascape.model.AscapeObject
|
+--edu.brook.ascape.model.Agent
|
+--edu.brook.ascape.model.Cell
|
+--edu.brook.ascape.model.CellOccupant
|
+--edu.brook.ascape.model.Scape
|
+--edu.brook.ascape.model.ScapeGraph
|
+--edu.brook.ascape.model.ScapeVector
A one-dimensional variable-size collection of agents providing services described for scape. Provides some methods that delegate for java.util.Vector.
| Field Summary | |
static int |
ESTIMATED_MAXIMUM_SIZE
The estimated maximum size a typical vector will be. |
java.util.Vector |
vector
The actual vecotr representation of the scape. |
| Fields inherited from class edu.brook.ascape.model.ScapeGraph |
extent |
| Fields inherited from class edu.brook.ascape.model.CellOccupant |
MOVE_RANDOM_LOCATION_RULE,
PLAY_HOST_RULE,
PLAY_NEIGHBORS_RULE,
PLAY_OTHER,
RANDOM_WALK_AVAILABLE_RULE,
RANDOM_WALK_RULE |
| Fields inherited from class edu.brook.ascape.model.Cell |
cellsNear,
coordinate,
neighbors,
thisUpdate |
| Fields inherited from class edu.brook.ascape.model.Agent |
DEATH_RULE,
deleteMarker,
FISSIONING_RULE,
FORCE_DIE_RULE,
FORCE_FISSION_RULE,
FORCE_MOVE_RULE,
INITIALIZE_RULE,
initialized,
ITERATE_AND_UPDATE_RULE,
ITERATE_RULE,
METABOLISM_RULE,
MOVEMENT_RULE,
UPDATE_RULE |
| Fields inherited from class edu.brook.ascape.model.AscapeObject |
ARBITRARY_SEED,
count,
name,
scape |
| Constructor Summary | |
ScapeVector()
Constructs a scape vector. |
|
ScapeVector(java.lang.String name,
Cell prototypeAgent)
Constructs a two-dimensional vector of provided geometry and extent, populated with clones of provided agent. |
|
ScapeVector(java.lang.String name,
Cell prototypeAgent,
Coordinate1DDiscrete extent)
Constructs a two-dimensional vector of provided geometry and extent, populated with clones of provided agent. |
|
| Method Summary | |
void |
addAgent(Agent agent)
Adds the supplied agent to this vector. |
void |
addAgent(Agent agent,
boolean isParent)
Adds the supplied agent to this vector. |
void |
addElement(Agent agent)
Adds the supplied agent to this vector. |
java.lang.Object |
clone()
Clones the scape. |
boolean |
contains(Agent a)
Does the agent exist in this Scape? |
int |
countWithin(Cell origin,
Conditional condition,
boolean includeOrigin,
double maximumDistance)
|
void |
createScape()
Populate the scape with instances of its protoype agent. |
void |
deleteSweep()
|
java.util.Enumeration |
elements()
Returns an enumeration of all agents. |
Cell |
findNearestCell(Cell origin,
Conditional condition)
|
Cell |
findNearestCell(Cell origin,
Conditional condition,
boolean includeOrigin)
|
Cell |
findNearestCell(Cell origin,
Conditional condition,
boolean includeOrigin,
double maximumDistance)
|
Cell |
findRandomCell()
Returns a cell randomly selected from the vector. |
CoordinateDiscrete |
findRandomCoordinate()
Returns a coordinate randomly selected from the vector's space. |
Agent[] |
getAgents()
Returns all agents in the scape as an array. |
Cell |
getCell(CoordinateDiscrete coordinate)
Returns the cell existing at the specified coordinate. |
Cell |
getCell(int xPosition)
Returns the cell existing at the specified coordinate. |
Cell[] |
getCells()
Returns all agents in the scape as an array of cells (use this method to avoid coercion of memebers to Cell.) |
Cell[] |
getCellsNear(Cell centralAgent,
int distance,
boolean includeSelf)
Returns cells that are near the provided cell. |
int |
getDistance(Cell origin,
Cell target)
|
int |
getSize()
Returns the size, or number of cells, of this ScapeVector. |
boolean |
hasWithin(Cell origin,
Conditional condition,
boolean includeOrigin,
double maximumDistance)
|
boolean |
isMutable()
Is the scape mutable, that is, can it change its structure at runtime? Returns true for this vector. |
ScapeIterator |
iterator()
|
Agent |
newAgent()
Creates a new cell in this vector by cloning the prototype agent, and initializes it. |
ScapeIterator |
randomIterator()
|
boolean |
removeAgent(Agent agent)
Removes the supplied agent from this vector. |
void |
removeAllAgents()
Removes the supplied agent from this vector. |
void |
removeAllElements()
Removes the supplied agent from this vector. |
boolean |
removeElement(Agent agent)
Removes the supplied agent from this vector. |
void |
setCell(CoordinateDiscrete coordinate,
Cell cell)
Sets the cell at the specified coordinate to the supplied cell. |
void |
setExtent(CoordinateDiscrete extent)
Sets the size of the vector, filling with clones of prototype agent. |
void |
setGeometry(Geometry geometry)
Sets the geometry of this scape. |
void |
setSize(int size)
Sets the size of the vector, filling with clones of prototype agent. |
void |
testSizeConsistency()
|
| Methods inherited from class edu.brook.ascape.model.ScapeGraph |
executeOnMembers,
findAvailable,
findAvailable,
findCells,
findCells,
findMaximumCell,
findMaximumWithin,
findOccupants,
findOccupants,
findRandomCell,
findRandomCells,
findRandomCells,
findRandomUnoccupiedCell,
findRandomUnoccupiedCell,
getExtent |
| Methods inherited from class edu.brook.ascape.model.CellOccupant |
die,
getAvailableNeighboringCells,
getCellsNearOnHost,
getHostCell,
getHostScape,
getNeighborsOnHost,
leave,
moveAway,
moveTo,
moveToRandomLocation,
moveToward,
randomWalk,
randomWalkAvailable,
setHostScape |
| Methods inherited from class edu.brook.ascape.model.Cell |
countNeighbors,
countWithin,
findMaximumWithin,
findNearestCell,
findNearestCell,
findNearestCell,
findRandomNeighbor,
getCellsNear,
getCoordinate,
getDistance,
getNeighbors,
getNeighbors,
getNetwork,
getOccupant,
hasWithin,
isAvailable,
isUpdateNeeded,
removeOccupant,
requestUpdate,
requestUpdateNext,
setCoordinate,
setNeighbors,
setNetwork,
setOccupant |
| Methods inherited from class edu.brook.ascape.model.Agent |
death,
deathCondition,
execute,
execute,
fission,
fissionCondition,
fissioning,
getColor,
getColor,
getImage,
getImage,
getModel,
isDelete,
isInitialized,
iterate,
markForDeletion,
metabolism,
move,
movement,
movementCondition,
play,
scapeCreated,
update |
| Methods inherited from class edu.brook.ascape.model.AscapeObject |
getRandom,
getRandomSeed,
getScape,
randomInRange,
randomInRange,
randomIs,
randomToLimit,
reseed,
setName,
setRandom,
setRandomSeed,
setScape |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public java.util.Vector vector
public static int ESTIMATED_MAXIMUM_SIZE
| Constructor Detail |
public ScapeVector()
public ScapeVector(java.lang.String name,
Cell prototypeAgent,
Coordinate1DDiscrete extent)
name - a descriptive name for the scapeprototypeAgent - the agent whose clones will be used to populate this scapeextent - a coordinate describing the size of this scape
public ScapeVector(java.lang.String name,
Cell prototypeAgent)
name - a descriptive name for the scapeprototypeAgent - the agent whose clones will be used to populate this scape| Method Detail |
public void setGeometry(Geometry geometry)
gometry - the basic geometry of this scapepublic void setExtent(CoordinateDiscrete extent)
extent - a coordinate describing the size of this scapepublic final boolean isMutable()
public void setSize(int size)
extent - a coordinate describing the size of this scapepublic void createScape()
public Cell getCell(int xPosition)
public void setCell(CoordinateDiscrete coordinate,
Cell cell)
public Cell getCell(CoordinateDiscrete coordinate)
public Cell findRandomCell()
public CoordinateDiscrete findRandomCoordinate()
public ScapeIterator iterator()
public ScapeIterator randomIterator()
public void testSizeConsistency()
public void deleteSweep()
public boolean contains(Agent a)
public int getSize()
public Agent newAgent()
public void addElement(Agent agent)
agent - the agent to addpublic void addAgent(Agent agent)
agent - the agent to add
public void addAgent(Agent agent,
boolean isParent)
agent - the agent to addisParent - should this scape be made the pareent scape of the agent?public boolean removeElement(Agent agent)
public boolean removeAgent(Agent agent)
public void removeAllElements()
public void removeAllAgents()
public java.util.Enumeration elements()
public Cell[] getCellsNear(Cell centralAgent,
int distance,
boolean includeSelf)
centralAgent - the agent to find cells neardistance - the distance to form centralCells to return cellsshould - supplied agent be included in the return set
public Cell findNearestCell(Cell origin,
Conditional condition)
public Cell findNearestCell(Cell origin,
Conditional condition,
boolean includeOrigin)
public Cell findNearestCell(Cell origin,
Conditional condition,
boolean includeOrigin,
double maximumDistance)
public boolean hasWithin(Cell origin,
Conditional condition,
boolean includeOrigin,
double maximumDistance)
public int countWithin(Cell origin,
Conditional condition,
boolean includeOrigin,
double maximumDistance)
public int getDistance(Cell origin,
Cell target)
public Cell[] getCells()
public Agent[] getAgents()
public java.lang.Object clone()
|
(c) 1998-2000 The Brookings Insitution Webpage |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||