omnics.constraint.soft
Class SoftScalarProduct

java.lang.Object
  extended by omnics.Constraint
      extended by omnics.constraint.soft.SoftScalarProduct
All Implemented Interfaces:
java.io.Serializable

public class SoftScalarProduct
extends Constraint

Author:
Cristian Frasinaru
See Also:
Serialized Form

Field Summary
 
Fields inherited from class omnics.Constraint
ALLOWED, filter, FORBIDDEN, MAX, MIN, name, problem, variables
 
Constructor Summary
SoftScalarProduct(Var[] variables, int[] coeffs, int sum)
          Creates a new instance of ScalarProduct
 
Method Summary
 void amplify(int k)
           
 int eval(Tuple tuple)
          Evaluates a tuple.
 java.lang.String toString()
          Returns a string representation of the constraint.
 
Methods inherited from class omnics.Constraint
eval, eval, getFilter, getName, getProblem, getTuples, getVarArray, getVariables, setFilter, setName, setVariables, setVariables, variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SoftScalarProduct

public SoftScalarProduct(Var[] variables,
                         int[] coeffs,
                         int sum)
Creates a new instance of ScalarProduct

Method Detail

amplify

public void amplify(int k)

eval

public int eval(Tuple tuple)
Description copied from class: Constraint
Evaluates a tuple. The result of the evaluation could be: Constants MIN, MAX, ALLOWED, FORBIDDEN are defined in ValuationStructure

Specified by:
eval in class Constraint
Parameters:
tuple - some tuple
Returns:
a value between ValuationStructure.MIN and ValuationStructure.MAX.
See Also:
Constraint.eval(Tuple), ValuationStructure

toString

public java.lang.String toString()
Returns a string representation of the constraint.

Overrides:
toString in class Constraint
Returns:
a string representation of the constraint