|
![]() |
|||||||||
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
public class LocatedAgent
An agent that has a location in continuous space.
Field Summary | |
---|---|
protected int |
agentSize
Default agent size. |
protected Coordinate |
coordinate
The coordinate location of this cell within the relevant scape. |
static Rule |
MOVE_RANDOM_LOCATION_RULE
A rule causing the taget agent to move to a random location. |
static Rule |
RANDOM_WALK_RULE
A rule causing the taget agent to take a random walk. |
protected int |
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, scape |
Constructor Summary | |
---|---|
LocatedAgent()
|
Method Summary | |
---|---|
double |
calculateDistance(Coordinate target)
Return the distance between this agent and the supplied coordinate. |
double |
calculateDistance(LocatedAgent target)
Return the distance between this agent and the supplied agent. |
int |
countWithin(Conditional condition,
boolean includeSelf,
double distance)
Returns the number of agents within the specified distance of the agent that meet some condition. |
int |
countWithin(Conditional condition,
double distance)
Returns the number of agents within the specified distance of the agent that meet some condition. |
int |
countWithin(double distance)
Returns the number of agents within the specified distance of the agent. |
LocatedAgent |
findMaximumWithin(DataPoint data,
boolean includeSelf,
double distance)
|
LocatedAgent |
findNearest()
Returns the closest agent. |
LocatedAgent |
findNearest(Conditional condition)
Returns the closest agent that meet some condition. |
LocatedAgent |
findNearest(Conditional condition,
boolean includeSelf,
double distance)
Returns the closest agent within the specified distance from this agent that meet some condition. |
LocatedAgent |
findNearest(Conditional condition,
double distance)
Returns the closest agent within the specified distance from this agent that meet some condition. |
LocatedAgent |
findNearest(double distance)
Returns the closest agent within the specified distance from this agent. |
java.util.List |
findWithin(Conditional condition,
boolean includeSelf,
double distance)
Returns all agents within the specified distance of the agent that meet some condition. |
java.util.List |
findWithin(Conditional condition,
double distance)
Returns all agents within the specified distance of the agent that meet some condition, excluding this agent. |
java.util.List |
findWithin(double distance)
Returns all agents within the specified distance of the agent, excluding this agent. |
java.util.List |
findWithin(double distance,
boolean includeSelf)
Returns all agents within the specified distance of the agent, excluding this agent. |
int |
getAgentSize()
|
Coordinate |
getCoordinate()
Gets a coordinate the location of this cell within the relevant scape. |
boolean |
hasWithin(Conditional condition,
boolean includeSelf,
double distance)
Returns the number of agents within the specified distance of the agent that meet some condition. |
boolean |
hasWithin(Conditional condition,
double distance)
Returns the number of agents within the specified distance of the agent that meet some condition. |
boolean |
hasWithin(double distance)
Returns the number of agents within the specified distance of the agent. |
void |
initialize()
Initialize any values. |
boolean |
isUpdateNeeded(int within)
Has a view update been requested for this cell? |
void |
moveAway(Coordinate target)
Moves distance 1.0 toward the specified coordinate. |
void |
moveAway(Coordinate target,
double distance)
Moves distance 1.0 toward the specified coordinate. |
void |
moveAway(LocatedAgent target)
Moves distance 1.0 toward the specified agent. |
void |
moveTo(Coordinate coordinate)
Moves to the coordiante specified. |
void |
moveToRandomLocation()
Moves this agent to a random unoccupied location on the host scape. |
void |
moveToward(Coordinate target)
Moves distance 1.0 toward the specified coordinate. |
void |
moveToward(Coordinate target,
double distance)
Moves distance 1.0 toward the specified coordinate. |
void |
moveToward(LocatedAgent target)
Moves distance 1.0 toward the specified agent. |
void |
randomWalk()
Moves a set distance in a random direction. |
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 |
setAgentSize(int agentSize)
|
void |
setCoordinate(Coordinate coordinate)
Returns the extent of the nth dimension. |
java.lang.String |
toString()
A string representation of this cell. |
Methods inherited from class org.ascape.model.Agent |
---|
clearDeleteMarker, clone, death, deathCondition, die, execute, execute, fission, fissionCondition, fissioning, getColor, getColor, getImage, getImage, getIteration, 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, clone, isDelete, markForDeletion |
Field Detail |
---|
public static final Rule MOVE_RANDOM_LOCATION_RULE
public static final Rule RANDOM_WALK_RULE
protected Coordinate coordinate
protected int thisUpdate
protected int agentSize
Constructor Detail |
---|
public LocatedAgent()
Method Detail |
---|
public void initialize()
Agent
initialize
in interface Location
initialize
in class Agent
public void requestUpdate()
public void requestUpdateNext()
public boolean isUpdateNeeded(int within)
public Coordinate getCoordinate()
getCoordinate
in interface Location
public void setCoordinate(Coordinate coordinate)
setCoordinate
in interface Location
coordinate
- the new coordinatepublic LocatedAgent findNearest()
public LocatedAgent findNearest(double distance)
distance
- the distance agents must be within to be includedpublic LocatedAgent findNearest(Conditional condition)
condition
- the condition the agent must meet to be includedpublic LocatedAgent findNearest(Conditional condition, double distance)
condition
- the condition the agent must meet to be includeddistance
- the distance agents must be within to be includedpublic LocatedAgent findNearest(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 findWithin(double distance)
distance
- the distance agents must be within to be includedpublic java.util.List findWithin(double distance, boolean includeSelf)
distance
- the distance agents must be within to be includedpublic java.util.List findWithin(Conditional condition, double distance)
condition
- the condition the agent must meet to be includeddistance
- the distance agents must be within to be includedpublic java.util.List findWithin(Conditional condition, boolean includeSelf, double distance)
includeSelf
- if this agent should be included in the searchcondition
- the condition the agent must meet to be includeddistance
- the distance agents must be within to be includedpublic LocatedAgent findMaximumWithin(DataPoint data, boolean includeSelf, double distance)
public int countWithin(double distance)
distance
- the distance agents must be within to be includedpublic int countWithin(Conditional condition, double distance)
condition
- the condition the agent must meet to be includeddistance
- the distance agents must be within to be includedpublic int countWithin(Conditional condition, boolean includeSelf, double distance)
includeSelf
- whether or not this agent should be included in the countcondition
- the condition the agent must meet to be includeddistance
- the distance agents must be within to be includedpublic boolean hasWithin(double distance)
distance
- the distance agents must be within to be includedpublic boolean hasWithin(Conditional condition, double distance)
condition
- the condition the agent must meet to be includeddistance
- the distance agents must be within to be includedpublic boolean hasWithin(Conditional condition, boolean includeSelf, double distance)
includeSelf
- if this agent should be included in the searchcondition
- the condition the agent must meet to be includeddistance
- the distance agents must be within to be includedpublic void moveToward(LocatedAgent target)
target
- the agent to move towardpublic void moveToward(Coordinate target)
target
- the agent to move towardpublic void moveToward(Coordinate target, double distance)
target
- the agent to move towarddistance
- the distance to movepublic void moveAway(LocatedAgent target)
target
- the agent to move towardpublic void moveAway(Coordinate target)
target
- the agent to move towardpublic void moveAway(Coordinate target, double distance)
target
- the agent to move towarddistance
- the distance to movepublic void moveToRandomLocation()
public void randomWalk()
public void moveTo(Coordinate coordinate)
coordinate
- public double calculateDistance(LocatedAgent target)
public double calculateDistance(Coordinate target)
public int getAgentSize()
public void setAgentSize(int agentSize)
public java.lang.String toString()
toString
in class Agent
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |