Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.modelbuilder.ModelSolver Class Reference

Classes

class  ModelSolverException
 

Public Member Functions

 ModelSolver (String solverName)
 
SolveStatus solve (ModelBuilder model)
 
void enableOutput (boolean enable)
 
void setTimeLimit (Duration limit)
 
void setSolverSpecificParameters (String parameters)
 
boolean solverIsSupported ()
 
boolean interruptSolve ()
 
boolean hasResponse ()
 
boolean hasSolution ()
 
double getObjectiveValue ()
 
double getBestObjectiveBound ()
 
double getValue (Variable var)
 
double getReducedCost (Variable var)
 
double getDualValue (LinearConstraint ct)
 
double getActivity (LinearConstraint ct)
 
void setLogCallback (Consumer< String > cb)
 
double getWallTime ()
 
double getUserTime ()
 
 ModelSolver (String solverName)
 
SolveStatus solve (ModelBuilder model)
 
void enableOutput (boolean enable)
 
void setTimeLimit (Duration limit)
 
void setSolverSpecificParameters (String parameters)
 
boolean solverIsSupported ()
 
boolean interruptSolve ()
 
boolean hasResponse ()
 
boolean hasSolution ()
 
double getObjectiveValue ()
 
double getBestObjectiveBound ()
 
double getValue (Variable var)
 
double getReducedCost (Variable var)
 
double getDualValue (LinearConstraint ct)
 
double getActivity (LinearConstraint ct)
 
void setLogCallback (Consumer< String > cb)
 
double getWallTime ()
 
double getUserTime ()
 

Detailed Description

Model solver class

Definition at line 20 of file ModelSolver.java.

Constructor & Destructor Documentation

◆ ModelSolver() [1/2]

com.google.ortools.modelbuilder.ModelSolver.ModelSolver ( String solverName)

Creates the solver with the supplied solver backend.

Definition at line 29 of file ModelSolver.java.

◆ ModelSolver() [2/2]

com.google.ortools.modelbuilder.ModelSolver.ModelSolver ( String solverName)

Creates the solver with the supplied solver backend.

Definition at line 29 of file ModelSolver.java.

Member Function Documentation

◆ enableOutput() [1/2]

void com.google.ortools.modelbuilder.ModelSolver.enableOutput ( boolean enable)

Enables or disables the underlying solver output.

Definition at line 49 of file ModelSolver.java.

◆ enableOutput() [2/2]

void com.google.ortools.modelbuilder.ModelSolver.enableOutput ( boolean enable)

Enables or disables the underlying solver output.

Definition at line 49 of file ModelSolver.java.

◆ getActivity() [1/2]

double com.google.ortools.modelbuilder.ModelSolver.getActivity ( LinearConstraint ct)

Checks that the solver has found a solution, and returns the activity of the given constraint.

Definition at line 136 of file ModelSolver.java.

◆ getActivity() [2/2]

double com.google.ortools.modelbuilder.ModelSolver.getActivity ( LinearConstraint ct)

Checks that the solver has found a solution, and returns the activity of the given constraint.

Definition at line 136 of file ModelSolver.java.

◆ getBestObjectiveBound() [1/2]

double com.google.ortools.modelbuilder.ModelSolver.getBestObjectiveBound ( )

Checks that the solver has found a solution, and returns the objective value.

Definition at line 93 of file ModelSolver.java.

◆ getBestObjectiveBound() [2/2]

double com.google.ortools.modelbuilder.ModelSolver.getBestObjectiveBound ( )

Checks that the solver has found a solution, and returns the objective value.

Definition at line 93 of file ModelSolver.java.

◆ getDualValue() [1/2]

double com.google.ortools.modelbuilder.ModelSolver.getDualValue ( LinearConstraint ct)

Checks that the solver has found a solution, and returns the dual value of the given constraint.

Definition at line 125 of file ModelSolver.java.

◆ getDualValue() [2/2]

double com.google.ortools.modelbuilder.ModelSolver.getDualValue ( LinearConstraint ct)

Checks that the solver has found a solution, and returns the dual value of the given constraint.

Definition at line 125 of file ModelSolver.java.

◆ getObjectiveValue() [1/2]

double com.google.ortools.modelbuilder.ModelSolver.getObjectiveValue ( )

Checks that the solver has found a solution, and returns the objective value.

Definition at line 84 of file ModelSolver.java.

◆ getObjectiveValue() [2/2]

double com.google.ortools.modelbuilder.ModelSolver.getObjectiveValue ( )

Checks that the solver has found a solution, and returns the objective value.

Definition at line 84 of file ModelSolver.java.

◆ getReducedCost() [1/2]

double com.google.ortools.modelbuilder.ModelSolver.getReducedCost ( Variable var)

Checks that the solver has found a solution, and returns the reduced cost of the given variable.

Definition at line 113 of file ModelSolver.java.

◆ getReducedCost() [2/2]

double com.google.ortools.modelbuilder.ModelSolver.getReducedCost ( Variable var)

Checks that the solver has found a solution, and returns the reduced cost of the given variable.

Definition at line 113 of file ModelSolver.java.

◆ getUserTime() [1/2]

double com.google.ortools.modelbuilder.ModelSolver.getUserTime ( )

Returns the user time since the creation of the solver.

Definition at line 155 of file ModelSolver.java.

◆ getUserTime() [2/2]

double com.google.ortools.modelbuilder.ModelSolver.getUserTime ( )

Returns the user time since the creation of the solver.

Definition at line 155 of file ModelSolver.java.

◆ getValue() [1/2]

double com.google.ortools.modelbuilder.ModelSolver.getValue ( Variable var)

Checks that the solver has found a solution, and returns the value of the given variable.

Definition at line 102 of file ModelSolver.java.

◆ getValue() [2/2]

double com.google.ortools.modelbuilder.ModelSolver.getValue ( Variable var)

Checks that the solver has found a solution, and returns the value of the given variable.

Definition at line 102 of file ModelSolver.java.

◆ getWallTime() [1/2]

double com.google.ortools.modelbuilder.ModelSolver.getWallTime ( )

Returns the elapsed time since the creation of the solver.

Definition at line 150 of file ModelSolver.java.

◆ getWallTime() [2/2]

double com.google.ortools.modelbuilder.ModelSolver.getWallTime ( )

Returns the elapsed time since the creation of the solver.

Definition at line 150 of file ModelSolver.java.

◆ hasResponse() [1/2]

boolean com.google.ortools.modelbuilder.ModelSolver.hasResponse ( )

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

Definition at line 74 of file ModelSolver.java.

◆ hasResponse() [2/2]

boolean com.google.ortools.modelbuilder.ModelSolver.hasResponse ( )

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

Definition at line 74 of file ModelSolver.java.

◆ hasSolution() [1/2]

boolean com.google.ortools.modelbuilder.ModelSolver.hasSolution ( )

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

Definition at line 79 of file ModelSolver.java.

◆ hasSolution() [2/2]

boolean com.google.ortools.modelbuilder.ModelSolver.hasSolution ( )

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

Definition at line 79 of file ModelSolver.java.

◆ interruptSolve() [1/2]

boolean com.google.ortools.modelbuilder.ModelSolver.interruptSolve ( )

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

Definition at line 69 of file ModelSolver.java.

◆ interruptSolve() [2/2]

boolean com.google.ortools.modelbuilder.ModelSolver.interruptSolve ( )

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

Definition at line 69 of file ModelSolver.java.

◆ setLogCallback() [1/2]

void com.google.ortools.modelbuilder.ModelSolver.setLogCallback ( Consumer< String > cb)

Sets the log callback for the solver.

Definition at line 145 of file ModelSolver.java.

◆ setLogCallback() [2/2]

void com.google.ortools.modelbuilder.ModelSolver.setLogCallback ( Consumer< String > cb)

Sets the log callback for the solver.

Definition at line 145 of file ModelSolver.java.

◆ setSolverSpecificParameters() [1/2]

void com.google.ortools.modelbuilder.ModelSolver.setSolverSpecificParameters ( String parameters)

Sets solver specific parameters as string.

Definition at line 59 of file ModelSolver.java.

◆ setSolverSpecificParameters() [2/2]

void com.google.ortools.modelbuilder.ModelSolver.setSolverSpecificParameters ( String parameters)

Sets solver specific parameters as string.

Definition at line 59 of file ModelSolver.java.

◆ setTimeLimit() [1/2]

void com.google.ortools.modelbuilder.ModelSolver.setTimeLimit ( Duration limit)

Sets the time limit for the solve in seconds.

Definition at line 54 of file ModelSolver.java.

◆ setTimeLimit() [2/2]

void com.google.ortools.modelbuilder.ModelSolver.setTimeLimit ( Duration limit)

Sets the time limit for the solve in seconds.

Definition at line 54 of file ModelSolver.java.

◆ solve() [1/2]

SolveStatus com.google.ortools.modelbuilder.ModelSolver.solve ( ModelBuilder model)

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

Definition at line 35 of file ModelSolver.java.

◆ solve() [2/2]

SolveStatus com.google.ortools.modelbuilder.ModelSolver.solve ( ModelBuilder model)

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

Definition at line 35 of file ModelSolver.java.

◆ solverIsSupported() [1/2]

boolean com.google.ortools.modelbuilder.ModelSolver.solverIsSupported ( )

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

Definition at line 64 of file ModelSolver.java.

◆ solverIsSupported() [2/2]

boolean com.google.ortools.modelbuilder.ModelSolver.solverIsSupported ( )

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

Definition at line 64 of file ModelSolver.java.


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