

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.ascape.model.space.Geometry
public class Geometry
An encapsulation of all of the potential space definitions for any space of agents, and a factory for creating realizations of these scapes. At the moment, only onedimensional and twodimensional spaces are represented, but this class should eventually suport ndimensional spaces, nondiscrete spaces, and complex graphs. Users of this class are encouraged to use the static definitions whenever possible.
Field Summary  

static int 
EUCLIDIAN
In a Euclidian neighborhood, cells are considered neighbors if they meet the target at any point: 
static int 
MOORE
In a Moore neighborhood, cells are considered neighbors if they meet the target at any point: 
static int 
NOT_APPLICABLE
Neighborhood not applicable. 
static int 
VON_NEUMANN
In a von Neumann neighborhood, cells are considered neighbors if they share an edge with the target: 
Constructor Summary  

Geometry()
Creates an empty geometry. 

Geometry(int dimensionCount)
Creates a nonperiodic, discrete, geometry with no neighborhood definition. 

Geometry(int dimensionCount,
boolean periodic)
Constructs a new fixed size, discrete geometry with the appropriate specifications and no neighborhood definition. 

Geometry(int dimensionCount,
boolean periodic,
boolean fixedSize,
boolean discrete,
int neighborhood)
Constructs a new geometry with the appropriate specifications. 

Geometry(int dimensionCount,
boolean periodic,
int neighborhood)
Constructs a new fixed size, discrete 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 
isFixedSize()
Returns wether this geometry has a fixed size. 
boolean 
isPeriodic()
Is the geometry periodic or aperiodic? (Do edges wrap to opposite side or not?). 
void 
setDimensionCount(int dimensionCount)
Sets the number of dimensions for this lattice. 
void 
setDiscrete(boolean discrete)
Sets the geometry to discrete or continous. 
void 
setFixedSize(boolean fixedSize)
Sets wether this geometry has a fixed size. 
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 static final int MOORE
OOO OXO OOO.
public static final int VON_NEUMANN
O OXO O.
public static final int EUCLIDIAN
OOO OXO OOOThis 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
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, boolean periodic, int neighborhood)
dimensionCount
 the number of dimensions of the spaceperiodic
 if the space is connected, or if it has an edgeneighborhood
 whether the geometry' assumed neighborhood is Moore, von
Neumann, or not applicable for this geometrypublic Geometry(int dimensionCount, boolean periodic)
dimensionCount
 the number of dimensions of the spaceperiodic
 if the space is connected, or if it has an edgepublic Geometry(int dimensionCount)
dimensionCount
 the dimension countpublic Geometry()
Method Detail 

public int getDimensionCount()
public void setDimensionCount(int dimensionCount)
dimensionCount
 the number of dimensionspublic boolean isPeriodic()
public void setPeriodic(boolean periodic)
periodic
 true if periodic (wraps around at each edge), 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 boolean isFixedSize()
public void setFixedSize(boolean fixedSize)
fixedSize
 should the space always have the same size?public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 