Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.ModelBuilder.Solver Class Reference

Model solver class. More...

Public Member Functions

 Solver (String solverName)
 Creates the solver with the supplied solver backend.
 
SolveStatus Solve (Model model)
 Solves given model, and returns the status of the response.
 
void EnableOutput (bool enable)
 Enables or disables the underlying solver output.
 
void SetTimeLimitInSeconds (double limit)
 
void SetSolverSpecificParameters (String parameters)
 
bool SolverIsSupported ()
 Returns whether solver specified during the ctor was found and correctly installed.
 
bool InterruptSolve ()
 Tries to interrupt the solve. Returns true if the feature is supported.
 
bool HasResponse ()
 Returns true if solve() was called, and a response was returned.
 
bool HasSolution ()
 Returns true if solve() was called, and a solution was returned.
 
double Value (Variable var)
 The value of a variable in the current solution. This raises a SolverException if no solution has been found, or if Solve() has not been called.
 
double ReducedCost (Variable var)
 The reduced cost of a variable in the current solution. This raises a SolverException if no solution has been found, or if Solve() has not been called.
 
double DualValue (LinearConstraint ct)
 The dual value of a linear constraint in the current solution. This raises a SolverException if no solution has been found, or if Solve() has not been called.
 
double Activity (LinearConstraint ct)
 The activity of a constraint in the current solution. This raises a SolverException if no solution has been found, or if Solve() has not been called.
 

Properties

double ObjectiveValue [get]
 The best objective value found during search. This raises a SolverException if no solution has been found, or if Solve() has not been called.
 
double BestObjectiveBound [get]
 The best objective bound found during search. This raises a SolverException if no solution has been found, or if Solve() has not been called.
 
MbLogCallback LogCallback [get, set]
 Sets the log callback for the solver.
 
double WallTime [get]
 Returns the elapsed time since the creation of the solver.
 
double UserTime [get]
 Returns the user time since the creation of the solver.
 

Detailed Description

Model solver class.

Definition at line 28 of file ModelSolver.cs.

Constructor & Destructor Documentation

◆ Solver()

Google.OrTools.ModelBuilder.Solver.Solver ( String solverName)
inline

Creates the solver with the supplied solver backend.

Parameters
solverNamethe name of the solver backend

Definition at line 41 of file ModelSolver.cs.

Member Function Documentation

◆ Activity()

double Google.OrTools.ModelBuilder.Solver.Activity ( LinearConstraint ct)
inline

The activity of a constraint in the current solution. This raises a SolverException if no solution has been found, or if Solve() has not been called.

Definition at line 200 of file ModelSolver.cs.

◆ DualValue()

double Google.OrTools.ModelBuilder.Solver.DualValue ( LinearConstraint ct)
inline

The dual value of a linear constraint in the current solution. This raises a SolverException if no solution has been found, or if Solve() has not been called.

Definition at line 187 of file ModelSolver.cs.

◆ EnableOutput()

void Google.OrTools.ModelBuilder.Solver.EnableOutput ( bool enable)
inline

Enables or disables the underlying solver output.

Parameters
enablethe Boolean that controls the output

Definition at line 74 of file ModelSolver.cs.

◆ HasResponse()

bool Google.OrTools.ModelBuilder.Solver.HasResponse ( )
inline

Returns true if solve() was called, and a response was returned.

Returns
whether solve did happen

Definition at line 113 of file ModelSolver.cs.

◆ HasSolution()

bool Google.OrTools.ModelBuilder.Solver.HasSolution ( )
inline

Returns true if solve() was called, and a solution was returned.

Returns
whether a solution was found

Definition at line 122 of file ModelSolver.cs.

◆ InterruptSolve()

bool Google.OrTools.ModelBuilder.Solver.InterruptSolve ( )
inline

Tries to interrupt the solve. Returns true if the feature is supported.

Returns
whether the solver supports interruption

Definition at line 104 of file ModelSolver.cs.

◆ ReducedCost()

double Google.OrTools.ModelBuilder.Solver.ReducedCost ( Variable var)
inline

The reduced cost of a variable in the current solution. This raises a SolverException if no solution has been found, or if Solve() has not been called.

Definition at line 174 of file ModelSolver.cs.

◆ SetSolverSpecificParameters()

void Google.OrTools.ModelBuilder.Solver.SetSolverSpecificParameters ( String parameters)
inline

Sets solver specific parameters as string.

Definition at line 86 of file ModelSolver.cs.

◆ SetTimeLimitInSeconds()

void Google.OrTools.ModelBuilder.Solver.SetTimeLimitInSeconds ( double limit)
inline

Sets the time limit for the solve in seconds.

Definition at line 80 of file ModelSolver.cs.

◆ Solve()

SolveStatus Google.OrTools.ModelBuilder.Solver.Solve ( Model model)
inline

Solves given model, and returns the status of the response.

Parameters
modelthe model to solve
Returns
the status of the solve

Definition at line 52 of file ModelSolver.cs.

◆ SolverIsSupported()

bool Google.OrTools.ModelBuilder.Solver.SolverIsSupported ( )
inline

Returns whether solver specified during the ctor was found and correctly installed.

Returns
whether the solver is supported or not

Definition at line 95 of file ModelSolver.cs.

◆ Value()

double Google.OrTools.ModelBuilder.Solver.Value ( Variable var)
inline

The value of a variable in the current solution. This raises a SolverException if no solution has been found, or if Solve() has not been called.

Definition at line 162 of file ModelSolver.cs.

Property Documentation

◆ BestObjectiveBound

double Google.OrTools.ModelBuilder.Solver.BestObjectiveBound
get

The best objective bound found during search. This raises a SolverException if no solution has been found, or if Solve() has not been called.

Definition at line 146 of file ModelSolver.cs.

◆ LogCallback

MbLogCallback Google.OrTools.ModelBuilder.Solver.LogCallback
getset

Sets the log callback for the solver.

Definition at line 212 of file ModelSolver.cs.

◆ ObjectiveValue

double Google.OrTools.ModelBuilder.Solver.ObjectiveValue
get

The best objective value found during search. This raises a SolverException if no solution has been found, or if Solve() has not been called.

Definition at line 131 of file ModelSolver.cs.

◆ UserTime

double Google.OrTools.ModelBuilder.Solver.UserTime
get

Returns the user time since the creation of the solver.

Definition at line 235 of file ModelSolver.cs.

◆ WallTime

double Google.OrTools.ModelBuilder.Solver.WallTime
get

Returns the elapsed time since the creation of the solver.

Definition at line 225 of file ModelSolver.cs.


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