Package sim.portrayal.network
Class SpatialNetwork2D
java.lang.Object
sim.portrayal.network.SpatialNetwork2D
- All Implemented Interfaces:
Serializable
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.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected SparseField2D
protected SparseField2D
protected Network
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.getObjectLocation
(Object node) NOTE this used to be deprecated, but it has now been de-deprecated so as to be consistent with SpatialNetwork3D.void
void
-
Field Details
-
field
-
field2
-
network
-
-
Constructor Details
-
SpatialNetwork2D
-
-
Method Details
-
setAuxiliaryField
-
setAuxillaryField
-
getObjectLocation
NOTE this used to be deprecated, but it has now been de-deprecated so as to be consistent with SpatialNetwork3D. This method returns the location of the object as a Double2D regardless of which field it is located in and regardless of whether the field is a Double2D or SparseGrid2D. We may re-deprecate it eventually. -
getDimensions
Deprecated.
-