|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ascape.model.space.CollectionSpace
org.ascape.model.space.Continuous2D
public class Continuous2D
A space containing a population of agents that exist within some continuous space. Note that this space is also an instance of CollectionSpace so it will not work to check for continuous scapes by doing something like !instanceof Discrete.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.ascape.model.space.CollectionSpace |
|---|
CollectionSpace.ClosestDataPoint, CollectionSpace.ConditionalIterator, CollectionSpace.CSIterator, CollectionSpace.CSMutableIterator, CollectionSpace.ListMutableRandomIterator, CollectionSpace.ListRandomIterator, CollectionSpace.MutableSubIterator, CollectionSpace.SubIterator |
| Field Summary |
|---|
| Fields inherited from class org.ascape.model.space.CollectionSpace |
|---|
collection, ESTIMATED_MAXIMUM_SIZE, extent, geometry |
| Constructor Summary | |
|---|---|
Continuous2D()
Constructs a continuous two-dimensional space (plane or torous). |
|
Continuous2D(Coordinate2DContinuous extent)
Constructs a continuous two-dimensional space (plane or torous). |
|
| Method Summary | |
|---|---|
double |
calculateDistance(Coordinate origin,
Coordinate target)
Returns the shortest distance between one Location and another. |
Coordinate |
calculateRelativePosition(Coordinate origin,
Coordinate target)
Returns the shortest relative position of two agents. |
Coordinate |
calculateRelativePosition(Location origin,
Location target)
Returns the shortest relative position of two agents. |
void |
coordinateSweep()
A no-op; overrides the base collection's behavior so that agents do not have their coorinates changed. |
double |
distancePerIteration(double velocity)
Distance per iteration. |
Coordinate |
findRandomCoordinate()
Returns a coordinate randomly selected from the collection's space. |
int |
getSize()
Return the number of agents in the space. |
void |
moveAway(Location origin,
Coordinate target,
double distance)
Moves an agent from its original coordinate away from the target coordinate. |
void |
moveToward(Location origin,
Coordinate target,
double distance)
Moves an agent from its original coordinate towards its target coordinate. |
void |
normalize(Coordinate coor)
Converts the coordiante into the boundaries of the space. |
void |
populate()
Populate. |
void |
setSize(int size)
Sets the number of agents in the space. |
| Methods inherited from class org.ascape.model.space.CollectionSpace |
|---|
add, add, addAll, calculateDistance, clear, clone, conditionalIterator, conditionalIterator, construct, contains, containsAll, countWithin, createOrder, createSpatialConditional, deleteSweep, filter, find, findMaximum, findMaximum, findMaximumWithin, findMinimum, findMinimum, findMinimumWithin, findNearest, findNearest, findRandom, findRandom, findRandom, findRandom, findRandomWithin, findWithin, get, getContext, getExtent, getGeometry, getRandom, hasWithin, initialize, isDeleteSweepNeeded, isEmpty, isMutable, isPeriodic, iterator, iteratorCount, iteratorToList, newLocation, newLocation, randomInRange, randomInRange, randomIs, randomizeOrder, randomToLimit, remove, removeAll, retainAll, safeIterator, safeIterator, safeIterators, safeRandomIterator, set, setContext, setExtent, setExtent, setGeometry, setPeriodic, setRandom, size, toArray, toArray, toList, withinIterator |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.ascape.model.space.Mutable |
|---|
clear, deleteSweep, isDeleteSweepNeeded, newLocation, newLocation, remove |
| Methods inherited from interface java.util.Collection |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public Continuous2D()
public Continuous2D(Coordinate2DContinuous extent)
extent - a coordinate describing the size of this space| Method Detail |
|---|
public void coordinateSweep()
public void populate()
Space
populate in interface Spacepopulate in class CollectionSpace
public double calculateDistance(Coordinate origin,
Coordinate target)
calculateDistance in interface SpacecalculateDistance in class CollectionSpaceorigin - one Locationtarget - another Location
public Coordinate calculateRelativePosition(Location origin,
Location target)
origin - one Locationtarget - another Location
public Coordinate calculateRelativePosition(Coordinate origin,
Coordinate target)
origin - one Locationtarget - another Location
public double distancePerIteration(double velocity)
Continuous
distancePerIteration in interface Continuousvelocity - the velocity
public Coordinate findRandomCoordinate()
CollectionSpace
findRandomCoordinate in interface ContinuousfindRandomCoordinate in interface SpacefindRandomCoordinate in class CollectionSpace
public void moveToward(Location origin,
Coordinate target,
double distance)
moveToward in interface ContinuousmoveToward in interface SpacemoveToward in class CollectionSpaceorigin - the origin coordinatetarget - the target coordinatedistance - the maximum distance that can be traveled
public void moveAway(Location origin,
Coordinate target,
double distance)
moveAway in interface SpacemoveAway in class CollectionSpaceorigin - the origin coordinatetarget - the target coordinatedistance - the maximum distance that can be traveledpublic void normalize(Coordinate coor)
normalize in interface Continuouscoor - the Coordinate to normalizepublic void setSize(int size)
setSize in interface SpacesetSize in class CollectionSpacesize - the sizepublic int getSize()
getSize in interface SpacegetSize in class CollectionSpace
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||