|
|
|||||||||
| 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
The base class for all members of lattices. Currently considered a node, although nodes might be become a superclass of this class as the notion of a coordinate may not be useful in all graphs.
| Field Summary | |
protected Cell[] |
cellsNear
Cells near to this one in ever exanding radiis, including self. |
protected CoordinateDiscrete |
coordinate
The coordinate location of this cell within the relevant scape. |
protected Cell[] |
neighbors
For better performance we store neighbors so we only have to calculate them once. |
protected int |
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 | |
Cell()
|
|
| Method Summary | |
java.lang.Object |
clone()
Clones the host cell, making coordinate null. |
int |
countNeighbors(Conditional condition)
Returns the number of cells that are neighbors and that meet the supplied condition. |
int |
countWithin(Conditional condition,
boolean includeOrigin,
double maximumDistance)
Returns the number of cells within the supplied distance that meet the supplied condition. |
void |
die()
Kill the agent. |
Cell |
findMaximumWithin(DataPoint point,
int distance,
boolean includeOrigin)
|
Cell |
findNearestCell(Conditional condition)
Finds the nearest cell that meets some condition. |
Cell |
findNearestCell(Conditional condition,
boolean includeOrigin)
Finds the nearest cell that meets some condition. |
Cell |
findNearestCell(Conditional condition,
boolean includeOrigin,
double maximumDistance)
Finds the nearest cell that meets some condition. |
Cell |
findRandomNeighbor()
Returns a cell randomly selected from among this cell's neighbors. |
Cell[] |
getCellsNear(int distance,
boolean includeSelf)
Returns cells that are near this cell. |
CoordinateDiscrete |
getCoordinate()
Gets the location of this cell within the relevant scape. |
int |
getDistance(Cell target)
|
Cell[] |
getNeighbors()
Returns this cells neighbors, that is, the set of cells adjoing this cell as defined by the scape's geometry. |
java.util.Vector |
getNeighbors(Conditional condition)
Returns the neighbors of the cell that meet the supplied condition. |
Cell[] |
getNetwork()
Returns some network of related cells. |
CellOccupant |
getOccupant()
Returns any occupants of this cell. |
boolean |
hasWithin(Conditional condition,
boolean includeOrigin,
double maximumDistance)
Returns true of there is a cell within the supplied distance that meets the supplied condition. |
void |
initialize()
Initializes the cell, calculating neighbors if appropriate. |
boolean |
isAvailable()
Is this cell available for occupation? Again, this will always return false because base cells can not host agents. |
boolean |
isUpdateNeeded(int within)
Has a view update been requested for this cell? |
void |
removeOccupant()
Removes this cell's occupant. |
void |
requestUpdate()
Indicate to all views of this cell that an update is needed. |
void |
requestUpdateNext()
Indicate to all views of this cell that an update is needed next iteration. |
void |
setCoordinate(CoordinateDiscrete coordinate)
Returns the extent of the nth dimension. |
void |
setNeighbors(Cell[] neighbors)
Sets this cell's neighbors. |
void |
setNetwork(Cell[] network)
Sets a network of related cells. |
void |
setOccupant(CellOccupant occupant)
Sets this cell's occupant. |
java.lang.String |
toString()
A string representation of this cell. |
| Methods inherited from class edu.brook.ascape.model.Agent |
death,
deathCondition,
execute,
execute,
fission,
fissionCondition,
fissioning,
getColor,
getColor,
getImage,
getImage,
getIteration,
getModel,
getRoot,
isDelete,
isInitialized,
iterate,
markForDeletion,
metabolism,
move,
movement,
movementCondition,
play,
scapeCreated,
update |
| Methods inherited from class edu.brook.ascape.model.AscapeObject |
getName,
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 |
protected CoordinateDiscrete coordinate
protected Cell[] neighbors
protected Cell[] cellsNear
protected int thisUpdate
| Constructor Detail |
public Cell()
| Method Detail |
public CoordinateDiscrete getCoordinate()
int - dimensionCount the number of dimensionspublic void setCoordinate(CoordinateDiscrete coordinate)
public void initialize()
public void die()
public Cell[] getNeighbors()
public Cell[] getCellsNear(int distance,
boolean includeSelf)
centralAgent - the agent to find cells neardistance - the distance from origin to return cellsincludeSelf - should supplied agent be included in the return setpublic Cell findNearestCell(Conditional condition)
condition - the condition that found cell must meet
public Cell findNearestCell(Conditional condition,
boolean includeOrigin)
condition - the condition that found cell must meetincludeOrigin - should this agent be included in the search
public Cell findNearestCell(Conditional condition,
boolean includeOrigin,
double maximumDistance)
condition - the condition that found cell must meetincludeOrigin - should this agent be included in the searchmaximumDistance - the maximum distance to search within
public Cell findMaximumWithin(DataPoint point,
int distance,
boolean includeOrigin)
public java.util.Vector getNeighbors(Conditional condition)
condition - the condition that found cell must meetpublic int countNeighbors(Conditional condition)
condition - the condition that found cell must meet
public boolean hasWithin(Conditional condition,
boolean includeOrigin,
double maximumDistance)
condition - the condition that found cell must meetincludeOrigin - should this cell be included in the searchmaximumDistance - the distance to search within
public int countWithin(Conditional condition,
boolean includeOrigin,
double maximumDistance)
condition - the condition that found cell must meetincludeOrigin - should this cell be included in the countmaximumDistance - the distance to search withinpublic int getDistance(Cell target)
public void setNeighbors(Cell[] neighbors)
neighbors - the array of neighbors to setpublic Cell findRandomNeighbor()
public CellOccupant getOccupant()
public Cell[] getNetwork()
public void setNetwork(Cell[] network)
public boolean isAvailable()
public void setOccupant(CellOccupant occupant)
public void removeOccupant()
public void requestUpdate()
public void requestUpdateNext()
public boolean isUpdateNeeded(int within)
public java.lang.Object clone()
public java.lang.String toString()
|
(c) 1998-2000 The Brookings Insitution Webpage |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||