Class NetworkBuilder

    • Field Detail

      • nextNodeName

        private int nextNodeName
      • costVariable

        public IntVar costVariable
      • nodeList

        public final java.util.List<Node> nodeList
      • arcList

        public final java.util.List<Arc> arcList
      • handlerList

        public final java.util.List<VarHandler> handlerList
    • Constructor Detail

      • NetworkBuilder

        public NetworkBuilder()
      • NetworkBuilder

        public NetworkBuilder​(IntVar costVariable)
    • Method Detail

      • setCostVariable

        public void setCostVariable​(IntVar costVariable)
      • addNode

        public Node addNode()
      • addNode

        public Node addNode​(int balance)
      • addNode

        public Node addNode​(java.lang.String name)
      • addNode

        public Node addNode​(java.lang.String name,
                            int balance)
      • addArc

        public Arc addArc​(Node from,
                          Node to,
                          IntVar wVar,
                          int lowerCapacity,
                          int upperCapacity)
      • addArc

        public Arc addArc​(Node from,
                          Node to,
                          int weight,
                          int lowerCapacity,
                          int upperCapacity)
      • addArc

        public Arc addArc​(Node from,
                          Node to,
                          int weight,
                          int capacity)
      • addArc

        public Arc addArc​(Node from,
                          Node to,
                          int weight)
      • valueGraph

        public Node[][] valueGraph​(IntVar[] vars,
                                   IntDomain[] domains)
        Returns two arrays containing the nodes for each variable and the nodes for each domain, respectively.
        Parameters:
        vars - varibales for nodes
        domains - nodes for each variable
        Returns:
        two arrays containing the nodes for each variable and the nodes for each domain, respectively
      • listVariables

        public java.util.ArrayList<IntVar> listVariables()
      • primitiveDecomposition

        public java.util.List<Constraint> 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. 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