org.ascape.gis.model
Class Globe

java.lang.Object
  extended by org.ascape.model.space.CollectionSpace
      extended by org.ascape.model.space.Continuous2D
          extended by org.ascape.gis.model.Globe
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, Continuous, Mutable, Space, RandomFunctions

public class Globe
extends Continuous2D

A scape containing a population of agents that exist within a map of space on the earth. This is designed to work with OpenMap and all its Location and OMRaster stuff. if you don't want to use it, use ScapeContinuous2D.

Since:
2.0
Version:
2.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
static double AVERAGE_EARTH_RADIUS
          The average radius of the earth
 
Fields inherited from class org.ascape.model.space.CollectionSpace
collection, ESTIMATED_MAXIMUM_SIZE, extent, geometry
 
Constructor Summary
Globe()
           
 
Method Summary
 double calculateDistance(Coordinate origin, Coordinate target)
          Returns the shortest distance between one LocatedAgent and another.
 double distancePerIteration(double velocity)
          Returns the distance an agent can move in one iteration, given its velocity.
 int getSecondsPerIteration()
           
 void moveToward(Location origin, Coordinate target, double distance)
          Moves an agent from its original coordinate towards its target coordinate.
 void setSecondsPerIteration(int secondsPerIteration)
           
 
Methods inherited from class org.ascape.model.space.Continuous2D
calculateRelativePosition, calculateRelativePosition, coordinateSweep, findRandomCoordinate, getSize, moveAway, normalize, populate, setSize
 
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
 

Field Detail

AVERAGE_EARTH_RADIUS

public static final double AVERAGE_EARTH_RADIUS
The average radius of the earth

See Also:
Constant Field Values
Constructor Detail

Globe

public Globe()
Method Detail

distancePerIteration

public double distancePerIteration(double velocity)
Returns the distance an agent can move in one iteration, given its velocity. This assumes 60 seconds per iteration.

Specified by:
distancePerIteration in interface Continuous
Overrides:
distancePerIteration in class Continuous2D
Parameters:
velocity - the agent's velocity
Returns:
the distance

moveToward

public void moveToward(Location origin,
                       Coordinate target,
                       double distance)
Moves an agent from its original coordinate towards its target coordinate. This method uses the GreatCircle eqation.

Specified by:
moveToward in interface Continuous
Specified by:
moveToward in interface Space
Overrides:
moveToward in class Continuous2D
Parameters:
origin - the origin coordinate
target - the target coordinate
distance - the maximum distance that can be traveled

calculateDistance

public double calculateDistance(Coordinate origin,
                                Coordinate target)
Returns the shortest distance between one LocatedAgent and another.

Specified by:
calculateDistance in interface Space
Overrides:
calculateDistance in class Continuous2D
Parameters:
origin - one LocatedAgent
target - another LocatedAgent
Returns:
the shortest distance

getSecondsPerIteration

public int getSecondsPerIteration()

setSecondsPerIteration

public void setSecondsPerIteration(int secondsPerIteration)


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