|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ascape.model.AscapeObject
org.ascape.model.Agent
org.ascape.model.LocatedAgent
org.ascape.model.Cell
org.ascape.model.HostCell
public class HostCell
An cell capable fo serving as a 'home' for agents. At the moment, only one agent per cell can be hosted, but note that that cell can obviosuly be an instance of Scape such as a list.
| Field Summary | |
|---|---|
static Conditional |
IS_AVAILABLE
|
static Conditional |
IS_OCCUPIED
|
protected CellOccupant |
occupant
The occupant, if any, of this cell. |
| Fields inherited from class org.ascape.model.Cell |
|---|
CALCULATE_NEIGHBORS_RULE, neighbors, PLAY_NEIGHBORS_RULE, PLAY_RANDOM_NEIGHBOR_RULE |
| Fields inherited from class org.ascape.model.LocatedAgent |
|---|
agentSize, coordinate, MOVE_RANDOM_LOCATION_RULE, RANDOM_WALK_RULE, thisUpdate |
| Fields inherited from class org.ascape.model.Agent |
|---|
DEATH_RULE, FISSIONING_RULE, FORCE_DIE_RULE, FORCE_FISSION_RULE, FORCE_MOVE_RULE, INITIALIZE_RULE, ITERATE_AND_UPDATE_RULE, ITERATE_RULE, METABOLISM_RULE, MOVEMENT_RULE, PLAY_OTHER, UPDATE_RULE |
| Fields inherited from class org.ascape.model.AscapeObject |
|---|
ARBITRARY_SEED, name, PLATFORM_DEFAULT_COLOR, scape |
| Constructor Summary | |
|---|---|
HostCell()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clones the host cell, making occupant and neighbors null. |
java.util.List |
findAvailableNeighbors()
Returns all neighboring cells which are available for occupation. |
LocatedAgent |
findNearestOccupants()
Returns the closest agent. |
LocatedAgent |
findNearestOccupants(Conditional condition)
Returns the closest agent within the specified distance from this agent that meet some condition. |
LocatedAgent |
findNearestOccupants(Conditional condition,
boolean includeSelf,
double distance)
Returns the closest agent within the specified distance from this agent that meet some condition. |
LocatedAgent |
findNearestOccupants(Conditional condition,
double distance)
Returns the closest agent within the specified distance from this agent that meet some condition. |
LocatedAgent |
findNearestOccupants(double distance)
Returns the closest agent within the specified distance from this agent that meet some condition. |
java.util.List |
findNeighboringOccupants()
Returns all occupants of neighboring cells. |
java.util.List |
findOccupantsWithin(Conditional condition,
boolean includeSelf,
double distance)
|
java.util.List |
findOccupantsWithin(Conditional condition,
double distance)
|
java.util.List |
findOccupantsWithin(double distance)
|
HostCell |
findRandomAvailableNeighbor()
Gets a random neighboring host cell. |
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. |
Node |
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 |
setNeighborsList(java.util.List neighbors)
Sets this cell's neighbors. |
void |
setOccupant(Node occupant)
Host the supplied occupant. |
| Methods inherited from class org.ascape.model.Cell |
|---|
calculateNeighbors, countNeighbors, findNeighbors, findOccupants, findRandomNeighbor, findRelative, getDistance, getNeighbors, getNeighbors, getNetwork, hostedCondition, initialize, playNeighbors, playRandomNeighbor, setNeighbors, setNetwork, toString |
| Methods inherited from class org.ascape.model.LocatedAgent |
|---|
calculateDistance, calculateDistance, countWithin, countWithin, countWithin, findMaximumWithin, findNearest, findNearest, findNearest, findNearest, findNearest, findWithin, findWithin, findWithin, findWithin, getAgentSize, getCoordinate, hasWithin, hasWithin, hasWithin, isUpdateNeeded, moveAway, moveAway, moveAway, moveTo, moveToRandomLocation, moveToward, moveToward, moveToward, randomWalk, requestUpdate, requestUpdateNext, setAgentSize, setCoordinate |
| Methods inherited from class org.ascape.model.Agent |
|---|
clearDeleteMarker, death, deathCondition, die, execute, execute, fission, fissionCondition, fissioning, getColor, getImage, getImage, getIteration, getPlatformColor, getRoot, isDelete, isInitialized, iterate, markForDeletion, metabolism, move, movement, movementCondition, play, scapeCreated, setInitialized, setScape, update |
| Methods inherited from class org.ascape.model.AscapeObject |
|---|
diffDeep, diffDeep, diffDeepBFS, diffDeepDFS, diffDeepValidate, diffDeepVisit, equalsDeep, equalsDeep, equalsDeep, getComparisonStream, getName, getRandom, getRandomSeed, getScape, randomInRange, randomInRange, randomIs, randomToLimit, reseed, setComparisonStream, setName, setRandom, setRandomSeed |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.ascape.model.space.Location |
|---|
clearDeleteMarker, getCoordinate, isDelete, markForDeletion, setCoordinate |
| Field Detail |
|---|
public static final Conditional IS_AVAILABLE
public static final Conditional IS_OCCUPIED
protected CellOccupant occupant
| Constructor Detail |
|---|
public HostCell()
| Method Detail |
|---|
public boolean isAvailable()
isAvailable in interface NodeisAvailable in class Cellpublic Node getOccupant()
getOccupant in interface NodegetOccupant in class Cellpublic void setNeighborsList(java.util.List neighbors)
setNeighborsList in class Cellneighbors - the array of neighbors to setpublic boolean isNeighborAvailable()
public HostCell findRandomAvailableNeighbor()
findRandomAvailableNeighbor in interface NodefindRandomAvailableNeighbor in class Cellpublic void setOccupant(Node occupant)
setOccupant in interface NodesetOccupant in class Celloccupant - the occupantpublic void removeOccupant()
removeOccupant in class Cellpublic java.util.List findNeighboringOccupants()
public java.util.List findOccupantsWithin(Conditional condition,
double distance)
public java.util.List findOccupantsWithin(double distance)
public java.util.List findOccupantsWithin(Conditional condition,
boolean includeSelf,
double distance)
public LocatedAgent findNearestOccupants()
public LocatedAgent findNearestOccupants(double distance)
distance - the distance agents must be within to be includedpublic LocatedAgent findNearestOccupants(Conditional condition)
condition - the condition the agent must meet to be included
public LocatedAgent findNearestOccupants(Conditional condition,
double distance)
condition - the condition the agent must meet to be includeddistance - the distance agents must be within to be included
public LocatedAgent findNearestOccupants(Conditional condition,
boolean includeSelf,
double distance)
condition - the condition the agent must meet to be includedincludeSelf - if the calling agent should be included in the searchdistance - the distance agents must be within to be includedpublic java.util.List findAvailableNeighbors()
public java.lang.Object clone()
clone in interface Locationclone in class Cellpublic java.awt.Color getColor()
getColor in class Agent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||