|
||||||||||
| 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.Singleton
public class Singleton
A space with treates itself as its only member. This provides agents with a way to have single rules implemented upon them and to support views.
| 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 | |
|---|---|
Singleton()
Construct a new Singleton. |
|
| Method Summary | |
|---|---|
double |
calculateDistance(Coordinate origin,
Coordinate target)
Returns the shortest distance between one agent and another. |
void |
construct()
Normally, create the basic strucutre of the space. |
Location |
findRandom()
Returns an agent randomly selected from the collection. |
Coordinate |
findRandomCoordinate()
Returns a coordinate randomly selected from the collection's space. |
Location[] |
getLocations()
Returns all agents in the space as an array. |
int |
getSize()
Returns the number of members of this space. |
boolean |
isMutable()
Is the context mutable, that is, can it change its structure at runtime? Returns true for this collection. |
java.util.Iterator |
iterator()
Returns an iterator across all agents in this context. |
void |
moveAway(Location origin,
Coordinate target,
double distance)
Moves an agent toward the specified agent. |
void |
moveToward(Location origin,
Coordinate target,
double distance)
Moves an agent toward the specified agent. |
void |
populate()
Normally, populates the space with instances of its protoype agent. |
ResetableIterator |
safeIterator()
Returns a context iterator across all objects in this context. |
ResetableIterator |
safeIterator(int start,
int limit)
Safe iterator. |
RandomIterator |
safeRandomIterator()
Returns a context iterator across all agents in random order. |
void |
setExtent(Coordinate extent)
Sets the size of the context. |
java.lang.String |
toString()
Returns a string representing this space. |
| Methods inherited from class org.ascape.model.space.CollectionSpace |
|---|
add, add, addAll, calculateDistance, clear, clone, conditionalIterator, conditionalIterator, contains, containsAll, countWithin, createOrder, createSpatialConditional, deleteSweep, filter, find, findMaximum, findMaximum, findMaximumWithin, findMinimum, findMinimum, findMinimumWithin, findNearest, findNearest, findRandom, findRandom, findRandom, findRandomWithin, findWithin, get, getContext, getExtent, getGeometry, getRandom, hasWithin, initialize, isDeleteSweepNeeded, isEmpty, isPeriodic, iteratorCount, iteratorToList, newLocation, newLocation, randomInRange, randomInRange, randomIs, randomizeOrder, randomToLimit, remove, removeAll, retainAll, safeIterators, set, setContext, setExtent, setGeometry, setPeriodic, setRandom, setSize, size, toArray, toArray, toList, withinIterator |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public Singleton()
| Method Detail |
|---|
public int getSize()
getSize in interface SpacegetSize in class CollectionSpacepublic void construct()
construct in interface Spaceconstruct in class CollectionSpacepublic void populate()
populate in interface Spacepopulate in class CollectionSpacepublic java.util.Iterator iterator()
CollectionSpace
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in class CollectionSpace
public ResetableIterator safeIterator(int start,
int limit)
Space
safeIterator in interface SpacesafeIterator in class CollectionSpacestart - the startlimit - the limit
public ResetableIterator safeIterator()
CollectionSpace
safeIterator in interface SpacesafeIterator in class CollectionSpacepublic RandomIterator safeRandomIterator()
CollectionSpace
safeRandomIterator in interface SpacesafeRandomIterator in class CollectionSpacepublic Location[] getLocations()
public void moveToward(Location origin,
Coordinate target,
double distance)
moveToward in interface SpacemoveToward in class CollectionSpaceorigin - the agent movingtarget - the agent's targetdistance - the distance to move
public void moveAway(Location origin,
Coordinate target,
double distance)
moveAway in interface SpacemoveAway in class CollectionSpaceorigin - the agent movingtarget - the agent's targetdistance - the distance to move
public double calculateDistance(Coordinate origin,
Coordinate target)
calculateDistance in interface SpacecalculateDistance in class CollectionSpaceorigin - the starting celltarget - the ending cell
public java.lang.String toString()
toString in class java.lang.Objectpublic Location findRandom()
CollectionSpace
findRandom in interface SpacefindRandom in class CollectionSpacepublic Coordinate findRandomCoordinate()
CollectionSpace
findRandomCoordinate in interface SpacefindRandomCoordinate in class CollectionSpacepublic void setExtent(Coordinate extent)
CollectionSpace
setExtent in interface SpacesetExtent in class CollectionSpaceextent - a coordinate at the maximum extentpublic final boolean isMutable()
CollectionSpace
isMutable in interface SpaceisMutable in class CollectionSpace
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||