JaCoP.constraints
Class SoftGCC

java.lang.Object
  extended by JaCoP.constraints.DecomposedConstraint
      extended by JaCoP.constraints.SoftGCC

public class SoftGCC
extends DecomposedConstraint

This class provides soft-gcc constraint by decomposing it either into a network flow constraint or a set of primitive constraints. It is soft in a sense that every violation of softLower, softUpper bound or softCounter contributes to the violation cost. It is hard in a sense that it does enforce hardLower, hardUpper bound or hardCounter. It uses value based violation metric.

Version:
3.1
Author:
Radoslaw Szymanek

Field Summary
 IntVar costVar
           
 int[] countedValue
           
 java.util.ArrayList<Constraint> decomposition
           
 IntVar[] hardCounters
           
 int[] hardLowerBound
           
 int[] hardUpperBound
           
 IntVar[] softCounters
           
 int[] softLowerBound
           
 int[] softUpperBound
           
 ViolationMeasure violationMeasure
           
 IntVar[] xVars
           
 
Fields inherited from class JaCoP.constraints.DecomposedConstraint
queueIndex
 
Constructor Summary
SoftGCC(IntVar[] xVars, int[] hardLowerBound, int[] hardUpperBound, int[] countedValue, IntVar[] softCounters, IntVar costVar, ViolationMeasure violationMeasure)
          It specifies soft-GCC constraint.
SoftGCC(IntVar[] xVars, int[] hardLowerBound, int[] hardUpperBound, IntVar[] softCounters, IntVar costVar, ViolationMeasure violationMeasure)
          It specifies soft-GCC constraint.
SoftGCC(IntVar[] xVars, IntVar[] hardCounters, int[] countedValue, int[] softLowerBound, int[] softUpperBound, IntVar costVar, ViolationMeasure violationMeasure)
          It specifies soft-GCC constraint.
SoftGCC(IntVar[] xVars, IntVar[] hardCounters, int[] softLowerBound, int[] softUpperBound, IntVar costVar, ViolationMeasure violationMeasure)
          It specifies soft-GCC constraint.
SoftGCC(IntVar[] xVars, IntVar[] hardCounters, int[] countedValue, IntVar[] softCounters, IntVar costVar, ViolationMeasure violationMeasure)
          It specifies soft-GCC constraint.
SoftGCC(IntVar[] xVars, IntVar[] hardCounters, IntVar[] softCounters, IntVar costVar, ViolationMeasure violationMeasure)
          It specifies soft-GCC constraint.
 
Method Summary
 java.util.ArrayList<Constraint> decompose(Store store)
          It returns an array list of constraint which are used to decompose this constraint.
 void imposeDecomposition(Store store)
          It imposes the constraint in a given store.
 java.util.ArrayList<Constraint> primitiveDecomposition(Store store)
           
 
Methods inherited from class JaCoP.constraints.DecomposedConstraint
auxiliaryVariables, imposeDecomposition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decomposition

public java.util.ArrayList<Constraint> decomposition

xVars

public IntVar[] xVars

hardCounters

public IntVar[] hardCounters

softCounters

public IntVar[] softCounters

countedValue

public int[] countedValue

softLowerBound

public int[] softLowerBound

softUpperBound

public int[] softUpperBound

hardLowerBound

public int[] hardLowerBound

hardUpperBound

public int[] hardUpperBound

costVar

public IntVar costVar

violationMeasure

public ViolationMeasure violationMeasure
Constructor Detail

SoftGCC

public SoftGCC(IntVar[] xVars,
               IntVar[] hardCounters,
               int[] countedValue,
               int[] softLowerBound,
               int[] softUpperBound,
               IntVar costVar,
               ViolationMeasure violationMeasure)
It specifies soft-GCC constraint.

Parameters:
xVars - variables over which counting takes place.
hardCounters - counter variables for different values being counted. Their domain specify hard constraints on the occurrences.
countedValue - it specifies values which occurrence is being counted.
softLowerBound - it specifies constraint what is the minimal number of occurrences.
softUpperBound - it specifies constraint what is the maximal number of occurrences.
costVar - a cost variable specifying the cost of violations.
violationMeasure - it is only accepted to use Value_Based violation measure.

SoftGCC

public SoftGCC(IntVar[] xVars,
               int[] hardLowerBound,
               int[] hardUpperBound,
               int[] countedValue,
               IntVar[] softCounters,
               IntVar costVar,
               ViolationMeasure violationMeasure)
It specifies soft-GCC constraint.

Parameters:
xVars - variables over which counting takes place.
hardLowerBound - it specifies constraint what is the minimal number of occurrences. (hard)
hardUpperBound - it specifies constraint what is the maximal number of occurrences. (hard)
countedValue - it specifies values which occurrence is being counted.
softCounters - it specifies the number of occurrences (soft).
costVar - a cost variable specifying the cost of violations.
violationMeasure - it is only accepted to use Value_Based violation measure.

SoftGCC

public SoftGCC(IntVar[] xVars,
               IntVar[] hardCounters,
               int[] countedValue,
               IntVar[] softCounters,
               IntVar costVar,
               ViolationMeasure violationMeasure)
It specifies soft-GCC constraint.

Parameters:
xVars - variables over which counting takes place.
hardCounters - counter variables for different values being counted. (hard)
countedValue - it specifies values which occurrence is being counted.
softCounters - counter variables for different values being counted. (soft)
costVar - a cost variable specifying the cost of violations.
violationMeasure - it is only accepted to use Value_Based violation measure.

SoftGCC

public SoftGCC(IntVar[] xVars,
               IntVar[] hardCounters,
               int[] softLowerBound,
               int[] softUpperBound,
               IntVar costVar,
               ViolationMeasure violationMeasure)
It specifies soft-GCC constraint.

Parameters:
xVars - variables over which counting takes place.
hardCounters - counter variables for different values being counted. (hard)
softLowerBound - it specifies constraint what is the minimal number of occurrences. (soft)
softUpperBound - it specifies constraint what is the maximal number of occurrences. (soft)
costVar - a cost variable specifying the cost of violations.
violationMeasure - it is only accepted to use Value_Based violation measure.

SoftGCC

public SoftGCC(IntVar[] xVars,
               int[] hardLowerBound,
               int[] hardUpperBound,
               IntVar[] softCounters,
               IntVar costVar,
               ViolationMeasure violationMeasure)
It specifies soft-GCC constraint.

Parameters:
xVars - variables over which counting takes place.
hardLowerBound - it specifies constraint what is the minimal number of occurrences. (hard)
hardUpperBound - it specifies constraint what is the maximal number of occurrences. (hard)
softCounters - counter variables for different values being counted. (soft)
costVar - a cost variable specifying the cost of violations.
violationMeasure - it is only accepted to use Value_Based violation measure.

SoftGCC

public SoftGCC(IntVar[] xVars,
               IntVar[] hardCounters,
               IntVar[] softCounters,
               IntVar costVar,
               ViolationMeasure violationMeasure)
It specifies soft-GCC constraint.

Parameters:
xVars - variables over which counting takes place.
hardCounters - counter variables for different values being counted. (hard)
softCounters - counter variables that may be violated.
costVar - a cost variable specifying the cost of violations.
violationMeasure - it is only accepted to use Value_Based violation measure.
Method Detail

primitiveDecomposition

public java.util.ArrayList<Constraint> primitiveDecomposition(Store store)

decompose

public java.util.ArrayList<Constraint> decompose(Store store)
Description copied from class: DecomposedConstraint
It returns an array list of constraint which are used to decompose this constraint. It actually creates a decomposition (possibly also creating variables), but it does not impose the constraint.

Specified by:
decompose in class DecomposedConstraint
Parameters:
store - the constraint store in which context the decomposition takes place.
Returns:
an array list of constraints used to decompose this constraint.

imposeDecomposition

public void imposeDecomposition(Store store)
Description copied from class: DecomposedConstraint
It imposes the constraint in a given store.

Specified by:
imposeDecomposition in class DecomposedConstraint
Parameters:
store - the constraint store to which the constraint is imposed to.