Class NetworkFlow

    • Field Detail

      • idNumber

        static java.util.concurrent.atomic.AtomicInteger idNumber
        Instance counter
      • network

        public final Pruning network
        The network
      • costVariable

        public IntVar costVariable
        The cost variable
      • map

        public final java.util.Map<IntVar,​VarHandler> map
        The variables and their handlers
      • queue

        public final java.util.Set<IntVar> queue
        The set of queued variables
      • disableQueueVariable

        public boolean disableQueueVariable
        Disables the queue variable function during consistency
      • previousLevel

        public int previousLevel
    • Constructor Detail

      • NetworkFlow

        private NetworkFlow​(java.util.List<Node> nodes,
                            java.util.List<Arc> arcs,
                            java.util.List<VarHandler> flowVariables,
                            IntVar costVariable)
        Initialization
    • Method Detail

      • getConsistencyPruningEvent

        public int getConsistencyPruningEvent​(Var var)
        Description copied from class: Constraint
        It retrieves the pruning event which causes reevaluation of the constraint.
        Overrides:
        getConsistencyPruningEvent in class Constraint
        Parameters:
        var - variable for which pruning event is retrieved
        Returns:
        it returns the int code of the pruning event (GROUND, BOUND, ANY, NONE)
      • impose

        public void impose​(Store store)
        Description copied from class: Constraint
        It imposes the constraint in a given store.
        Overrides:
        impose in class Constraint
        Parameters:
        store - the constraint store to which the constraint is imposed to.
      • queueVariable

        public void queueVariable​(int level,
                                  Var variable)
        Search & Backtracking
        Overrides:
        queueVariable in class Constraint
        Parameters:
        level - the level of the store at which the change has occurred.
        variable - variable which has changed.
      • updateGraph

        private void updateGraph()
      • consistency

        public void consistency​(Store store)
        Description copied from class: Constraint
        It is a (most probably incomplete) consistency function which removes the values from variables domains. Only values which do not have any support in a solution space are removed.
        Specified by:
        consistency in class Constraint
        Parameters:
        store - constraint store within which the constraint consistency is being checked.
      • removeLevel

        public void removeLevel​(int level)
        Description copied from interface: Stateful
        This function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid. This function is called *before* all timestamps, variables, mutablevariables have reverted to their previous value.
        Specified by:
        removeLevel in interface Stateful
        Parameters:
        level - the level which is being removed.
      • removeLevelLate

        public void removeLevelLate​(int level)
        Description copied from interface: RemoveLevelLate
        This function is called in case of the backtrack. It is called after all timestamps, variables, mutablevariables have reverted to their values *after* removing the level.
        Specified by:
        removeLevelLate in interface RemoveLevelLate
        Parameters:
        level - the level which is being removed.
      • toString

        public java.lang.String toString()
        Identifiers
        Overrides:
        toString in class Constraint