sim.portrayal.network
Class SpatialNetwork2D
java.lang.Object
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 (or some other SparseField2D).
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpatialNetwork2D
public SpatialNetwork2D(SparseField2D field,
Network network)
setAuxiliaryField
public void setAuxiliaryField(SparseField2D f)
setAuxillaryField
public void setAuxillaryField(SparseField2D f)
getObjectLocation
public Double2D getObjectLocation(java.lang.Object node)
- Deprecated.
getDimensions
public Double2D getDimensions()