|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.brook.ascape.model.Geometry
An encapsulation of all of the potential space definitions for any scape of agents, and a factory for creating realizations of these scapes. At the moment, only one-dimensional and two-dimensional spaces are represented, but this class should eventually suport n-dimensional spaces, non-discrete spaces, and complex graphs. Users of this class are encouraged to use the static definitions whenever possible.
| Field Summary | |
static Geometry |
APERIODIC_1D
The one-dimensional, aperiodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
APERIODIC_2D_EUCLIDIAN
The two-dimensional, aperiodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
APERIODIC_2D_MOORE
The two-dimensional, aperiodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
APERIODIC_2D_VON_NEUMANN
The two-dimensional, aperiodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
APERIODIC_3D
The three-dimensional, aperiodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
APERIODIC_VARIABLESIZED_1D
The one-dimensional, aperiodic geometry, of variable size and with discrete coordinates. |
int |
dimensionCount
If appropriate. |
boolean |
discrete
Does this geometry represent space as a set of discrete locations, or do all objects within it have a some aproximate location within continous space? For example, raster graphics would represent a discrete space, while vector graphics would represent a non-discrete space. |
static int |
EUCLIDIAN
In a Euclidian neighborhood, cells are considered neighbors if they meet the target at any point: OOO OXO OOO This is just an Ascape convention, but you probably shouldn't be concerned with neighbors in a Euclidian model anyway. |
boolean |
fixedSize
Is this geometry of fixed extent, as in an array or a closed space, or can it shrink and grow like a vector or open space? |
static int |
MOORE
In a Moore neighborhood, cells are considered neighbors if they meet the target at any point: OOO OXO OOO |
protected int |
neighborhood
The neighborhood (Moore or von Neumann) assumed for this lattice. |
static int |
NOT_APPLICABLE
Neighborhood not applicable |
boolean |
periodic
If appropriate. |
static Geometry |
PERIODIC_1D
The one-dimensional, periodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
PERIODIC_2D_EUCLIDIAN
The two-dimensional, periodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
PERIODIC_2D_MOORE
The two-dimensional, periodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
PERIODIC_2D_VON_NEUMANN
The two-dimensional, periodic geometry, of fixed size and with discrete coordinates. |
static Geometry |
STRETCHY_1D
The one-dimensional, aperiodic geometry, of fixed size and with discrete coordinates. |
static int |
VON_NEUMANN
In a von Neumann neighborhood, cells are considered neighbors if they share an edge with the target: O OXO O |
| Constructor Summary | |
Geometry(int dimensionCount)
Creates a closed, discreet, Geometry. |
|
Geometry(int dimensionCount,
boolean periodic,
boolean fixedSize,
boolean discrete,
int neighborhood)
Constructs a new geometry with the appropriate specifications. |
|
| Method Summary | |
java.lang.Object |
clone()
Clones the geometry. |
int |
getDimensionCount()
Returns the number of dimensions for this lattice. |
int |
getNeighborhood()
Returns the geometry's presumed neighborhood. |
boolean |
isDiscrete()
Is the geometry dicrete or continous? |
boolean |
isPeriodic()
Is the geometry periodic or aperiodic? (Do edges wrap to opposite side or not?) |
Scape |
newScape()
Creates an agent scape matching this geometry's specifications. |
Scape |
newScape(Agent prototypeAgent)
Creates an agent scape matching this geometry's specifications. |
Scape |
newScape(Agent prototypeAgent,
Coordinate extent)
Creates an agent scape matching this geometry's specifications. |
Scape |
newScape(java.lang.String agentClassName)
Creates an agent scape matching this geometry's specifications. |
void |
setDimensionCount(int dimensionCount)
Sets the number of dimensions for this lattice. |
void |
setDiscrete(boolean discrete)
Sets the geometry to discrete or continous. |
void |
setNeighborhood(int symbol)
Set the neighborhood to use for calculations within this geometry. |
void |
setPeriodic(boolean periodic)
Sets the geometry to periodic or aperiodic. |
java.lang.String |
toString()
A string representation of this geometry |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public boolean periodic
public boolean fixedSize
public boolean discrete
public int dimensionCount
public static final int MOORE
OOO
OXO
OOO public static final int VON_NEUMANN
O
OXO
O public static final int EUCLIDIAN
OOO
OXO
OOO
This is just an Ascape convention, but you probably shouldn't be concerned
with neighbors in a Euclidian model anyway. Instead, you will want to use distances,
so that distance 1 = immeadiate vN distance, and >= Sqrt(2) = immeadiate Moore distance.public static final int NOT_APPLICABLE
protected int neighborhood
public static final Geometry PERIODIC_1D
public static final Geometry APERIODIC_1D
public static final Geometry STRETCHY_1D
public static final Geometry APERIODIC_VARIABLESIZED_1D
public static final Geometry PERIODIC_2D_MOORE
public static final Geometry PERIODIC_2D_VON_NEUMANN
public static final Geometry PERIODIC_2D_EUCLIDIAN
public static final Geometry APERIODIC_2D_MOORE
public static final Geometry APERIODIC_2D_VON_NEUMANN
public static final Geometry APERIODIC_2D_EUCLIDIAN
public static final Geometry APERIODIC_3D
| Constructor Detail |
public Geometry(int dimensionCount,
boolean periodic,
boolean fixedSize,
boolean discrete,
int neighborhood)
dimensionCount - the number of dimensions of the spaceperiodic - if the space is connected, or if it has an edgefixedSize - if the space has a fixed extentdiscrete - if the geometry is made up of dicrete locations (nodes)neighborhood - whether the geometry' assumed neighborhood is Moore, von Neumann, or not applicable for this geometrypublic Geometry(int dimensionCount)
| Method Detail |
public Scape newScape()
public Scape newScape(Agent prototypeAgent)
prototypeAgent - an agent that may be cloned to populate the scapepublic Scape newScape(java.lang.String agentClassName)
agentClassName - the name of an agent to construct that may be cloned to populate the scape
public Scape newScape(Agent prototypeAgent,
Coordinate extent)
prototypeAgent - an agent that may be cloned to populate the scapeextent - the size of the scape; the coordinate at its maximium extentpublic int getDimensionCount()
public void setDimensionCount(int dimensionCount)
int - dimensionCount the number of dimensionspublic boolean isPeriodic()
public void setPeriodic(boolean periodic)
discrete - true if periodic, false is aperiodicpublic boolean isDiscrete()
public void setDiscrete(boolean discrete)
discrete - true if discrete, false is continouspublic int getNeighborhood()
public void setNeighborhood(int symbol)
symbol - the neighborhood, one of: MOORE, VON_NEUMANN, or NOT_APPLICABLEpublic java.lang.String toString()
public java.lang.Object clone()
|
(c) 1998-2000 The Brookings Insitution Webpage |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||