choco.real
Class RealModeler

java.lang.Object
  extended by choco.real.RealModeler
Direct Known Subclasses:
PalmRealModeler

public class RealModeler
extends java.lang.Object

Modeler for real expressions.


Field Summary
protected  Problem problem
          The problem this modler should build classes for.
 
Constructor Summary
RealModeler(Problem problem)
          Builds a modeler for the specified problem.
 
Method Summary
 RealIntervalConstant around(double d)
          Arounds a double d to [d - epsilon, d + epilon].
 RealExp cos(RealExp exp)
          Cosinus of an expression.
 RealIntervalConstant cst(double d)
          Makes a constant interval from a double d ([d,d]).
 RealIntervalConstant cst(double a, double b)
          Makes a constant interval between two doubles [a,b].
 Constraint eq(double cst, RealExp exp)
           
 Constraint eq(RealExp exp, double cst)
           
 Constraint eq(RealExp exp1, RealExp exp2)
          Eqality constraint.
 Constraint geq(double cst, RealExp exp)
           
 Constraint geq(RealExp exp, double cst)
           
 Constraint geq(RealExp exp1, RealExp exp2)
          Superiority constraint.
 Constraint leq(double cst, RealExp exp)
           
 Constraint leq(RealExp exp, double cst)
           
 Constraint leq(RealExp exp1, RealExp exp2)
          Inferority constraint.
 Constraint makeEquation(RealExp exp, RealIntervalConstant cst)
          Makes an equation from an expression and a constantt interval.
 RealVar makeRealVar(double inf, double sup)
          Builds an anonnymous interval variable
 RealVar makeRealVar(java.lang.String name)
          Builds an interval variable without any information about bounds
 RealVar makeRealVar(java.lang.String name, double inf, double sup)
          Builds an interval variable.
 RealExp minus(RealExp exp1, RealExp exp2)
          Substraction of two expressions.
 RealExp mult(RealExp exp1, RealExp exp2)
          Multiplication of two expressions.
 RealExp plus(RealExp exp1, RealExp exp2)
          Addition of two expressions.
 RealExp power(RealExp exp, int power)
          Power of an expression.
 RealExp sin(RealExp exp)
          Sinus of an expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

problem

protected Problem problem
The problem this modler should build classes for.

Constructor Detail

RealModeler

public RealModeler(Problem problem)
Builds a modeler for the specified problem.

Method Detail

makeRealVar

public RealVar makeRealVar(java.lang.String name,
                           double inf,
                           double sup)
Builds an interval variable.

Parameters:
name - name of the variable
inf - lower bound of the variable
sup - upper bound of the variable

makeRealVar

public RealVar makeRealVar(double inf,
                           double sup)
Builds an anonnymous interval variable

Parameters:
inf - lower bound of the variable
sup - upper bound of the variable

makeRealVar

public RealVar makeRealVar(java.lang.String name)
Builds an interval variable without any information about bounds


makeEquation

public Constraint makeEquation(RealExp exp,
                               RealIntervalConstant cst)
Makes an equation from an expression and a constantt interval. It is used by all methods building constraints. This is useful for subclassing this modeller for another kind of problem (like PaLM).

Parameters:
exp - The expression
cst - The interval this expression should be in

eq

public Constraint eq(RealExp exp1,
                     RealExp exp2)
Eqality constraint.


eq

public Constraint eq(RealExp exp,
                     double cst)

eq

public Constraint eq(double cst,
                     RealExp exp)

leq

public Constraint leq(RealExp exp1,
                      RealExp exp2)
Inferority constraint.


leq

public Constraint leq(RealExp exp,
                      double cst)

leq

public Constraint leq(double cst,
                      RealExp exp)

geq

public Constraint geq(RealExp exp1,
                      RealExp exp2)
Superiority constraint.


geq

public Constraint geq(RealExp exp,
                      double cst)

geq

public Constraint geq(double cst,
                      RealExp exp)

plus

public RealExp plus(RealExp exp1,
                    RealExp exp2)
Addition of two expressions.


minus

public RealExp minus(RealExp exp1,
                     RealExp exp2)
Substraction of two expressions.


mult

public RealExp mult(RealExp exp1,
                    RealExp exp2)
Multiplication of two expressions.


power

public RealExp power(RealExp exp,
                     int power)
Power of an expression.


cos

public RealExp cos(RealExp exp)
Cosinus of an expression.


sin

public RealExp sin(RealExp exp)
Sinus of an expression.


around

public RealIntervalConstant around(double d)
Arounds a double d to [d - epsilon, d + epilon].


cst

public RealIntervalConstant cst(double d)
Makes a constant interval from a double d ([d,d]).


cst

public RealIntervalConstant cst(double a,
                                double b)
Makes a constant interval between two doubles [a,b].