sim.portrayal.network
Class SpatialNetwork2D

java.lang.Object
  extended by sim.portrayal.network.SpatialNetwork2D

public class SpatialNetwork2D
extends java.lang.Object

A wrapper used by NetworkPortrayal2D to hold a Network and EITHER a Continuous2D OR a SparseGrid2D. The Continuous2D/SparseGrid2D specifies the spatial location of the nodes; the Network specifies the edges connecting those nodes.

SpatialNetwork2D can also hold an additional location (another Continuous2D/SparseGrid2D) which might hold the nodes if the first location does not. This allows you to (for example) have the FROM nodes in one field and the TO nodes in another field. You can set this location with setAuxillaryField. Note that this will only work properly if the fields have exactly the same dimensions with respect to how their field portrayals draw them onscreen. As a sanity check: you shouldn't have one field be a Continuous2D and the other be a SparseGrid2D.


Field Summary
 SparseField field
           
 SparseField field2
           
 Network network
           
 
Constructor Summary
SpatialNetwork2D(Continuous2D field, Network network)
           
SpatialNetwork2D(SparseGrid2D grid, Network network)
           
 
Method Summary
 double getHeight()
           
 Double2D getObjectLocation(java.lang.Object node)
           
 double getWidth()
           
 void setAuxillaryField(Continuous2D f)
           
 void setAuxillaryField(SparseGrid2D f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

field

public SparseField field

field2

public SparseField field2

network

public Network network
Constructor Detail

SpatialNetwork2D

public SpatialNetwork2D(Continuous2D field,
                        Network network)

SpatialNetwork2D

public SpatialNetwork2D(SparseGrid2D grid,
                        Network network)
Method Detail

setAuxillaryField

public void setAuxillaryField(Continuous2D f)

setAuxillaryField

public void setAuxillaryField(SparseGrid2D f)

getObjectLocation

public Double2D getObjectLocation(java.lang.Object node)

getWidth

public double getWidth()

getHeight

public double getHeight()