|
![]() |
|||||||||
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.MomentumAgent
public class MomentumAgent
An agent that has momentum and heading in space. We will soon replace velocity and heading with a single velocity vector coordinate.
Field Summary | |
---|---|
protected double |
heading
The heading is an angle, b/w 0 and 360 degrees (or 2 pi) |
protected double |
velocity
|
Fields inherited from class org.ascape.model.LocatedAgent |
---|
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, scape |
Constructor Summary | |
---|---|
MomentumAgent()
|
Method Summary | |
---|---|
double |
findHeadingAway(Coordinate target)
Finds the heading to point away from a particular direction. |
double |
findHeadingAway(LocatedAgent target)
Finds the heading to point away from a particular direction. |
double |
findHeadingToward(Coordinate target)
Finds the heading between current location and the one being passed in. |
double |
findHeadingToward(LocatedAgent target)
Finds the heading between current location and the one being passed in. |
int |
getAgentSize()
Returns the size of the agent. |
double |
getHeading()
|
double |
getVelocity()
|
void |
headAway(Coordinate target)
Sets the heading to point away from a particular direction. |
void |
headAway(LocatedAgent a)
Sets the heading to point away from a particular agent. |
void |
headToward(Coordinate target)
Sets the heading to point toward a particular direction. |
void |
headToward(LocatedAgent a)
Sets the heading to point toward a particular agent. |
void |
movement()
move to new location. |
void |
moveTo(Coordinate coordinate)
Moves to the coordiante specified. |
void |
moveTo(Coordinate coordinate,
boolean adjustHeading)
Moves to the coordiante specified. |
void |
moveToRandomLocation()
Moves this agent to a random unoccupied location on the host scape. |
void |
randomWalk()
Moves a set distance in a random direction. |
void |
setAgentSize(int agentSize)
Sets the size of the agent. |
void |
setHeading(double heading)
|
void |
setVelocity(double velocity)
|
java.lang.String |
toString()
A string representation of this cell. |
Methods inherited from class org.ascape.model.LocatedAgent |
---|
calculateDistance, calculateDistance, countWithin, countWithin, countWithin, findMaximumWithin, findNearest, findNearest, findNearest, findNearest, findNearest, findWithin, findWithin, findWithin, findWithin, getCoordinate, hasWithin, hasWithin, hasWithin, initialize, isUpdateNeeded, moveAway, moveAway, moveAway, moveToward, moveToward, moveToward, requestUpdate, requestUpdateNext, setCoordinate |
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, 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 |
---|
protected double velocity
protected double heading
Constructor Detail |
---|
public MomentumAgent()
Method Detail |
---|
public void moveToRandomLocation()
moveToRandomLocation
in class LocatedAgent
public void randomWalk()
randomWalk
in class LocatedAgent
public void moveTo(Coordinate coordinate)
moveTo
in class LocatedAgent
coordinate
- public void headToward(LocatedAgent a)
a
- the coordinate to point towardpublic double findHeadingToward(LocatedAgent target)
target
- the coordinate to point towardspublic void headAway(LocatedAgent a)
a
- the coordinate to point towardpublic void headToward(Coordinate target)
target
- the coordinate to point towardpublic double findHeadingToward(Coordinate target)
target
- the coordinate to point towardspublic void headAway(Coordinate target)
target
- the coordinate to point towardpublic double findHeadingAway(LocatedAgent target)
target
- the coordinate to point towardpublic double findHeadingAway(Coordinate target)
target
- the coordinate to point towardpublic void moveTo(Coordinate coordinate, boolean adjustHeading)
coordinate
- public int getAgentSize()
getAgentSize
in class LocatedAgent
public void setAgentSize(int agentSize)
setAgentSize
in class LocatedAgent
agentSize
- the desired size for this agent.public void movement()
movement
in class Agent
Agent.movementCondition()
,
Agent.MOVEMENT_RULE
public java.lang.String toString()
toString
in class LocatedAgent
public double getVelocity()
public void setVelocity(double velocity)
public double getHeading()
public void setHeading(double heading)
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |