DotNet Reference

.Net Reference

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: 27

Definition at line 8420 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 NumRestartsFieldNumber = 24
 Field number for the "num_restarts" field. More...
 
const int NumLpIterationsFieldNumber = 25
 Field number for the "num_lp_iterations" 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...
 
const int LogsFieldNumber = 26
 Field number for the "logs" 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]
 
long NumRestarts [get, set]
 
long NumLpIterations [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...
 
string Logs [get, set]
 Optional logs of the solver. More...
 

Constructor & Destructor Documentation

◆ CpSolverResponse() [1/2]

CpSolverResponse ( )
inline

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

◆ CpSolverResponse() [2/2]

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

Member Function Documentation

◆ CalculateSize()

int CalculateSize ( )
inline

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

◆ Clone()

CpSolverResponse Clone ( )
inline

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

◆ Equals() [1/2]

bool Equals ( CpSolverResponse  other)
inline

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

◆ Equals() [2/2]

override bool Equals ( object  other)
inline

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

◆ GetHashCode()

override int GetHashCode ( )
inline

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

◆ MergeFrom() [1/2]

void MergeFrom ( CpSolverResponse  other)
inline

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

◆ MergeFrom() [2/2]

void MergeFrom ( pb::CodedInputStream  input)
inline

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

◆ ToString()

override string ToString ( )
inline

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

◆ WriteTo()

void WriteTo ( pb::CodedOutputStream  output)
inline

Definition at line 8868 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 8623 of file CpModel.pb.cs.

◆ BestObjectiveBoundFieldNumber

const int BestObjectiveBoundFieldNumber = 4
static

Field number for the "best_objective_bound" field.

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

◆ DeterministicTimeFieldNumber

const int DeterministicTimeFieldNumber = 17
static

Field number for the "deterministic_time" field.

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

◆ LogsFieldNumber

const int LogsFieldNumber = 26
static

Field number for the "logs" field.

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

◆ NumBinaryPropagationsFieldNumber

const int NumBinaryPropagationsFieldNumber = 13
static

Field number for the "num_binary_propagations" field.

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

◆ NumBooleansFieldNumber

const int NumBooleansFieldNumber = 10
static

Field number for the "num_booleans" field.

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

◆ NumBranchesFieldNumber

const int NumBranchesFieldNumber = 12
static

Field number for the "num_branches" field.

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

◆ NumConflictsFieldNumber

const int NumConflictsFieldNumber = 11
static

Field number for the "num_conflicts" field.

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

◆ NumIntegerPropagationsFieldNumber

const int NumIntegerPropagationsFieldNumber = 14
static

Field number for the "num_integer_propagations" field.

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

◆ NumLpIterationsFieldNumber

const int NumLpIterationsFieldNumber = 25
static

Field number for the "num_lp_iterations" field.

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

◆ NumRestartsFieldNumber

const int NumRestartsFieldNumber = 24
static

Field number for the "num_restarts" field.

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

◆ ObjectiveValueFieldNumber

const int ObjectiveValueFieldNumber = 3
static

Field number for the "objective_value" field.

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

◆ PrimalIntegralFieldNumber

const int PrimalIntegralFieldNumber = 22
static

Field number for the "primal_integral" field.

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

◆ SolutionFieldNumber

const int SolutionFieldNumber = 2
static

Field number for the "solution" field.

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

◆ SolutionInfoFieldNumber

const int SolutionInfoFieldNumber = 20
static

Field number for the "solution_info" field.

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

◆ SolutionLowerBoundsFieldNumber

const int SolutionLowerBoundsFieldNumber = 18
static

Field number for the "solution_lower_bounds" field.

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

◆ SolutionUpperBoundsFieldNumber

const int SolutionUpperBoundsFieldNumber = 19
static

Field number for the "solution_upper_bounds" field.

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

◆ StatusFieldNumber

const int StatusFieldNumber = 1
static

Field number for the "status" field.

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

◆ SufficientAssumptionsForInfeasibilityFieldNumber

const int SufficientAssumptionsForInfeasibilityFieldNumber = 23
static

Field number for the "sufficient_assumptions_for_infeasibility" field.

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

◆ TightenedVariablesFieldNumber

const int TightenedVariablesFieldNumber = 21
static

Field number for the "tightened_variables" field.

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

◆ UserTimeFieldNumber

const int UserTimeFieldNumber = 16
static

Field number for the "user_time" field.

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

◆ WallTimeFieldNumber

const int WallTimeFieldNumber = 15
static

Field number for the "wall_time" field.

Definition at line 8721 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 8633 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 8535 of file CpModel.pb.cs.

◆ Descriptor

pbr.MessageDescriptor Descriptor
staticget

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

◆ DeterministicTime

double DeterministicTime
getset

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

◆ Logs

string Logs
getset

Optional logs of the solver.

They will be filled only if the parameter 'fill_logs_in_response' is set.

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

◆ NumBinaryPropagations

long NumBinaryPropagations
getset

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

◆ NumBooleans

long NumBooleans
getset

Some statistics about the solve.

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

◆ NumBranches

long NumBranches
getset

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

◆ NumConflicts

long NumConflicts
getset

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

◆ NumIntegerPropagations

long NumIntegerPropagations
getset

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

◆ NumLpIterations

long NumLpIterations
getset

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

◆ NumRestarts

long NumRestarts
getset

Definition at line 8702 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 8519 of file CpModel.pb.cs.

◆ Parser

pb.MessageParser<CpSolverResponse> Parser
staticget

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

◆ PrimalIntegral

double PrimalIntegral
getset

Definition at line 8757 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 8505 of file CpModel.pb.cs.

◆ SolutionInfo

string SolutionInfo
getset

Additional information about how the solution was found.

Definition at line 8771 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 8557 of file CpModel.pb.cs.

◆ SolutionUpperBounds

pbc.RepeatedField<long> SolutionUpperBounds
get

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

◆ Status

global.Google.OrTools.Sat.CpSolverStatus Status
getset

The status of the solve.

Definition at line 8486 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.

TODO(user): Allows for returning multiple core at once.

Definition at line 8618 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 8591 of file CpModel.pb.cs.

◆ UserTime

double UserTime
getset

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

◆ WallTime

double WallTime
getset

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


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