|
|
|||||||||
| 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.HostCell
An cell capable fo serving as a 'home' for agents. At the moment, only one agent per cell can be hosted.
| Field Summary | |
protected HostCell[] |
availableNeighbors
Neighbors that are avaalbable, that is, possible to occupy. |
static Conditional |
IS_AVAILABLE
|
static Conditional |
IS_OCCUPIED
|
protected CellOccupant[] |
neighborOccupants
The collection of neighboring cells. |
protected CellOccupant |
occupant
The occupant, if any, of this cell. |
| 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 | |
HostCell()
|
|
| Method Summary | |
java.lang.Object |
clone()
Clones the host cell, making occupant and neighbors null. |
HostCell |
findRandomAvailableNeighbor()
Gets a random neighboring host cell. |
HostCell[] |
getAvailableNeighbors()
Returns all neighboring cells which are available for occupation. |
java.awt.Color |
getColor()
Returns the default color for this cell (green.) Override to provide another color, or provide a different color feature for your views. |
CellOccupant[] |
getNearOccupants(int distance,
boolean includeSelf)
Returns all occupants of nearby cells. |
CellOccupant[] |
getNeighboringOccupants()
Returns all occupants of neighboring cells. |
CellOccupant |
getOccupant()
Return the occupant of this cell, null if no occupant. |
boolean |
isAvailable()
Is this cell available (currently unoccupied?) |
boolean |
isNeighborAvailable()
Are their any neighboring cells that are available. |
void |
removeOccupant()
Evict the supplied occupant. |
void |
setOccupant(CellOccupant occupant)
Host the supplied occupant. |
| Methods inherited from class edu.brook.ascape.model.Cell |
countNeighbors,
countWithin,
die,
findMaximumWithin,
findNearestCell,
findNearestCell,
findNearestCell,
findRandomNeighbor,
getCellsNear,
getCoordinate,
getDistance,
getNeighbors,
getNeighbors,
getNetwork,
hasWithin,
initialize,
isUpdateNeeded,
requestUpdate,
requestUpdateNext,
setCoordinate,
setNeighbors,
setNetwork,
toString |
| Methods inherited from class edu.brook.ascape.model.Agent |
death,
deathCondition,
execute,
execute,
fission,
fissionCondition,
fissioning,
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 Conditional IS_AVAILABLE
public static final Conditional IS_OCCUPIED
protected CellOccupant occupant
protected CellOccupant[] neighborOccupants
protected HostCell[] availableNeighbors
| Constructor Detail |
public HostCell()
| Method Detail |
public boolean isAvailable()
public CellOccupant getOccupant()
public boolean isNeighborAvailable()
public HostCell findRandomAvailableNeighbor()
public void setOccupant(CellOccupant occupant)
public void removeOccupant()
public CellOccupant[] getNeighboringOccupants()
public CellOccupant[] getNearOccupants(int distance,
boolean includeSelf)
public HostCell[] getAvailableNeighbors()
public java.lang.Object clone()
public java.awt.Color getColor()
|
(c) 1998-2000 The Brookings Insitution Webpage |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||