Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.Sat.CpModelProto Class Referencesealed

A constraint programming problem. More...

Inheritance diagram for Google.OrTools.Sat.CpModelProto:

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.
 
const int VariablesFieldNumber = 2
 Field number for the "variables" field.
 
const int ConstraintsFieldNumber = 3
 Field number for the "constraints" field.
 
const int ObjectiveFieldNumber = 4
 Field number for the "objective" field.
 
const int FloatingPointObjectiveFieldNumber = 9
 Field number for the "floating_point_objective" field.
 
const int SearchStrategyFieldNumber = 5
 Field number for the "search_strategy" field.
 
const int SolutionHintFieldNumber = 6
 Field number for the "solution_hint" field.
 
const int AssumptionsFieldNumber = 7
 Field number for the "assumptions" field.
 
const int SymmetryFieldNumber = 8
 Field number for the "symmetry" field.
 

Properties

static pb::MessageParser< CpModelProtoParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
string Name [get, set]
 For debug/logging only. Can be empty.
 
pbc::RepeatedField< global::Google.OrTools.Sat.IntegerVariableProto > Variables [get]
 The associated Protos should be referred by their index in these fields.
 
pbc::RepeatedField< global::Google.OrTools.Sat.ConstraintProto > Constraints [get]
 
global::Google.OrTools.Sat.CpObjectiveProto Objective [get, set]
 The objective to minimize. Can be empty for pure decision problems.
 
global::Google.OrTools.Sat.FloatObjectiveProto FloatingPointObjective [get, set]
 Advanced usage. It is invalid to have both an objective and a floating point objective.
 
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.
 
global::Google.OrTools.Sat.PartialVariableAssignment SolutionHint [get, set]
 Solution hint.
 
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.
 
global::Google.OrTools.Sat.SymmetryProto Symmetry [get, set]
 For now, this is not meant to be filled by a client writing a model, but by our preprocessing step.
 

Detailed Description

A constraint programming problem.

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

Constructor & Destructor Documentation

◆ CpModelProto() [1/2]

Google.OrTools.Sat.CpModelProto.CpModelProto ( )
inline

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

◆ CpModelProto() [2/2]

Google.OrTools.Sat.CpModelProto.CpModelProto ( CpModelProto other)
inline

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

Member Function Documentation

◆ CalculateSize()

int Google.OrTools.Sat.CpModelProto.CalculateSize ( )
inline

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

◆ Clone()

CpModelProto Google.OrTools.Sat.CpModelProto.Clone ( )
inline

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

◆ Equals() [1/2]

bool Google.OrTools.Sat.CpModelProto.Equals ( CpModelProto other)
inline

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

◆ Equals() [2/2]

override bool Google.OrTools.Sat.CpModelProto.Equals ( object other)
inline

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

◆ GetHashCode()

override int Google.OrTools.Sat.CpModelProto.GetHashCode ( )
inline

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

◆ MergeFrom() [1/2]

void Google.OrTools.Sat.CpModelProto.MergeFrom ( CpModelProto other)
inline

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

◆ MergeFrom() [2/2]

void Google.OrTools.Sat.CpModelProto.MergeFrom ( pb::CodedInputStream input)
inline

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

◆ ToString()

override string Google.OrTools.Sat.CpModelProto.ToString ( )
inline

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

◆ WriteTo()

void Google.OrTools.Sat.CpModelProto.WriteTo ( pb::CodedOutputStream output)
inline

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

Member Data Documentation

◆ AssumptionsFieldNumber

const int Google.OrTools.Sat.CpModelProto.AssumptionsFieldNumber = 7
static

Field number for the "assumptions" field.

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

◆ ConstraintsFieldNumber

const int Google.OrTools.Sat.CpModelProto.ConstraintsFieldNumber = 3
static

Field number for the "constraints" field.

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

◆ FloatingPointObjectiveFieldNumber

const int Google.OrTools.Sat.CpModelProto.FloatingPointObjectiveFieldNumber = 9
static

Field number for the "floating_point_objective" field.

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

◆ NameFieldNumber

const int Google.OrTools.Sat.CpModelProto.NameFieldNumber = 1
static

Field number for the "name" field.

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

◆ ObjectiveFieldNumber

const int Google.OrTools.Sat.CpModelProto.ObjectiveFieldNumber = 4
static

Field number for the "objective" field.

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

◆ SearchStrategyFieldNumber

const int Google.OrTools.Sat.CpModelProto.SearchStrategyFieldNumber = 5
static

Field number for the "search_strategy" field.

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

◆ SolutionHintFieldNumber

const int Google.OrTools.Sat.CpModelProto.SolutionHintFieldNumber = 6
static

Field number for the "solution_hint" field.

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

◆ SymmetryFieldNumber

const int Google.OrTools.Sat.CpModelProto.SymmetryFieldNumber = 8
static

Field number for the "symmetry" field.

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

◆ VariablesFieldNumber

const int Google.OrTools.Sat.CpModelProto.VariablesFieldNumber = 2
static

Field number for the "variables" field.

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

Property Documentation

◆ Assumptions

pbc.RepeatedField<int> Google.OrTools.Sat.CpModelProto.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 logically 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 8669 of file CpModel.pb.cs.

◆ Constraints

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

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

◆ Descriptor

pbr.MessageDescriptor Google.OrTools.Sat.CpModelProto.Descriptor
staticget

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

◆ FloatingPointObjective

global.Google.OrTools.Sat.FloatObjectiveProto Google.OrTools.Sat.CpModelProto.FloatingPointObjective
getset

Advanced usage. It is invalid to have both an objective and a floating point objective.

The objective of the model, in floating point format. The solver will automatically scale this to integer during expansion and thus convert it to a normal CpObjectiveProto. See the mip* parameters to control how this is scaled. In most situation the precision will be good enough, but you can see the logs to see what are the precision guaranteed when this is converted to a fixed point representation.

Note
even if the precision is bad, the returned objective_value and best_objective_bound will be computed correctly. So at the end of the solve you can check the gap if you only want precise optimal.

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

◆ Name

string Google.OrTools.Sat.CpModelProto.Name
getset

For debug/logging only. Can be empty.

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

◆ Objective

global.Google.OrTools.Sat.CpObjectiveProto Google.OrTools.Sat.CpModelProto.Objective
getset

The objective to minimize. Can be empty for pure decision problems.

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

◆ Parser

pb.MessageParser<CpModelProto> Google.OrTools.Sat.CpModelProto.Parser
staticget

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

◆ SearchStrategy

pbc.RepeatedField<global.Google.OrTools.Sat.DecisionStrategyProto> Google.OrTools.Sat.CpModelProto.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. Currently, we will set them to their lower bound in the solution.

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

◆ SolutionHint

global.Google.OrTools.Sat.PartialVariableAssignment Google.OrTools.Sat.CpModelProto.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
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 8638 of file CpModel.pb.cs.

◆ Symmetry

global.Google.OrTools.Sat.SymmetryProto Google.OrTools.Sat.CpModelProto.Symmetry
getset

For now, this is not meant to be filled by a client writing a model, but by our preprocessing step.

Information about the symmetries of the feasible solution space. These usually leaves the objective invariant.

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

◆ Variables

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

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

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


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