Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.linear_solver.pywraplp.Objective Class Reference

Detailed Description

A class to express a linear objective.

Definition at line 561 of file pywraplp.py.

Inheritance diagram for ortools.linear_solver.pywraplp.Objective:

Public Member Functions

 __init__ (self, *args, **kwargs)
 Clear (self)
 SetCoefficient (self, var, coeff)
 GetCoefficient (self, var)
 SetOffset (self, value)
 offset (self)
 SetOptimizationDirection (self, maximize)
 SetMinimization (self)
 SetMaximization (self)
 maximization (self)
 minimization (self)
 Value (self)
 BestBound (self)
 Offset (self)

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

Constructor & Destructor Documentation

◆ __init__()

ortools.linear_solver.pywraplp.Objective.__init__ ( self,
* args,
** kwargs )

Definition at line 566 of file pywraplp.py.

Member Function Documentation

◆ BestBound()

ortools.linear_solver.pywraplp.Objective.BestBound ( self)
Returns the best objective bound.

In case of minimization, it is a lower bound on the objective value of the
optimal integer solution. Only available for discrete problems.

Definition at line 636 of file pywraplp.py.

◆ Clear()

ortools.linear_solver.pywraplp.Objective.Clear ( self)
 Clears the offset, all variables and coefficients, and the optimization
direction.

Definition at line 570 of file pywraplp.py.

◆ GetCoefficient()

ortools.linear_solver.pywraplp.Objective.GetCoefficient ( self,
var )
 Gets the coefficient of a given variable in the objective

It returns 0 if the variable does not appear in the objective).

Definition at line 586 of file pywraplp.py.

◆ maximization()

ortools.linear_solver.pywraplp.Objective.maximization ( self)
Is the optimization direction set to maximize?

Definition at line 614 of file pywraplp.py.

◆ minimization()

ortools.linear_solver.pywraplp.Objective.minimization ( self)
Is the optimization direction set to minimize?

Definition at line 618 of file pywraplp.py.

◆ Offset()

ortools.linear_solver.pywraplp.Objective.Offset ( self)

Definition at line 645 of file pywraplp.py.

◆ offset()

ortools.linear_solver.pywraplp.Objective.offset ( self)
Gets the constant term in the objective.

Definition at line 598 of file pywraplp.py.

◆ SetCoefficient()

ortools.linear_solver.pywraplp.Objective.SetCoefficient ( self,
var,
coeff )
Sets the coefficient of the variable in the objective.

If the variable does not belong to the solver, the function just returns,
or crashes in non-opt mode.

Definition at line 577 of file pywraplp.py.

◆ SetMaximization()

ortools.linear_solver.pywraplp.Objective.SetMaximization ( self)
Sets the optimization direction to maximize.

Definition at line 610 of file pywraplp.py.

◆ SetMinimization()

ortools.linear_solver.pywraplp.Objective.SetMinimization ( self)
Sets the optimization direction to minimize.

Definition at line 606 of file pywraplp.py.

◆ SetOffset()

ortools.linear_solver.pywraplp.Objective.SetOffset ( self,
value )
Sets the constant term in the objective.

Definition at line 594 of file pywraplp.py.

◆ SetOptimizationDirection()

ortools.linear_solver.pywraplp.Objective.SetOptimizationDirection ( self,
maximize )
Sets the optimization direction (maximize: true or minimize: false).

Definition at line 602 of file pywraplp.py.

◆ Value()

ortools.linear_solver.pywraplp.Objective.Value ( self)
Returns the objective value of the best solution found so far.

It is the optimal objective value if the problem has been solved to
optimality.

Note: the objective value may be slightly different than what you could
compute yourself using ``MPVariable::solution_value();`` please use the
--verify_solution flag to gain confidence about the numerical stability of
your solution.

Definition at line 622 of file pywraplp.py.

Property Documentation

◆ thisown

ortools.linear_solver.pywraplp.Objective.thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
static

Definition at line 564 of file pywraplp.py.


The documentation for this class was generated from the following file: