DotNet Reference

DotNet Reference

CpSolverResponse

Detailed Description

The response returned by a solver trying to solve a CpModelProto.

TODO(user): support returning multiple solutions. Look at the Stubby streaming API as we probably wants to get them as they are found. Next id: 24

Definition at line 5997 of file CpModel.pb.cs.

Public Member Functions

 CpSolverResponse ()
 
 CpSolverResponse (CpSolverResponse other)
 
CpSolverResponse Clone ()
 
override bool Equals (object other)
 
bool Equals (CpSolverResponse other)
 
override int GetHashCode ()
 
override string ToString ()
 
void WriteTo (pb::CodedOutputStream output)
 
int CalculateSize ()
 
void MergeFrom (CpSolverResponse other)
 
void MergeFrom (pb::CodedInputStream input)
 

Static Public Attributes

const int StatusFieldNumber = 1
 Field number for the "status" field. More...
 
const int SolutionFieldNumber = 2
 Field number for the "solution" field. More...
 
const int ObjectiveValueFieldNumber = 3
 Field number for the "objective_value" field. More...
 
const int BestObjectiveBoundFieldNumber = 4
 Field number for the "best_objective_bound" field. More...
 
const int SolutionLowerBoundsFieldNumber = 18
 Field number for the "solution_lower_bounds" field. More...
 
const int SolutionUpperBoundsFieldNumber = 19
 Field number for the "solution_upper_bounds" field. More...
 
const int TightenedVariablesFieldNumber = 21
 Field number for the "tightened_variables" field. More...
 
const int SufficientAssumptionsForInfeasibilityFieldNumber = 23
 Field number for the "sufficient_assumptions_for_infeasibility" field. More...
 
const int AllSolutionsWereFoundFieldNumber = 5
 Field number for the "all_solutions_were_found" field. More...
 
const int NumBooleansFieldNumber = 10
 Field number for the "num_booleans" field. More...
 
const int NumConflictsFieldNumber = 11
 Field number for the "num_conflicts" field. More...
 
const int NumBranchesFieldNumber = 12
 Field number for the "num_branches" field. More...
 
const int NumBinaryPropagationsFieldNumber = 13
 Field number for the "num_binary_propagations" field. More...
 
const int NumIntegerPropagationsFieldNumber = 14
 Field number for the "num_integer_propagations" field. More...
 
const int WallTimeFieldNumber = 15
 Field number for the "wall_time" field. More...
 
const int UserTimeFieldNumber = 16
 Field number for the "user_time" field. More...
 
const int DeterministicTimeFieldNumber = 17
 Field number for the "deterministic_time" field. More...
 
const int PrimalIntegralFieldNumber = 22
 Field number for the "primal_integral" field. More...
 
const int SolutionInfoFieldNumber = 20
 Field number for the "solution_info" field. More...
 

Properties

static pb::MessageParser< CpSolverResponseParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
global::Google.OrTools.Sat.CpSolverStatus Status [get, set]
 The status of the solve. More...
 
pbc::RepeatedField< long > Solution [get]
 A feasible solution to the given problem. More...
 
double ObjectiveValue [get, set]
 Only make sense for an optimization problem. More...
 
double BestObjectiveBound [get, set]
 Only make sense for an optimization problem. More...
 
pbc::RepeatedField< long > SolutionLowerBounds [get]
 Advanced usage. More...
 
pbc::RepeatedField< long > SolutionUpperBounds [get]
 
pbc::RepeatedField< global::Google.OrTools.Sat.IntegerVariableProto > TightenedVariables [get]
 Advanced usage. More...
 
pbc::RepeatedField< int > SufficientAssumptionsForInfeasibility [get]
 A subset of the model "assumptions" field. More...
 
bool AllSolutionsWereFound [get, set]
 This will be true iff the solver was asked to find all solutions to a satisfiability problem (or all optimal solutions to an optimization problem), and it was successful in doing so. More...
 
long NumBooleans [get, set]
 Some statistics about the solve. More...
 
long NumConflicts [get, set]
 
long NumBranches [get, set]
 
long NumBinaryPropagations [get, set]
 
long NumIntegerPropagations [get, set]
 
double WallTime [get, set]
 
double UserTime [get, set]
 
double DeterministicTime [get, set]
 
double PrimalIntegral [get, set]
 
string SolutionInfo [get, set]
 Additional information about how the solution was found. More...
 

Constructor & Destructor Documentation

◆ CpSolverResponse() [1/2]

CpSolverResponse ( )
inline

Definition at line 6014 of file CpModel.pb.cs.

◆ CpSolverResponse() [2/2]

Definition at line 6021 of file CpModel.pb.cs.

Member Function Documentation

◆ CalculateSize()

int CalculateSize ( )
inline

Definition at line 6461 of file CpModel.pb.cs.

◆ Clone()

CpSolverResponse Clone ( )
inline

Definition at line 6045 of file CpModel.pb.cs.

◆ Equals() [1/2]

bool Equals ( CpSolverResponse  other)
inline

Definition at line 6330 of file CpModel.pb.cs.

◆ Equals() [2/2]

override bool Equals ( object  other)
inline

Definition at line 6325 of file CpModel.pb.cs.

◆ GetHashCode()

override int GetHashCode ( )
inline

Definition at line 6360 of file CpModel.pb.cs.

◆ MergeFrom() [1/2]

void MergeFrom ( CpSolverResponse  other)
inline

Definition at line 6517 of file CpModel.pb.cs.

◆ MergeFrom() [2/2]

void MergeFrom ( pb::CodedInputStream  input)
inline

Definition at line 6572 of file CpModel.pb.cs.

◆ ToString()

override string ToString ( )
inline

Definition at line 6388 of file CpModel.pb.cs.

◆ WriteTo()

void WriteTo ( pb::CodedOutputStream  output)
inline

Definition at line 6393 of file CpModel.pb.cs.

Member Data Documentation

◆ AllSolutionsWereFoundFieldNumber

const int AllSolutionsWereFoundFieldNumber = 5
static

Field number for the "all_solutions_were_found" field.

Definition at line 6191 of file CpModel.pb.cs.

◆ BestObjectiveBoundFieldNumber

const int BestObjectiveBoundFieldNumber = 4
static

Field number for the "best_objective_bound" field.

Definition at line 6097 of file CpModel.pb.cs.

◆ DeterministicTimeFieldNumber

const int DeterministicTimeFieldNumber = 17
static

Field number for the "deterministic_time" field.

Definition at line 6289 of file CpModel.pb.cs.

◆ NumBinaryPropagationsFieldNumber

const int NumBinaryPropagationsFieldNumber = 13
static

Field number for the "num_binary_propagations" field.

Definition at line 6245 of file CpModel.pb.cs.

◆ NumBooleansFieldNumber

const int NumBooleansFieldNumber = 10
static

Field number for the "num_booleans" field.

Definition at line 6209 of file CpModel.pb.cs.

◆ NumBranchesFieldNumber

const int NumBranchesFieldNumber = 12
static

Field number for the "num_branches" field.

Definition at line 6234 of file CpModel.pb.cs.

◆ NumConflictsFieldNumber

const int NumConflictsFieldNumber = 11
static

Field number for the "num_conflicts" field.

Definition at line 6223 of file CpModel.pb.cs.

◆ NumIntegerPropagationsFieldNumber

const int NumIntegerPropagationsFieldNumber = 14
static

Field number for the "num_integer_propagations" field.

Definition at line 6256 of file CpModel.pb.cs.

◆ ObjectiveValueFieldNumber

const int ObjectiveValueFieldNumber = 3
static

Field number for the "objective_value" field.

Definition at line 6080 of file CpModel.pb.cs.

◆ PrimalIntegralFieldNumber

const int PrimalIntegralFieldNumber = 22
static

Field number for the "primal_integral" field.

Definition at line 6300 of file CpModel.pb.cs.

◆ SolutionFieldNumber

const int SolutionFieldNumber = 2
static

Field number for the "solution" field.

Definition at line 6064 of file CpModel.pb.cs.

◆ SolutionInfoFieldNumber

const int SolutionInfoFieldNumber = 20
static

Field number for the "solution_info" field.

Definition at line 6311 of file CpModel.pb.cs.

◆ SolutionLowerBoundsFieldNumber

const int SolutionLowerBoundsFieldNumber = 18
static

Field number for the "solution_lower_bounds" field.

Definition at line 6113 of file CpModel.pb.cs.

◆ SolutionUpperBoundsFieldNumber

const int SolutionUpperBoundsFieldNumber = 19
static

Field number for the "solution_upper_bounds" field.

Definition at line 6132 of file CpModel.pb.cs.

◆ StatusFieldNumber

const int StatusFieldNumber = 1
static

Field number for the "status" field.

Definition at line 6050 of file CpModel.pb.cs.

◆ SufficientAssumptionsForInfeasibilityFieldNumber

const int SufficientAssumptionsForInfeasibilityFieldNumber = 23
static

Field number for the "sufficient_assumptions_for_infeasibility" field.

Definition at line 6166 of file CpModel.pb.cs.

◆ TightenedVariablesFieldNumber

const int TightenedVariablesFieldNumber = 21
static

Field number for the "tightened_variables" field.

Definition at line 6142 of file CpModel.pb.cs.

◆ UserTimeFieldNumber

const int UserTimeFieldNumber = 16
static

Field number for the "user_time" field.

Definition at line 6278 of file CpModel.pb.cs.

◆ WallTimeFieldNumber

const int WallTimeFieldNumber = 15
static

Field number for the "wall_time" field.

Definition at line 6267 of file CpModel.pb.cs.

Property Documentation

◆ AllSolutionsWereFound

bool AllSolutionsWereFound
getset

This will be true iff the solver was asked to find all solutions to a satisfiability problem (or all optimal solutions to an optimization problem), and it was successful in doing so.

TODO(user): Remove as we also use the OPTIMAL vs FEASIBLE status for that.

Definition at line 6201 of file CpModel.pb.cs.

◆ BestObjectiveBound

double BestObjectiveBound
getset

Only make sense for an optimization problem.

A proven lower-bound on the objective for a minimization problem, or a proven upper-bound for a maximization problem.

Definition at line 6105 of file CpModel.pb.cs.

◆ Descriptor

pbr.MessageDescriptor Descriptor
staticget

Definition at line 6004 of file CpModel.pb.cs.

◆ DeterministicTime

double DeterministicTime
getset

Definition at line 6292 of file CpModel.pb.cs.

◆ NumBinaryPropagations

long NumBinaryPropagations
getset

Definition at line 6248 of file CpModel.pb.cs.

◆ NumBooleans

long NumBooleans
getset

Some statistics about the solve.

Definition at line 6215 of file CpModel.pb.cs.

◆ NumBranches

long NumBranches
getset

Definition at line 6237 of file CpModel.pb.cs.

◆ NumConflicts

long NumConflicts
getset

Definition at line 6226 of file CpModel.pb.cs.

◆ NumIntegerPropagations

long NumIntegerPropagations
getset

Definition at line 6259 of file CpModel.pb.cs.

◆ ObjectiveValue

double ObjectiveValue
getset

Only make sense for an optimization problem.

The objective value of the returned solution if it is non-empty. If there is no solution, then for a minimization problem, this will be an upper-bound of the objective of any feasible solution, and a lower-bound for a maximization problem.

Definition at line 6089 of file CpModel.pb.cs.

◆ Parser

pb.MessageParser<CpSolverResponse> Parser
staticget

Definition at line 6001 of file CpModel.pb.cs.

◆ PrimalIntegral

double PrimalIntegral
getset

Definition at line 6303 of file CpModel.pb.cs.

◆ Solution

pbc.RepeatedField<long> Solution
get

A feasible solution to the given problem.

Depending on the returned status it may be optimal or just feasible. This is in one-to-one correspondence with a CpModelProto::variables repeated field and list the values of all the variables.

Definition at line 6075 of file CpModel.pb.cs.

◆ SolutionInfo

string SolutionInfo
getset

Additional information about how the solution was found.

Definition at line 6317 of file CpModel.pb.cs.

◆ SolutionLowerBounds

pbc.RepeatedField<long> SolutionLowerBounds
get

Advanced usage.

If the problem has some variables that are not fixed at the end of the search (because of a particular search strategy in the CpModelProto) then this will be used instead of filling the solution above. The two fields will then contains the lower and upper bounds of each variable as they were when the best "solution" was found.

Definition at line 6127 of file CpModel.pb.cs.

◆ SolutionUpperBounds

pbc.RepeatedField<long> SolutionUpperBounds
get

Definition at line 6137 of file CpModel.pb.cs.

◆ Status

global.Google.OrTools.Sat.CpSolverStatus Status
getset

The status of the solve.

Definition at line 6056 of file CpModel.pb.cs.

◆ SufficientAssumptionsForInfeasibility

pbc.RepeatedField<int> SufficientAssumptionsForInfeasibility
get

A subset of the model "assumptions" field.

This will only be filled if the status is INFEASIBLE. This subset of assumption will be enough to still get an infeasible problem.

This is related to what is called the irreducible inconsistent subsystem or IIS. Except one is only concerned by the provided assumptions. There is also no guarantee that we return an irreducible (aka minimal subset). However, this is based on SAT explanation and there is a good chance it is not too large.

If you really want a minimal subset, a possible way to get one is by changing your model to minimize the number of assumptions at false, but this is likely an harder problem to solve.

Definition at line 6186 of file CpModel.pb.cs.

◆ TightenedVariables

pbc.RepeatedField<global.Google.OrTools.Sat.IntegerVariableProto> TightenedVariables
get

Advanced usage.

If the option fill_tightened_domains_in_response is set, then this field will be a copy of the CpModelProto.variables where each domain has been reduced using the information the solver was able to derive. Note that this is only filled with the info derived during a normal search and we do not have any dedicated algorithm to improve it.

If the problem is a feasibility problem, then these bounds will be valid for any feasible solution. If the problem is an optimization problem, then these bounds will only be valid for any OPTIMAL solutions, it can exclude sub-optimal feasible ones.

Definition at line 6161 of file CpModel.pb.cs.

◆ UserTime

double UserTime
getset

Definition at line 6281 of file CpModel.pb.cs.

◆ WallTime

double WallTime
getset

Definition at line 6270 of file CpModel.pb.cs.


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