public class SystemConstraint extends java.lang.Object implements NetworkConstraint
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
double |
getMaxCost()
Returns the maximum cost constraint.
|
int |
getMaxDepth()
Returns the maximum depth constraint.
|
double |
getMaxDistance()
Returns the maximum distance constraint.
|
double |
getMaxDuration() |
MBR |
getMaxMBR()
Returns the maximum MBR constraint.
|
java.util.Vector |
getMustAvoidLinks()
Returns the must-avoid links as a Vector
|
java.util.Vector |
getMustAvoidNodes()
Returns the must-avoid nodes as a Vector
|
Network |
getNetwork()
Returns the network that contains the consatrint.
|
boolean |
isSatisfied(AnalysisInfo info)
Check if the system constraint is satisfied during the search.
|
boolean |
maxCostExists()
Checks if the maximum cost constraint exists.
|
boolean |
maxDepthExists()
Checks if the maximum path depth constraint exists.
|
boolean |
maxDistanceExists()
Checks if the maximum distance constraint exists.
|
boolean |
maxDurationExists()
Checks if the maximum duration constraint exists.
|
boolean |
maxMBRExists()
Checks if the maximum MBR constraint exists.
|
boolean |
requiresPathLinks()
Chceks if the constraint requires some or all path information.
|
void |
setMaxCost(double maxCost)
Sets the maximum cost constraint.
|
void |
setMaxDepth(int maxDepth)
Sets the maximum depth constraint.
|
void |
setMaxDistance(double maxDist)
Sets the maximum distance constraint.
|
void |
setMaxDuration(double maxDuration) |
void |
setMaxMBR(MBR mbr)
Sets the maximum MBR constraint.
|
void |
setMustAvoidLinks(java.util.Vector links)
Sets the must-avoid links.
|
void |
setMustAvoidNodes(java.util.Vector nodes)
Sets the must-avoid nodes.
|
java.lang.String |
toString() |
public SystemConstraint(Network network)
network
- the specified networkpublic SystemConstraint(Network network, double maxCost)
network
- the specified networkmaxCost
- the maximum costpublic SystemConstraint(Network network, java.util.Vector mustAvoidNodes, java.util.Vector mustAvoidLinks)
network
- the specified networkmustAvoidNodes
- the must-avoid nodes in a VectormustAvoidLinks
- the must-avoid links in a Vectorpublic SystemConstraint(Network network, java.util.Vector mustAvoidNodes)
network
- the specified networkmustAvoidNodes
- the must-avoid nodes in a Vectorpublic SystemConstraint(Network network, int[] mustAvoidNodes, int[] mustAvoidLinks) throws NetworkDataException
network
- the specified networkmustAvoidNodes
- the array of the must-avoid node IDsmustAvoidLinks
- the array of the must-avoid link IDsNetworkDataException
public SystemConstraint(Network network, int[] mustAvoidNodes) throws NetworkDataException
network
- the specified networkmustAvoidNodes
- the array of the must-avoid node IDsNetworkDataException
public void setMustAvoidNodes(java.util.Vector nodes)
nodes
- the must-avoid nodes as a Vectorpublic void setMustAvoidLinks(java.util.Vector links)
links
- the must-avoid links as a Vectorpublic void setMaxDepth(int maxDepth)
maxDepth
- the maximum depthpublic void setMaxCost(double maxCost)
maxCost
- the maximum costpublic void setMaxDistance(double maxDist)
maxDist
- the maximum distancepublic void setMaxMBR(MBR mbr)
mbr
- the MBR constraintpublic Network getNetwork()
public java.util.Vector getMustAvoidNodes()
public java.util.Vector getMustAvoidLinks()
public boolean maxCostExists()
public boolean maxDurationExists()
public boolean maxDistanceExists()
public boolean maxMBRExists()
public boolean maxDepthExists()
public double getMaxCost()
public double getMaxDistance()
public MBR getMaxMBR()
public int getMaxDepth()
public java.lang.String toString()
toString
in class java.lang.Object
public void setMaxDuration(double maxDuration)
public double getMaxDuration()
public boolean requiresPathLinks()
requiresPathLinks
in interface NetworkConstraint
public boolean isSatisfied(AnalysisInfo info)
isSatisfied
in interface NetworkConstraint
info
- the analysis information for the network constraintAnalysisInfo