Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.linear_solver.pywraplp.Objective Class Reference
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")
 

Detailed Description

A class to express a linear objective.

Definition at line 560 of file pywraplp.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 565 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 635 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 569 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 585 of file pywraplp.py.

◆ maximization()

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

Definition at line 613 of file pywraplp.py.

◆ minimization()

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

Definition at line 617 of file pywraplp.py.

◆ Offset()

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

Definition at line 644 of file pywraplp.py.

◆ offset()

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

Definition at line 597 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 576 of file pywraplp.py.

◆ SetMaximization()

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

Definition at line 609 of file pywraplp.py.

◆ SetMinimization()

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

Definition at line 605 of file pywraplp.py.

◆ SetOffset()

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

Definition at line 593 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 601 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 621 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 563 of file pywraplp.py.


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