uchicago.src.sim.topology.space2
Class VonNeumannTopology

java.lang.Object
  extended byuchicago.src.sim.topology.space2.AbstractDiscrete2DTopology
      extended byuchicago.src.sim.topology.space2.VonNeumannTopology
All Implemented Interfaces:
RelationTopology

public class VonNeumannTopology
extends AbstractDiscrete2DTopology

Created by IntelliJ IDEA. User: thowe Date: Jun 16, 2003 Time: 1:08:59 PM To change this template use Options | File Templates.


Field Summary
static java.lang.String type
           
 
Fields inherited from class uchicago.src.sim.topology.space2.AbstractDiscrete2DTopology
comparator, space, torus
 
Constructor Summary
VonNeumannTopology(Discrete2DSpace g)
           
 
Method Summary
 double distance(java.lang.Object element1, java.lang.Object element2)
          Gets the distance between two objects in this topology.
 java.util.List getRelations(int x, int y, int[] extents, boolean returnNulls)
           
 java.util.List getRelations(java.lang.Object element)
          Get all of the relationships that the given element has with other elements.
 java.util.List getRelations(java.lang.Object element, double range)
          Gets all of the Objects within a given range.
 java.lang.String getRelationType()
          Get the type of relationship/topology that is represented by this Class.
 void setRelationType(java.lang.String type)
          Set the name for this type of relation.
 
Methods inherited from class uchicago.src.sim.topology.space2.AbstractDiscrete2DTopology
compareMax, compareMin, findMaximum, findMinimum, setComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public static java.lang.String type
Constructor Detail

VonNeumannTopology

public VonNeumannTopology(Discrete2DSpace g)
Method Detail

getRelations

public java.util.List getRelations(int x,
                                   int y,
                                   int[] extents,
                                   boolean returnNulls)
Specified by:
getRelations in class AbstractDiscrete2DTopology

getRelations

public java.util.List getRelations(java.lang.Object element)
Get all of the relationships that the given element has with other elements.

Parameters:
element -
Returns:

getRelations

public java.util.List getRelations(java.lang.Object element,
                                   double range)
Gets all of the Objects within a given range.

Parameters:
element -
range -
Returns:

getRelationType

public java.lang.String getRelationType()
Get the type of relationship/topology that is represented by this Class. For example, if this represents a VonNeumann topology, this should return the String "VON_NEUMANN".

Returns:

distance

public double distance(java.lang.Object element1,
                       java.lang.Object element2)
Gets the distance between two objects in this topology. This could be either spatial distance, network distance or any other kind of well defined metric distance. This implementation returns distance as number of neighbors separating element1 and element2.

Parameters:
element1 -
element2 -
Returns:

setRelationType

public void setRelationType(java.lang.String type)
Description copied from interface: RelationTopology
Set the name for this type of relation.

Parameters:
type -