Interface ExpressionsBasedModel.EntityMap

    • Method Detail

      • countModelVariables

        int countModelVariables()
        The number of variables, in the solver, that directly correspond to a model variable. (Not slack or artificial variables.)

        This defines the range of the indices that can be used with the indexOf(int) and isNegated(int) methods.

      • countSlackVariables

        int countSlackVariables()
        The number of slack variables.

        This defines the range of the indices that can be used with the getSlack(int) method.

      • getSlack

        EntryPair<ModelEntity<?>,​Optimisation.ConstraintType> getSlack​(int ids)
        Returns which model entity, and constraint type, that corresponds to the slack variable at the supplied index.
        Parameters:
        ids - Index of solver slack variable (If there are 3 slack variables this input argument should be in the range [0.2].)
      • indexOf

        int indexOf​(int idm)
        Converts from a solver specific variable index to the corresponding index of the variable in the model. Note that not all model variables are necessarily represented in the solver, and a model variable may result in multiple solver variables. Further, slack variables, artificial variables and such are typically not represented in the model.
        Parameters:
        idm - Index of solver variable
        Returns:
        Index of model variable (negative if no map)
      • isNegated

        boolean isNegated​(int idm)
        Is this solver variable negated relative to the corresponding model variable?
        Parameters:
        idm - Index of solver variable
        Returns:
        true if this solver variable represents a negated model variable