Interface IRealConstraintFactory

  • All Known Subinterfaces:
    IConstraintFactory, IModel
    All Known Implementing Classes:
    Model

    public interface IRealConstraintFactory
    Interface to make constraints over RealVar A kind of factory relying on interface default implementation to allow (multiple) inheritance
    Since:
    4.0.0
    Author:
    Jean-Guillaume FAGES
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default RealConstraint ibex​(String functions, Variable... rvars)
      Creates a RealConstraint to model one or more continuous functions, separated with semi-colon ";"
      A function is a string declared using the following format:
      - the '{i}' tag defines a variable, where 'i' is an explicit index the array of variables vars,
      - one or more operators :'+,-,*,/,=,<,>,<=,>=,exp( ),ln( ),max( ),min( ),abs( ),cos( ), sin( ),...'
      default RealConstraint realIbexGenericConstraint​(String functions, Variable... rvars)
      Creates a RealConstraint to model one or more continuous functions, separated with semi-colon ";"
      A function is a string declared using the following format:
      - the '{i}' tag defines a variable, where 'i' is an explicit index the array of variables vars,
      - one or more operators :'+,-,*,/,=,<,>,<=,>=,exp( ),ln( ),max( ),min( ),abs( ),cos( ), sin( ),...'
      default Constraint scalar​(Variable[] vars, double[] coeffs, String op, double bound)
      Creates a linear equation constraint over RealVar, IntVar or BoolVar which ensures that Sum(vars[i]*coeffs[i]) op bound
    • Method Detail

      • realIbexGenericConstraint

        default RealConstraint realIbexGenericConstraint​(String functions,
                                                         Variable... rvars)
        Creates a RealConstraint to model one or more continuous functions, separated with semi-colon ";"
        A function is a string declared using the following format:
        - the '{i}' tag defines a variable, where 'i' is an explicit index the array of variables vars,
        - one or more operators :'+,-,*,/,=,<,>,<=,>=,exp( ),ln( ),max( ),min( ),abs( ),cos( ), sin( ),...'
        A complete list is available in the documentation of IBEX.

        Example to express the system:
        x*y + sin(x) = 1;
        ln(x)+[-0.1,0.1] >=2.6;

        realIbexGenericConstraint("({0}*{1})+sin({0})=1.0;ln({0}+[-0.1,0.1])>=2.6", x,y);

        Parameters:
        functions - list of functions, separated by a semi-colon
        rvars - a list of real variables
      • ibex

        default RealConstraint ibex​(String functions,
                                    Variable... rvars)
        Creates a RealConstraint to model one or more continuous functions, separated with semi-colon ";"
        A function is a string declared using the following format:
        - the '{i}' tag defines a variable, where 'i' is an explicit index the array of variables vars,
        - one or more operators :'+,-,*,/,=,<,>,<=,>=,exp( ),ln( ),max( ),min( ),abs( ),cos( ), sin( ),...'
        A complete list is available in the documentation of IBEX.

        Example to express the system:
        x*y + sin(x) = 1;
        ln(x)+[-0.1,0.1] >=2.6;

        realIbexGenericConstraint("({0}*{1})+sin({0})=1.0;ln({0}+[-0.1,0.1])>=2.6", x,y);

        Parameters:
        functions - list of functions, separated by a semi-colon
        rvars - a list of real variables
      • scalar

        default Constraint scalar​(Variable[] vars,
                                  double[] coeffs,
                                  String op,
                                  double bound)
        Creates a linear equation constraint over RealVar, IntVar or BoolVar which ensures that Sum(vars[i]*coeffs[i]) op bound
        Parameters:
        vars - a collection of variable (RealVar, IntVar, BoolVar are accepted)
        coeffs - a collection of double, for which |vars|=|coeffs|
        op - an operator in {"=", ">=", "<="}
        bound - a double
        Returns:
        a scalar constraint