DotNet Reference

DotNet Reference

CpModelProto

Detailed Description

A constraint programming problem.

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

Public Member Functions

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

Static Public Attributes

const int NameFieldNumber = 1
 Field number for the "name" field. More...
 
const int VariablesFieldNumber = 2
 Field number for the "variables" field. More...
 
const int ConstraintsFieldNumber = 3
 Field number for the "constraints" field. More...
 
const int ObjectiveFieldNumber = 4
 Field number for the "objective" field. More...
 
const int SearchStrategyFieldNumber = 5
 Field number for the "search_strategy" field. More...
 
const int SolutionHintFieldNumber = 6
 Field number for the "solution_hint" field. More...
 
const int AssumptionsFieldNumber = 7
 Field number for the "assumptions" field. More...
 

Properties

static pb::MessageParser< CpModelProtoParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
string Name [get, set]
 For debug/logging only. More...
 
pbc::RepeatedField< global::Google.OrTools.Sat.IntegerVariableProto > Variables [get]
 The associated Protos should be referred by their index in these fields. More...
 
pbc::RepeatedField< global::Google.OrTools.Sat.ConstraintProto > Constraints [get]
 
global::Google.OrTools.Sat.CpObjectiveProto Objective [get, set]
 The objective to minimize. More...
 
pbc::RepeatedField< global::Google.OrTools.Sat.DecisionStrategyProto > SearchStrategy [get]
 Defines the strategy that the solver should follow when the search_branching parameter is set to FIXED_SEARCH. More...
 
global::Google.OrTools.Sat.PartialVariableAssignment SolutionHint [get, set]
 Solution hint. More...
 
pbc::RepeatedField< int > Assumptions [get]
 A list of literals. More...
 

Constructor & Destructor Documentation

◆ CpModelProto() [1/2]

CpModelProto ( )
inline

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

◆ CpModelProto() [2/2]

CpModelProto ( CpModelProto  other)
inline

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

Member Function Documentation

◆ CalculateSize()

int CalculateSize ( )
inline

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

◆ Clone()

CpModelProto Clone ( )
inline

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

◆ Equals() [1/2]

bool Equals ( CpModelProto  other)
inline

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

◆ Equals() [2/2]

override bool Equals ( object  other)
inline

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

◆ GetHashCode()

override int GetHashCode ( )
inline

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

◆ MergeFrom() [1/2]

void MergeFrom ( CpModelProto  other)
inline

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

◆ MergeFrom() [2/2]

void MergeFrom ( pb::CodedInputStream  input)
inline

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

◆ ToString()

override string ToString ( )
inline

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

◆ WriteTo()

void WriteTo ( pb::CodedOutputStream  output)
inline

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

Member Data Documentation

◆ AssumptionsFieldNumber

const int AssumptionsFieldNumber = 7
static

Field number for the "assumptions" field.

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

◆ ConstraintsFieldNumber

const int ConstraintsFieldNumber = 3
static

Field number for the "constraints" field.

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

◆ NameFieldNumber

const int NameFieldNumber = 1
static

Field number for the "name" field.

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

◆ ObjectiveFieldNumber

const int ObjectiveFieldNumber = 4
static

Field number for the "objective" field.

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

◆ SearchStrategyFieldNumber

const int SearchStrategyFieldNumber = 5
static

Field number for the "search_strategy" field.

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

◆ SolutionHintFieldNumber

const int SolutionHintFieldNumber = 6
static

Field number for the "solution_hint" field.

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

◆ VariablesFieldNumber

const int VariablesFieldNumber = 2
static

Field number for the "variables" field.

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

Property Documentation

◆ Assumptions

pbc.RepeatedField<int> Assumptions
get

A list of literals.

The model will be solved assuming all these literals are true. Compared to just fixing the domain of these literals, using this mechanism is slower but allows in case the model is INFEASIBLE to get a potentially small subset of them that can be used to explain the infeasibility.

Think (IIS), except when you are only concerned by the provided assumptions. This is powerful as it allows to group a set of logicially related constraint under only one enforcement literal which can potentially give you a good and interpretable explanation for infeasiblity.

Such infeasibility explanation will be available in the sufficient_assumptions_for_infeasibility response field.

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

◆ Constraints

pbc.RepeatedField<global.Google.OrTools.Sat.ConstraintProto> Constraints
get

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

◆ Descriptor

pbr.MessageDescriptor Descriptor
staticget

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

◆ Name

string Name
getset

For debug/logging only.

Can be empty.

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

◆ Objective

global.Google.OrTools.Sat.CpObjectiveProto Objective
getset

The objective to minimize.

Can be empty for pure decision problems.

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

◆ Parser

pb.MessageParser<CpModelProto> Parser
staticget

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

◆ SearchStrategy

pbc.RepeatedField<global.Google.OrTools.Sat.DecisionStrategyProto> SearchStrategy
get

Defines the strategy that the solver should follow when the search_branching parameter is set to FIXED_SEARCH.

Note that this strategy is also used as a heuristic when we are not in fixed search.

Advanced Usage: if not all variables appears and the parameter "instantiate_all_variables" is set to false, then the solver will not try to instantiate the variables that do not appear. Thus, at the end of the search, not all variables may be fixed and this is why we have the solution_lower_bounds and solution_upper_bounds fields in the CpSolverResponse.

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

◆ SolutionHint

global.Google.OrTools.Sat.PartialVariableAssignment SolutionHint
getset

Solution hint.

If a feasible or almost-feasible solution to the problem is already known, it may be helpful to pass it to the solver so that it can be used. The solver will try to use this information to create its initial feasible solution.

Note that it may not always be faster to give a hint like this to the solver. There is also no guarantee that the solver will use this hint or try to return a solution "close" to this assignment in case of multiple optimal solutions.

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

◆ Variables

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

The associated Protos should be referred by their index in these fields.

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


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