choco.cp.solver.constraints.global.softscheduling
Class SoftCumulative

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.softscheduling.AbstractSoftCumulative
                      extended by choco.cp.solver.constraints.global.softscheduling.SoftCumulative
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener
Direct Known Subclasses:
SoftCumulativeSum

public class SoftCumulative
extends AbstractSoftCumulative


Nested Class Summary
 
Nested classes/interfaces inherited from class choco.cp.solver.constraints.global.softscheduling.AbstractSoftCumulative
AbstractSoftCumulative.EndingDateComparator, AbstractSoftCumulative.Event, AbstractSoftCumulative.EventComparator, AbstractSoftCumulative.StartingDateComparator
 
Field Summary
protected  int allScheduled
           
protected  int costVarsLength
           
static boolean debug
           
protected  int wishCapa
           
 
Fields inherited from class choco.cp.solver.constraints.global.softscheduling.AbstractSoftCumulative
capaMax, contributions, endComp, events, evtComp, fixPoint, nbTask, stComp, sum_height, taskInter, taskToPrune, Xtasks, Ytasks
 
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
SoftCumulative(IntDomainVar[] starts, int[] durations, int[] heights, IntDomainVar[] costVars, int wishCapa, Solver solver)
           
SoftCumulative(IntDomainVar[] starts, IntDomainVar[] ends, IntDomainVar[] durations, IntDomainVar[] heights, IntDomainVar[] costVars, int wishCapa, int capa)
           
 
Method Summary
protected  boolean allIsScheduled()
           
protected  long capaMaxDiff(int left, int right)
           
protected  void checkCosts(int low, int up)
           
protected static int computeCapa(IntDomainVar[] costVars, int wishCapa)
           
protected  void consistentData(IntDomainVar[] ends)
           
protected static IntDomainVar[] createEndVarArray(IntDomainVar[] starts, int[] durations, Solver solver)
           
protected static IntDomainVar[] createIntVarArray(String name, int[] source, Solver pb)
           
 void filter()
           
 boolean generateEvents()
           
protected  IntDomainVar getCostVar(int t)
           
protected  boolean isCostVar(int varIndex)
           
 Boolean isEntailed()
          Indicates if the constraint is entailed, from now on will be always satisfied
 boolean isSatisfied()
          Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple)
 int maxCapaMax(int low, int up)
           
protected  boolean overlaps(int height, int indexVar, int low, int up)
           
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 void prune(int low, int up)
           
protected  void recomputeVars(IntDomainVar[] costVars)
           
 void sweep()
           
 void taskIntervals()
           
protected  void updateCost(int low, int up)
           
protected  boolean violateMaxCapa(int eventDate)
           
protected  boolean violateMaxCapa(int evtS, int evtF)
           
protected  int violateWishCapa()
           
 
Methods inherited from class choco.cp.solver.constraints.global.softscheduling.AbstractSoftCumulative
getDuration, getEE, getEnd, getES, getHeight, getLE, getLS, getStart, initMainIteration, isScheduled, updateCompulsoryPart
 
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint
awakeOnBounds, awakeOnInf, awakeOnInst, awakeOnRem, awakeOnRemovals, awakeOnSup, getConstraintType, isConsistent, isSatisfied
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, opposite, pretty, setConstraintIndex, setExtension, setVar, toString
 
Methods inherited from class choco.kernel.solver.propagation.Propagator
activate, awake, constAwake, fail, getEvent, getFilteredEventMask, 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

wishCapa

protected int wishCapa

allScheduled

protected int allScheduled

costVarsLength

protected int costVarsLength

debug

public static boolean debug
Constructor Detail

SoftCumulative

public SoftCumulative(IntDomainVar[] starts,
                      IntDomainVar[] ends,
                      IntDomainVar[] durations,
                      IntDomainVar[] heights,
                      IntDomainVar[] costVars,
                      int wishCapa,
                      int capa)

SoftCumulative

public SoftCumulative(IntDomainVar[] starts,
                      int[] durations,
                      int[] heights,
                      IntDomainVar[] costVars,
                      int wishCapa,
                      Solver solver)
Method Detail

consistentData

protected void consistentData(IntDomainVar[] ends)

recomputeVars

protected void recomputeVars(IntDomainVar[] costVars)

createEndVarArray

protected static IntDomainVar[] createEndVarArray(IntDomainVar[] starts,
                                                  int[] durations,
                                                  Solver solver)

createIntVarArray

protected static IntDomainVar[] createIntVarArray(String name,
                                                  int[] source,
                                                  Solver pb)

computeCapa

protected static int computeCapa(IntDomainVar[] costVars,
                                 int wishCapa)

isCostVar

protected boolean isCostVar(int varIndex)

getCostVar

protected IntDomainVar getCostVar(int t)

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

isSatisfied

public boolean isSatisfied()
Description copied from class: AbstractIntSConstraint
Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple)

Specified by:
isSatisfied in interface SConstraint<IntDomainVar>
Overrides:
isSatisfied in class AbstractIntSConstraint
Returns:
true if the constraint is satisfied

isEntailed

public Boolean isEntailed()
Description copied from class: AbstractSConstraint
Indicates if the constraint is entailed, from now on will be always satisfied

Overrides:
isEntailed in class AbstractSConstraint<IntDomainVar>
Returns:
wether the constraint is entailed

generateEvents

public boolean generateEvents()
Overrides:
generateEvents in class AbstractSoftCumulative

allIsScheduled

protected boolean allIsScheduled()

violateMaxCapa

protected boolean violateMaxCapa(int eventDate)

violateMaxCapa

protected boolean violateMaxCapa(int evtS,
                                 int evtF)

violateWishCapa

protected int violateWishCapa()

checkCosts

protected void checkCosts(int low,
                          int up)
                   throws ContradictionException
Throws:
ContradictionException

filter

public void filter()
            throws ContradictionException
Throws:
ContradictionException

sweep

public void sweep()
           throws ContradictionException
Throws:
ContradictionException

maxCapaMax

public int maxCapaMax(int low,
                      int up)

overlaps

protected boolean overlaps(int height,
                           int indexVar,
                           int low,
                           int up)

prune

public void prune(int low,
                  int up)
           throws ContradictionException
Throws:
ContradictionException

updateCost

protected void updateCost(int low,
                          int up)
                   throws ContradictionException
Throws:
ContradictionException

capaMaxDiff

protected long capaMaxDiff(int left,
                           int right)

taskIntervals

public void taskIntervals()
                   throws ContradictionException
Throws:
ContradictionException


Copyright © 2012. All Rights Reserved.