public class MPObjective
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
swigCMemOwn |
Modifier | Constructor and Description |
---|---|
protected |
MPObjective(long cPtr,
boolean cMemoryOwn) |
Modifier and Type | Method and Description |
---|---|
double |
bestBound()
Returns the best objective bound.
|
void |
clear()
Clears the offset, all variables and coefficients, and the optimization
direction. |
void |
delete() |
protected void |
finalize() |
double |
getCoefficient(MPVariable var)
Gets the coefficient of a given variable in the objective
It returns 0 if the variable does not appear in the objective). |
protected static long |
getCPtr(MPObjective obj) |
boolean |
maximization()
Is the optimization direction set to maximize?
|
boolean |
minimization()
Is the optimization direction set to minimize?
|
double |
offset()
Gets the constant term in the objective.
|
void |
setCoefficient(MPVariable var,
double coeff)
Sets the coefficient of the variable in the objective.
|
void |
setMaximization()
Sets the optimization direction to maximize.
|
void |
setMinimization()
Sets the optimization direction to minimize.
|
void |
setOffset(double value)
Sets the constant term in the objective.
|
void |
setOptimizationDirection(boolean maximize)
Sets the optimization direction (maximize: true or minimize: false).
|
protected static long |
swigRelease(MPObjective obj) |
double |
value()
Returns the objective value of the best solution found so far.
|
protected static long getCPtr(MPObjective obj)
protected static long swigRelease(MPObjective obj)
protected void finalize()
finalize
in class java.lang.Object
public void delete()
public void clear()
public void setCoefficient(MPVariable var, double coeff)
public double getCoefficient(MPVariable var)
public void setOffset(double value)
public double offset()
public void setOptimizationDirection(boolean maximize)
public void setMinimization()
public void setMaximization()
public boolean maximization()
public boolean minimization()
public double value()
MPVariable::solution_value();
please use thepublic double bestBound()
Copyright © 2025. All rights reserved.