Package org.jacop.constraints.netflow
Class NetworkBuilder
java.lang.Object
org.jacop.constraints.netflow.NetworkBuilder
- Direct Known Subclasses:
Arithmetic.ArithmeticBuilder
,SoftAlldifferent.SoftAlldiffBuilder
,SoftGCC.SoftGCCBuilder
A builder class for the network flow constraints. Models should use or
inherit from this class to build a network.
- Version:
- 4.10
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNode()
addNode
(int balance) build()
primitiveDecomposition
(Store store) Generally speaking, especially in case of multiple arcs between two nodes and structure constraints imposed on arcs makes it hard to decompose network flow constraint into primitive ones.void
setCostVariable
(IntVar costVariable) private void
Node[][]
valueGraph
(IntVar[] vars, IntDomain[] domains) Returns two arrays containing the nodes for each variable and the nodes for each domain, respectively.
-
Field Details
-
nextNodeName
private int nextNodeName -
costVariable
-
nodeList
-
arcList
-
handlerList
-
-
Constructor Details
-
NetworkBuilder
public NetworkBuilder() -
NetworkBuilder
-
-
Method Details
-
setCostVariable
-
addNode
-
addNode
-
addNode
-
addNode
-
addArc
-
addArc
-
addArc
-
addArc
-
addArc
-
addArc
-
addArc
-
valueGraph
Returns two arrays containing the nodes for each variable and the nodes for each domain, respectively.- Parameters:
vars
- varibales for nodesdomains
- nodes for each variable- Returns:
- two arrays containing the nodes for each variable and the nodes for each domain, respectively
-
listVariables
-
build
-
primitiveDecomposition
Generally speaking, especially in case of multiple arcs between two nodes and structure constraints imposed on arcs makes it hard to decompose network flow constraint into primitive ones. Since, the decomposition introduces new variables and removal of artificial solutions is not practically achievable in all cases it is possible that decomposition will have more solutions due to the fact that decomposition may use more expensive arcs to transfer the flow.- Parameters:
store
- current store- Returns:
- decomposed network using primitive constraints
-
sumC
-