Package oracle.spatial.network
Class SystemConstraint
- java.lang.Object
-
- oracle.spatial.network.SystemConstraint
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,NetworkConstraint
public class SystemConstraint extends java.lang.Object implements NetworkConstraint
This class defines the common network constraints for network analysis. It contains the must-avoid nodes and must-avoid links, the maximum cost, the maximun duration, the maximum distance, the maximum search depth (no of links in the path!), and a bounding MBR. This class implements NetworkConstraint interface.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SystemConstraint(Network network)Constructs an empty system constraint.SystemConstraint(Network network, double maxCost)Constructs a network constraint with the maximum cost.SystemConstraint(Network network, int[] mustAvoidNodes)Constructs a system constraint containing the must-avoid nodes .SystemConstraint(Network network, int[] mustAvoidNodes, int[] mustAvoidLinks)Constructs a network constraint with the following constraints: the must-avoid nodes, and the must-avoid links.SystemConstraint(Network network, java.util.Vector mustAvoidNodes)Constructs a network constraint with the must-avoid nodes.SystemConstraint(Network network, java.util.Vector mustAvoidNodes, java.util.Vector mustAvoidLinks)Constructs a network constraint with the following constraint items: the must-avoid nodes and the must-avoid links.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetMaxCost()Returns the maximum cost constraint.intgetMaxDepth()Returns the maximum depth constraint.doublegetMaxDistance()Returns the maximum distance constraint.doublegetMaxDuration()MBRgetMaxMBR()Returns the maximum MBR constraint.java.util.VectorgetMustAvoidLinks()Returns the must-avoid links as a Vectorjava.util.VectorgetMustAvoidNodes()Returns the must-avoid nodes as a VectorNetworkgetNetwork()Returns the network that contains the consatrint.booleanisSatisfied(AnalysisInfo info)Check if the system constraint is satisfied during the search.booleanmaxCostExists()Checks if the maximum cost constraint exists.booleanmaxDepthExists()Checks if the maximum path depth constraint exists.booleanmaxDistanceExists()Checks if the maximum distance constraint exists.booleanmaxDurationExists()Checks if the maximum duration constraint exists.booleanmaxMBRExists()Checks if the maximum MBR constraint exists.booleanrequiresPathLinks()Chceks if the constraint requires some or all path information.voidsetMaxCost(double maxCost)Sets the maximum cost constraint.voidsetMaxDepth(int maxDepth)Sets the maximum depth constraint.voidsetMaxDistance(double maxDist)Sets the maximum distance constraint.voidsetMaxDuration(double maxDuration)voidsetMaxMBR(MBR mbr)Sets the maximum MBR constraint.voidsetMustAvoidLinks(java.util.Vector links)Sets the must-avoid links.voidsetMustAvoidNodes(java.util.Vector nodes)Sets the must-avoid nodes.java.lang.StringtoString()
-
-
-
Constructor Detail
-
SystemConstraint
public SystemConstraint(Network network)
Constructs an empty system constraint.- Parameters:
network- the specified network
-
SystemConstraint
public SystemConstraint(Network network, double maxCost)
Constructs a network constraint with the maximum cost.- Parameters:
network- the specified networkmaxCost- the maximum cost
-
SystemConstraint
public SystemConstraint(Network network, java.util.Vector mustAvoidNodes, java.util.Vector mustAvoidLinks)
Constructs a network constraint with the following constraint items: the must-avoid nodes and the must-avoid links.- Parameters:
network- the specified networkmustAvoidNodes- the must-avoid nodes in a VectormustAvoidLinks- the must-avoid links in a Vector
-
SystemConstraint
public SystemConstraint(Network network, java.util.Vector mustAvoidNodes)
Constructs a network constraint with the must-avoid nodes.- Parameters:
network- the specified networkmustAvoidNodes- the must-avoid nodes in a Vector
-
SystemConstraint
public SystemConstraint(Network network, int[] mustAvoidNodes, int[] mustAvoidLinks) throws NetworkDataException
Constructs a network constraint with the following constraints: the must-avoid nodes, and the must-avoid links.- Parameters:
network- the specified networkmustAvoidNodes- the array of the must-avoid node IDsmustAvoidLinks- the array of the must-avoid link IDs- Throws:
NetworkDataException
-
SystemConstraint
public SystemConstraint(Network network, int[] mustAvoidNodes) throws NetworkDataException
Constructs a system constraint containing the must-avoid nodes .- Parameters:
network- the specified networkmustAvoidNodes- the array of the must-avoid node IDs- Throws:
NetworkDataException
-
-
Method Detail
-
setMustAvoidNodes
public void setMustAvoidNodes(java.util.Vector nodes)
Sets the must-avoid nodes.- Parameters:
nodes- the must-avoid nodes as a Vector
-
setMustAvoidLinks
public void setMustAvoidLinks(java.util.Vector links)
Sets the must-avoid links.- Parameters:
links- the must-avoid links as a Vector
-
setMaxDepth
public void setMaxDepth(int maxDepth)
Sets the maximum depth constraint.- Parameters:
maxDepth- the maximum depth
-
setMaxCost
public void setMaxCost(double maxCost)
Sets the maximum cost constraint.- Parameters:
maxCost- the maximum cost
-
setMaxDistance
public void setMaxDistance(double maxDist)
Sets the maximum distance constraint.- Parameters:
maxDist- the maximum distance
-
setMaxMBR
public void setMaxMBR(MBR mbr)
Sets the maximum MBR constraint.- Parameters:
mbr- the MBR constraint
-
getNetwork
public Network getNetwork()
Returns the network that contains the consatrint.
-
getMustAvoidNodes
public java.util.Vector getMustAvoidNodes()
Returns the must-avoid nodes as a Vector
-
getMustAvoidLinks
public java.util.Vector getMustAvoidLinks()
Returns the must-avoid links as a Vector
-
maxCostExists
public boolean maxCostExists()
Checks if the maximum cost constraint exists.
-
maxDurationExists
public boolean maxDurationExists()
Checks if the maximum duration constraint exists.
-
maxDistanceExists
public boolean maxDistanceExists()
Checks if the maximum distance constraint exists.
-
maxMBRExists
public boolean maxMBRExists()
Checks if the maximum MBR constraint exists.
-
maxDepthExists
public boolean maxDepthExists()
Checks if the maximum path depth constraint exists.
-
getMaxCost
public double getMaxCost()
Returns the maximum cost constraint.
-
getMaxDistance
public double getMaxDistance()
Returns the maximum distance constraint.
-
getMaxMBR
public MBR getMaxMBR()
Returns the maximum MBR constraint.
-
getMaxDepth
public int getMaxDepth()
Returns the maximum depth constraint.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setMaxDuration
public void setMaxDuration(double maxDuration)
-
getMaxDuration
public double getMaxDuration()
-
requiresPathLinks
public boolean requiresPathLinks()
Chceks if the constraint requires some or all path information.- Specified by:
requiresPathLinksin interfaceNetworkConstraint
-
isSatisfied
public boolean isSatisfied(AnalysisInfo info)
Check if the system constraint is satisfied during the search.- Specified by:
isSatisfiedin interfaceNetworkConstraint- Parameters:
info- the analysis information for the network constraint- See Also:
AnalysisInfo
-
-