choco.cp.solver.constraints.global.automata.fast_costregular
Class CostRegular

java.lang.Object
  extended by choco.kernel.solver.propagation.Propagator
      extended by choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
          extended by choco.kernel.solver.constraints.integer.AbstractIntSConstraint
              extended by choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
                  extended by choco.cp.solver.constraints.global.automata.fast_costregular.CostRegular
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener
Direct Known Subclasses:
CostKnapSack

public class CostRegular
extends AbstractLargeIntSConstraint

Created by IntelliJ IDEA. User: julien Date: Feb 4, 2010 Time: 1:03:04 PM


Field Summary
protected  IEnvironment environment
           
 
Fields inherited from class choco.kernel.solver.constraints.AbstractSConstraint
cIndices, constraintType, extensions, vars
 
Fields inherited from class choco.kernel.solver.propagation.Propagator
active, constAwakeEvent, priority, propagationEngine
 
Fields inherited from interface choco.kernel.solver.constraints.SConstraint
LOGGER
 
Constructor Summary
CostRegular(IntDomainVar[] vars, org.jgrapht.graph.DirectedMultigraph<Node,Arc> graph, Node source, Solver s)
           
CostRegular(IntDomainVar[] vars, IAutomaton pi, int[][][] costs, Solver s)
           
CostRegular(IntDomainVar[] vars, IAutomaton pi, int[][] costs, Solver s)
           
CostRegular(IntDomainVar[] vars, ICostAutomaton pi, Solver s)
           
 
Method Summary
 void awake()
          Propagation: Propagating the constraint for the very first time until local consistency is reached.
 void awakeOnBounds(int idx)
           
 void awakeOnInf(int idx)
          Default propagation on improved lower bound: propagation on domain revision.
 void awakeOnInst(int idx)
          Default propagation on instantiation: full constraint re-propagation.
 void awakeOnRem(int idx, int val)
          Default propagation on one value removal: propagation on domain revision.
 void awakeOnRemovals(int idx, DisposableIntIterator it2)
          The default implementation of propagation when a variable has been modified consists in iterating all values that have been removed (the delta domain) and propagate them one after another, incrementally.
 void awakeOnSup(int idx)
          Default propagation on improved upper bound: propagation on domain revision.
protected  void checkWorld()
           
 int getFilteredEventMask(int idx)
           
 void initGraph(org.jgrapht.graph.DirectedMultigraph<Node,Arc> graph, Node source)
           
 void initGraph(ICostAutomaton pi)
           
 boolean isSatisfied(int[] tuple)
          TEMPORARY: if not overriden by the constraint, throws an error to avoid bug using reified constraints in constraints that have not been changed to fulfill this api yet !
 void prefilter()
           
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint
getConstraintType, isConsistent, isSatisfied
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, opposite, pretty, setConstraintIndex, setExtension, setVar, toString
 
Methods inherited from class choco.kernel.solver.propagation.Propagator
activate, constAwake, fail, getEvent, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

environment

protected final IEnvironment environment
Constructor Detail

CostRegular

public CostRegular(IntDomainVar[] vars,
                   IAutomaton pi,
                   int[][][] costs,
                   Solver s)

CostRegular

public CostRegular(IntDomainVar[] vars,
                   IAutomaton pi,
                   int[][] costs,
                   Solver s)

CostRegular

public CostRegular(IntDomainVar[] vars,
                   ICostAutomaton pi,
                   Solver s)

CostRegular

public CostRegular(IntDomainVar[] vars,
                   org.jgrapht.graph.DirectedMultigraph<Node,Arc> graph,
                   Node source,
                   Solver s)
Method Detail

initGraph

public void initGraph(org.jgrapht.graph.DirectedMultigraph<Node,Arc> graph,
                      Node source)

initGraph

public void initGraph(ICostAutomaton pi)
               throws ContradictionException
Throws:
ContradictionException

awake

public void awake()
           throws ContradictionException
Description copied from class: Propagator
Propagation: Propagating the constraint for the very first time until local consistency is reached.

Overrides:
awake in class Propagator
Throws:
ContradictionException - contradiction exception

prefilter

public void prefilter()
               throws ContradictionException
Throws:
ContradictionException

checkWorld

protected void checkWorld()

awakeOnRemovals

public void awakeOnRemovals(int idx,
                            DisposableIntIterator it2)
                     throws ContradictionException
Description copied from class: AbstractIntSConstraint
The default implementation of propagation when a variable has been modified consists in iterating all values that have been removed (the delta domain) and propagate them one after another, incrementally.

Specified by:
awakeOnRemovals in interface IntPropagator
Overrides:
awakeOnRemovals in class AbstractIntSConstraint
Throws:
ContradictionException

awakeOnInf

public void awakeOnInf(int idx)
                throws ContradictionException
Description copied from class: AbstractIntSConstraint
Default propagation on improved lower bound: propagation on domain revision.

Specified by:
awakeOnInf in interface IntPropagator
Overrides:
awakeOnInf in class AbstractIntSConstraint
Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int idx)
                throws ContradictionException
Description copied from class: AbstractIntSConstraint
Default propagation on improved upper bound: propagation on domain revision.

Specified by:
awakeOnSup in interface IntPropagator
Overrides:
awakeOnSup in class AbstractIntSConstraint
Throws:
ContradictionException

awakeOnInst

public void awakeOnInst(int idx)
Description copied from class: AbstractIntSConstraint
Default propagation on instantiation: full constraint re-propagation.

Specified by:
awakeOnInst in interface IntPropagator
Overrides:
awakeOnInst in class AbstractIntSConstraint

awakeOnBounds

public void awakeOnBounds(int idx)
Specified by:
awakeOnBounds in interface IntPropagator
Overrides:
awakeOnBounds in class AbstractIntSConstraint

awakeOnRem

public void awakeOnRem(int idx,
                       int val)
Description copied from class: AbstractIntSConstraint
Default propagation on one value removal: propagation on domain revision.

Specified by:
awakeOnRem in interface IntPropagator
Overrides:
awakeOnRem in class AbstractIntSConstraint

propagate

public void propagate()
               throws ContradictionException
Description copied from class: Propagator
Propagation: Propagating the constraint until local consistency is reached.

Specified by:
propagate in class Propagator
Throws:
ContradictionException - contradiction exception

getFilteredEventMask

public final int getFilteredEventMask(int idx)
Overrides:
getFilteredEventMask in class Propagator

isSatisfied

public boolean isSatisfied(int[] tuple)
Description copied from class: AbstractIntSConstraint
TEMPORARY: if not overriden by the constraint, throws an error to avoid bug using reified constraints in constraints that have not been changed to fulfill this api yet !

Specified by:
isSatisfied in interface IntPropagator
Overrides:
isSatisfied in class AbstractIntSConstraint


Copyright © 2012. All Rights Reserved.