Try our new documentation site (beta).


GRBModel.set()

Set the value(s) of an attribute. Use this method for scalar model attributes, or for arrays of constraint or variable attributes.

void set ( GRB.CharAttr attr,
    GRBVar[] vars,
    char[] newvalues )
    Set a char-valued variable attribute for an array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: The variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.CharAttr attr,
    GRBVar[] vars,
    char[] newvalues,
    int start,
    int len )
    Set a char-valued variable attribute for a sub-array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A one-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

    start: The index of the first variable of interest in the list.

    len: The number of variables.

void set ( GRB.CharAttr attr,
    GRBVar[][] vars,
    char[][] newvalues )
    Set a char-valued variable attribute for a two-dimensional array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A two-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.CharAttr attr,
    GRBVar[][][] vars,
    char[][][] newvalues )
    Set a char-valued variable attribute for a three-dimensional array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A three-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.CharAttr attr,
    GRBConstr[] constrs,
    char[] newvalues )
    Set a char-valued constraint attribute for an array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: The constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.CharAttr attr,
    GRBConstr[] constrs,
    char[] newvalues,
    int start,
    int len )
    Set a char-valued constraint attribute for a sub-array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A one-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

    start: The index of the first constraint of interest in the list.

    len: The number of constraints.

void set ( GRB.CharAttr attr,
    GRBConstr[][] constrs,
    char[][] newvalues )
    Set a char-valued constraint attribute for a two-dimensional array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A two-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.CharAttr attr,
    GRBConstr[][][] constrs,
    char[][][] newvalues )
    Set a char-valued constraint attribute for a three-dimensional array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A three-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.CharAttr attr,
    GRBQConstr[] qconstrs,
    char[] newvalues )
    Set a char-valued quadratic constraint attribute for an array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: The quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

void set ( GRB.CharAttr attr,
    GRBQConstr[] qconstrs,
    char[] newvalues,
    int start,
    int len )
    Set a char-valued quadratic constraint attribute for a sub-array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A one-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

    start: The index of the first quadratic constraint of interest in the list.

    len: The number of quadratic constraints.

void set ( GRB.CharAttr attr,
    GRBQConstr[][] qconstrs,
    char[][] newvalues )
    Set a char-valued quadratic constraint attribute for a two-dimensional array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A two-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

void set ( GRB.CharAttr attr,
    GRBQConstr[][][] qconstrs,
    char[][][] newvalues )
    Set a char-valued quadratic constraint attribute for a three-dimensional array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A three-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

void set ( GRB.DoubleAttr attr,
    double newvalue )
    Set the value of a double-valued model attribute.

    Arguments:

    attr: The attribute being modified.

    newvalue: The desired new value for the attribute.

void set ( GRB.DoubleAttr attr,
    GRBVar[] vars,
    double[] newvalues )
    Set a double-valued variable attribute for an array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: The variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.DoubleAttr attr,
    GRBVar[] vars,
    double[] newvalues,
    int start,
    int len )
    Set a double-valued variable attribute for a sub-array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A one-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

    start: The index of the first variable of interest in the list.

    len: The number of variables.

void set ( GRB.DoubleAttr attr,
    GRBVar[][] vars,
    double[][] newvalues )
    Set a double-valued variable attribute for a two-dimensional array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A two-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.DoubleAttr attr,
    GRBVar[][][] vars,
    double[][][] newvalues )
    Set a double-valued variable attribute for a three-dimensional array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A three-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.DoubleAttr attr,
    GRBConstr[] constrs,
    double[] newvalues )
    Set a double-valued constraint attribute for an array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: The constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.DoubleAttr attr,
    GRBConstr[] constrs,
    double[] newvalues,
    int start,
    int len )
    Set a double-valued constraint attribute for a sub-array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A one-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

    start: The first constraint of interest in the list.

    len: The number of constraints.

void set ( GRB.DoubleAttr attr,
    GRBConstr[][] constrs,
    double[][] newvalues )
    Set a double-valued constraint attribute for a two-dimensional array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A two-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.DoubleAttr attr,
    GRBConstr[][][] constrs,
    double[][][] newvalues )
    Set a double-valued constraint attribute for a three-dimensional array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A three-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.DoubleAttr attr,
    GRBQConstr[] qconstrs,
    double[] newvalues )
    Set a double-valued quadratic constraint attribute for an array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: The quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

void set ( GRB.DoubleAttr attr,
    GRBQConstr[] qconstrs,
    double[] newvalues,
    int start,
    int len )
    Set a double-valued quadratic constraint attribute for a sub-array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A one-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

    start: The first quadratic constraint of interest in the list.

    len: The number of quadratic constraints.

void set ( GRB.DoubleAttr attr,
    GRBQConstr[][] qconstrs,
    double[][] newvalues )
    Set a double-valued quadratic constraint attribute for a two-dimensional array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A two-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

void set ( GRB.DoubleAttr attr,
    GRBQConstr[][][] qconstrs,
    double[][][] newvalues )
    Set a double-valued quadratic constraint attribute for a three-dimensional array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A three-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

void set ( GRB.IntAttr attr,
    int newvalue )
    Set the value of an int-valued model attribute.

    Arguments:

    attr: The attribute being modified.

    newvalue: The desired new value for the attribute.

void set ( GRB.IntAttr attr,
    GRBVar[] vars,
    int[] newvalues )
    Set an int-valued variable attribute for an array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: The variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.IntAttr attr,
    GRBVar[] vars,
    int[] newvalues,
    int start,
    int len )
    Set an int-valued variable attribute for a sub-array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A one-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

    start: The index of the first variable of interest in the list.

    len: The number of variables.

void set ( GRB.IntAttr attr,
    GRBVar[][] vars,
    int[][] newvalues )
    Set an int-valued variable attribute for a two-dimensional array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A two-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.IntAttr attr,
    GRBVar[][][] vars,
    int[][][] newvalues )
    Set an int-valued variable attribute for a three-dimensional array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A three-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.IntAttr attr,
    GRBConstr[] constrs,
    int[] newvalues )
    Set an int-valued constraint attribute for an array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: The constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.IntAttr attr,
    GRBConstr[] constrs,
    int[] newvalues,
    int start,
    int len )
    Set an int-valued constraint attribute for a sub-array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A one-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

    start: The index of the first constraint of interest in the list.

    len: The number of constraints.

void set ( GRB.IntAttr attr,
    GRBConstr[][] constrs,
    int[][] newvalues )
    Set an int-valued constraint attribute for a two-dimensional array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A two-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.IntAttr attr,
    GRBConstr[][][] constrs,
    int[][][] newvalues )
    Set an int-valued constraint attribute for a three-dimensional array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A three-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.StringAttr attr,
    String newvalue )
    Set the value of a String-valued model attribute.

    Arguments:

    attr: The attribute being modified.

    newvalue: The desired new value for the attribute.

void set ( GRB.StringAttr attr,
    GRBVar[] vars,
    String[] newvalues )
    Set a String-valued variable attribute for an array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: The variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.StringAttr attr,
    GRBVar[] vars,
    String[] newvalues,
    int start,
    int len )
    Set a String-valued variable attribute for a sub-array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A one-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

    start: The index of the first variable of interest in the list.

    len: The number of variables.

void set ( GRB.StringAttr attr,
    GRBVar[][] vars,
    String[][] newvalues )
    Set a String-valued variable attribute for a two-dimensional array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A two-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.StringAttr attr,
    GRBVar[][][] vars,
    String[][][] newvalues )
    Set a String-valued variable attribute for a three-dimensional array of variables.

    Arguments:

    attr: The attribute being modified.

    vars: A three-dimensional array of variables whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input variable.

void set ( GRB.StringAttr attr,
    GRBConstr[] constrs,
    String[] newvalues )
    Set a String-valued constraint attribute for an array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: The constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.StringAttr attr,
    GRBConstr[] constrs,
    String[] newvalues,
    int start,
    int len )
    Set a String-valued constraint attribute for a sub-array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A one-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

    start: The index of the first constraint of interest in the list.

    len: The number of constraints.

void set ( GRB.StringAttr attr,
    GRBConstr[][] constrs,
    String[][] newvalues )
    Set a String-valued constraint attribute for a two-dimensional array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A two-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.StringAttr attr,
    GRBConstr[][][] constrs,
    String[][][] newvalues )
    Set a String-valued constraint attribute for a three-dimensional array of constraints.

    Arguments:

    attr: The attribute being modified.

    constrs: A three-dimensional array of constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input constraint.

void set ( GRB.StringAttr attr,
    GRBQConstr[] qconstrs,
    String[] newvalues )
    Set a String-valued quadratic constraint attribute for an array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: The quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

void set ( GRB.StringAttr attr,
    GRBQConstr[] qconstrs,
    String[] newvalues,
    int start,
    int len )
    Set a String-valued quadratic constraint attribute for a sub-array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A one-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

    start: The index of the first quadratic constraint of interest in the list.

    len: The number of quadratic constraints.

void set ( GRB.StringAttr attr,
    GRBQConstr[][] qconstrs,
    String[][] newvalues )
    Set a String-valued quadratic constraint attribute for a two-dimensional array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A two-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

void set ( GRB.StringAttr attr,
    GRBQConstr[][][] qconstrs,
    String[][][] newvalues )
    Set a String-valued quadratic constraint attribute for a three-dimensional array of quadratic constraints.

    Arguments:

    attr: The attribute being modified.

    qconstrs: A three-dimensional array of quadratic constraints whose attribute values are being modified.

    newvalues: The desired new values for the attribute for each input quadratic constraint.

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Search

Gurobi Optimization