|
|
|||||||||
| 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
An occupant of a cell within a lattice.
| Field Summary | |
static Rule |
MOVE_RANDOM_LOCATION_RULE
A rule causing the taget agent to move to a random location. |
static Rule |
PLAY_HOST_RULE
An rule causing the target agent to interact with each of its neighbors as specified by the Agent.play() method. |
static Rule |
PLAY_NEIGHBORS_RULE
An rule causing the target agent to interact with each of its neighbors as specified by the Agent.play() method. |
static Rule |
PLAY_OTHER
An rule causing the target agent to interact with another agent in its scape using the Agent.play() method. |
static Rule |
RANDOM_WALK_AVAILABLE_RULE
A rule causing the taget agent to take a random walk. |
static Rule |
RANDOM_WALK_RULE
A rule causing the taget agent to take a random walk. |
| 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 | |
CellOccupant()
|
|
| Method Summary | |
java.lang.Object |
clone()
Clone this occupant, making host cell and coordinate null, since for a base cell occupant it is illegal for more than one cell to occupy the same location. |
void |
die()
Removes the agent from play, causing it to vacate its host cell. |
Cell[] |
getAvailableNeighboringCells()
Returns unoccupied cells neighboring this cell's location on the host cell's lattice. |
Cell[] |
getCellsNearOnHost(int distance,
boolean includeSelf)
Return other cell occupants near host cell on host scape. |
HostCell |
getHostCell()
Returns the cell that this cell occupies in the host cell's lattice. |
ScapeGraph |
getHostScape()
Returns the lattice that hosts this cell. |
Cell[] |
getNeighborsOnHost()
Overides the getNeighbors method to return the cell's occupants neighboring this cell's location on its host cell's lattice. |
void |
leave()
Removes this cell from the current host cell. |
void |
moveAway(HostCell targetCell)
Move one step toward the occupant of the supplied host cell. |
void |
moveTo(HostCell hostCell)
Assigns this cell as the occupant of the supplied host cell. |
void |
moveToRandomLocation()
Moves this cell to a random unoccupied location on the host scape. |
void |
moveToward(HostCell targetCell)
Move one step toward the occupant of the supplied host cell. |
void |
randomWalk()
Picks a random neighboring location on the host cell's lattice. |
void |
randomWalkAvailable()
Picks a random available neighboring location on the host cell's lattice. |
void |
setHostScape(ScapeGraph hostScape)
Sets the lattice that hosts this cell. |
| Methods inherited from class edu.brook.ascape.model.Cell |
countNeighbors,
countWithin,
findMaximumWithin,
findNearestCell,
findNearestCell,
findNearestCell,
findRandomNeighbor,
getCellsNear,
getCoordinate,
getDistance,
getNeighbors,
getNeighbors,
getNetwork,
getOccupant,
hasWithin,
initialize,
isAvailable,
isUpdateNeeded,
removeOccupant,
requestUpdate,
requestUpdateNext,
setCoordinate,
setNeighbors,
setNetwork,
setOccupant,
toString |
| 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 |
public static final Rule MOVE_RANDOM_LOCATION_RULE
public static final Rule PLAY_HOST_RULE
public static final Rule PLAY_NEIGHBORS_RULE
public static final Rule PLAY_OTHER
public static final Rule RANDOM_WALK_RULE
public static final Rule RANDOM_WALK_AVAILABLE_RULE
| Constructor Detail |
public CellOccupant()
| Method Detail |
public void leave()
public void moveTo(HostCell hostCell)
hostCell - the host to assign this cell topublic void moveToward(HostCell targetCell)
hostCell - the host to move towardspublic void moveAway(HostCell targetCell)
hostCell - the host to move towardspublic void moveToRandomLocation()
public void die()
public HostCell getHostCell()
public ScapeGraph getHostScape()
public void setHostScape(ScapeGraph hostScape)
public Cell[] getNeighborsOnHost()
public Cell[] getCellsNearOnHost(int distance,
boolean includeSelf)
public Cell[] getAvailableNeighboringCells()
public void randomWalk()
randomWalkAvailable.
In this case, a random neighboring cell is slected. If, and only if, that cell is
unoccupied, does the agent move to it.
This means, for instance, that a neighboring cell might be available but
the cell occupant migh select an occupied cell and thus not move.randomWalkAvailablepublic void randomWalkAvailable()
randomWalk.
In this case, all available neigbors are first found, and then one of those cells
is randomly selected and moved to.
This means that if there is even one unoccpied cell available, the cell occupant
will move to it.randomWalkpublic 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 | |||||||||