org.ascape.model.space
Class SubContinuous

java.lang.Object
  extended by org.ascape.model.space.CollectionSpace
      extended by org.ascape.model.space.SubCollection
          extended by org.ascape.model.space.SubContinuous
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, Continuous, Mutable, Space, SubSpace, RandomFunctions
Direct Known Subclasses:
SubContinuous1D, SubContinuous2D

public abstract class SubContinuous
extends SubCollection
implements SubSpace, Continuous

A space containing a sub-population of agents that exist within some continuous space.

Since:
2.0
Version:
3.0
Author:
Miles Parker
See Also:
Serialized Form

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
SubContinuous()
          Constructs a sub-continuous space.
SubContinuous(CoordinateDiscrete extent)
          Constructs a sub-collection.
 
Method Summary
 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.
 Coordinate getExtent()
          Returns the extent of this subscape, always the same as the super space.
 int getSize()
          Return the number of agents in the space.
 void normalize(Coordinate coor)
          Converts the coordiante into the boundaries of the space.
 void setSize(int size)
          Sets the number of agents in the space.
 void setSuperSpace(Space superSpace)
          Sets the super space for this sub collection, that is, the collection defined to contain a superset of this space's agents.
 
Methods inherited from class org.ascape.model.space.SubCollection
add, addAll, calculateDistance, clear, getSuperSpace, moveAway, moveToward, populate, remove, removeAll, retainAll
 
Methods inherited from class org.ascape.model.space.CollectionSpace
add, calculateDistance, 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, getGeometry, getRandom, hasWithin, initialize, isDeleteSweepNeeded, isEmpty, isMutable, isPeriodic, iterator, iteratorCount, iteratorToList, newLocation, newLocation, randomInRange, randomInRange, randomIs, randomizeOrder, randomToLimit, 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.SubSpace
getSuperSpace
 
Methods inherited from interface org.ascape.model.space.Continuous
moveToward
 
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

SubContinuous

public SubContinuous()
Constructs a sub-continuous space.


SubContinuous

public SubContinuous(CoordinateDiscrete extent)
Constructs a sub-collection.

Parameters:
extent - a coordinate describing the size of this space
Method Detail

coordinateSweep

public void coordinateSweep()
A no-op; overrides the base collection's behavior so that agents do not have their coorinates changed.


setSuperSpace

public void setSuperSpace(Space superSpace)
Sets the super space for this sub collection, that is, the collection defined to contain a superset of this space's agents. Checks to ensure that the super space is the appropriate type.

Specified by:
setSuperSpace in interface SubSpace
Overrides:
setSuperSpace in class SubCollection
Parameters:
superSpace - the collection to assign as super set

distancePerIteration

public double distancePerIteration(double velocity)
Description copied from interface: Continuous
Distance per iteration.

Specified by:
distancePerIteration in interface Continuous
Parameters:
velocity - the velocity
Returns:
the double

findRandomCoordinate

public Coordinate findRandomCoordinate()
Description copied from class: CollectionSpace
Returns a coordinate randomly selected from the collection's space.

Specified by:
findRandomCoordinate in interface Continuous
Specified by:
findRandomCoordinate in interface Space
Overrides:
findRandomCoordinate in class CollectionSpace
Returns:
the coordinate

normalize

public void normalize(Coordinate coor)
Description copied from interface: Continuous
Converts the coordiante into the boundaries of the space. If the cooridnate is out of bounds, adds or substracts the bounds as appropriate to bring the coordinate into a common sapce mod boundary.

Specified by:
normalize in interface Continuous
Parameters:
coor - the Coordinate to normalize

setSize

public void setSize(int size)
Sets the number of agents in the space.

Specified by:
setSize in interface Space
Overrides:
setSize in class CollectionSpace
Parameters:
size - the size

getSize

public int getSize()
Return the number of agents in the space.

Specified by:
getSize in interface Space
Overrides:
getSize in class CollectionSpace
Returns:
the size

getExtent

public Coordinate getExtent()
Returns the extent of this subscape, always the same as the super space.

Specified by:
getExtent in interface Space
Overrides:
getExtent in class CollectionSpace
Returns:
the extent


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.