Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.sat.CpModelProtoOrBuilder Interface Reference
Inheritance diagram for com.google.ortools.sat.CpModelProtoOrBuilder:
com.google.ortools.sat.CpModelProto com.google.ortools.sat.CpModelProto.Builder

Public Member Functions

java.lang.String getName ()
 
com.google.protobuf.ByteString getNameBytes ()
 
java.util.List< com.google.ortools.sat.IntegerVariableProtogetVariablesList ()
 
com.google.ortools.sat.IntegerVariableProto getVariables (int index)
 
int getVariablesCount ()
 
java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuildergetVariablesOrBuilderList ()
 
com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder (int index)
 
java.util.List< com.google.ortools.sat.ConstraintProtogetConstraintsList ()
 
com.google.ortools.sat.ConstraintProto getConstraints (int index)
 
int getConstraintsCount ()
 
java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuildergetConstraintsOrBuilderList ()
 
com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder (int index)
 
boolean hasObjective ()
 
com.google.ortools.sat.CpObjectiveProto getObjective ()
 
com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder ()
 
boolean hasFloatingPointObjective ()
 
com.google.ortools.sat.FloatObjectiveProto getFloatingPointObjective ()
 
com.google.ortools.sat.FloatObjectiveProtoOrBuilder getFloatingPointObjectiveOrBuilder ()
 
java.util.List< com.google.ortools.sat.DecisionStrategyProtogetSearchStrategyList ()
 
com.google.ortools.sat.DecisionStrategyProto getSearchStrategy (int index)
 
int getSearchStrategyCount ()
 
java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuildergetSearchStrategyOrBuilderList ()
 
com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder (int index)
 
boolean hasSolutionHint ()
 
com.google.ortools.sat.PartialVariableAssignment getSolutionHint ()
 
com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder ()
 
java.util.List< java.lang.Integer > getAssumptionsList ()
 
int getAssumptionsCount ()
 
int getAssumptions (int index)
 
boolean hasSymmetry ()
 
com.google.ortools.sat.SymmetryProto getSymmetry ()
 
com.google.ortools.sat.SymmetryProtoOrBuilder getSymmetryOrBuilder ()
 

Detailed Description

Definition at line 7 of file CpModelProtoOrBuilder.java.

Member Function Documentation

◆ getAssumptions()

int com.google.ortools.sat.CpModelProtoOrBuilder.getAssumptions ( int index)
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.

repeated int32 assumptions = 7;

Parameters
indexThe index of the element to return.
Returns
The assumptions at the given index.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getAssumptionsCount()

int com.google.ortools.sat.CpModelProtoOrBuilder.getAssumptionsCount ( )
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.

repeated int32 assumptions = 7;

Returns
The count of assumptions.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getAssumptionsList()

java.util.List< java.lang.Integer > com.google.ortools.sat.CpModelProtoOrBuilder.getAssumptionsList ( )
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.

repeated int32 assumptions = 7;

Returns
A list containing the assumptions.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getConstraints()

com.google.ortools.sat.ConstraintProto com.google.ortools.sat.CpModelProtoOrBuilder.getConstraints ( int index)

repeated .operations_research.sat.ConstraintProto constraints = 3;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getConstraintsCount()

int com.google.ortools.sat.CpModelProtoOrBuilder.getConstraintsCount ( )

repeated .operations_research.sat.ConstraintProto constraints = 3;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getConstraintsList()

java.util.List< com.google.ortools.sat.ConstraintProto > com.google.ortools.sat.CpModelProtoOrBuilder.getConstraintsList ( )

repeated .operations_research.sat.ConstraintProto constraints = 3;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getConstraintsOrBuilder()

com.google.ortools.sat.ConstraintProtoOrBuilder com.google.ortools.sat.CpModelProtoOrBuilder.getConstraintsOrBuilder ( int index)

repeated .operations_research.sat.ConstraintProto constraints = 3;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getConstraintsOrBuilderList()

java.util.List<? extends com.google.ortools.sat.ConstraintProtoOrBuilder > com.google.ortools.sat.CpModelProtoOrBuilder.getConstraintsOrBuilderList ( )

repeated .operations_research.sat.ConstraintProto constraints = 3;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getFloatingPointObjective()

com.google.ortools.sat.FloatObjectiveProto com.google.ortools.sat.CpModelProtoOrBuilder.getFloatingPointObjective ( )
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 that 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.

.operations_research.sat.FloatObjectiveProto floating_point_objective = 9;

Returns
The floatingPointObjective.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getFloatingPointObjectiveOrBuilder()

com.google.ortools.sat.FloatObjectiveProtoOrBuilder com.google.ortools.sat.CpModelProtoOrBuilder.getFloatingPointObjectiveOrBuilder ( )
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 that 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.

.operations_research.sat.FloatObjectiveProto floating_point_objective = 9;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getName()

java.lang.String com.google.ortools.sat.CpModelProtoOrBuilder.getName ( )
For debug/logging only. Can be empty.

string name = 1;

Returns
The name.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getNameBytes()

com.google.protobuf.ByteString com.google.ortools.sat.CpModelProtoOrBuilder.getNameBytes ( )
For debug/logging only. Can be empty.

string name = 1;

Returns
The bytes for name.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getObjective()

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpModelProtoOrBuilder.getObjective ( )
The objective to minimize. Can be empty for pure decision problems.

.operations_research.sat.CpObjectiveProto objective = 4;

Returns
The objective.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getObjectiveOrBuilder()

com.google.ortools.sat.CpObjectiveProtoOrBuilder com.google.ortools.sat.CpModelProtoOrBuilder.getObjectiveOrBuilder ( )
The objective to minimize. Can be empty for pure decision problems.

.operations_research.sat.CpObjectiveProto objective = 4;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSearchStrategy()

com.google.ortools.sat.DecisionStrategyProto com.google.ortools.sat.CpModelProtoOrBuilder.getSearchStrategy ( int index)
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.

repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSearchStrategyCount()

int com.google.ortools.sat.CpModelProtoOrBuilder.getSearchStrategyCount ( )
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.

repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSearchStrategyList()

java.util.List< com.google.ortools.sat.DecisionStrategyProto > com.google.ortools.sat.CpModelProtoOrBuilder.getSearchStrategyList ( )
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.

repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSearchStrategyOrBuilder()

com.google.ortools.sat.DecisionStrategyProtoOrBuilder com.google.ortools.sat.CpModelProtoOrBuilder.getSearchStrategyOrBuilder ( int index)
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.

repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSearchStrategyOrBuilderList()

java.util.List<? extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder > com.google.ortools.sat.CpModelProtoOrBuilder.getSearchStrategyOrBuilderList ( )
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.

repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSolutionHint()

com.google.ortools.sat.PartialVariableAssignment com.google.ortools.sat.CpModelProtoOrBuilder.getSolutionHint ( )
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.

.operations_research.sat.PartialVariableAssignment solution_hint = 6;

Returns
The solutionHint.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSolutionHintOrBuilder()

com.google.ortools.sat.PartialVariableAssignmentOrBuilder com.google.ortools.sat.CpModelProtoOrBuilder.getSolutionHintOrBuilder ( )
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.

.operations_research.sat.PartialVariableAssignment solution_hint = 6;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSymmetry()

com.google.ortools.sat.SymmetryProto com.google.ortools.sat.CpModelProtoOrBuilder.getSymmetry ( )
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.

.operations_research.sat.SymmetryProto symmetry = 8;

Returns
The symmetry.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getSymmetryOrBuilder()

com.google.ortools.sat.SymmetryProtoOrBuilder com.google.ortools.sat.CpModelProtoOrBuilder.getSymmetryOrBuilder ( )
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.

.operations_research.sat.SymmetryProto symmetry = 8;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getVariables()

com.google.ortools.sat.IntegerVariableProto com.google.ortools.sat.CpModelProtoOrBuilder.getVariables ( int index)
The associated Protos should be referred by their index in these fields.

repeated .operations_research.sat.IntegerVariableProto variables = 2;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getVariablesCount()

int com.google.ortools.sat.CpModelProtoOrBuilder.getVariablesCount ( )
The associated Protos should be referred by their index in these fields.

repeated .operations_research.sat.IntegerVariableProto variables = 2;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getVariablesList()

java.util.List< com.google.ortools.sat.IntegerVariableProto > com.google.ortools.sat.CpModelProtoOrBuilder.getVariablesList ( )
The associated Protos should be referred by their index in these fields.

repeated .operations_research.sat.IntegerVariableProto variables = 2;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getVariablesOrBuilder()

com.google.ortools.sat.IntegerVariableProtoOrBuilder com.google.ortools.sat.CpModelProtoOrBuilder.getVariablesOrBuilder ( int index)
The associated Protos should be referred by their index in these fields.

repeated .operations_research.sat.IntegerVariableProto variables = 2;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ getVariablesOrBuilderList()

java.util.List<? extends com.google.ortools.sat.IntegerVariableProtoOrBuilder > com.google.ortools.sat.CpModelProtoOrBuilder.getVariablesOrBuilderList ( )
The associated Protos should be referred by their index in these fields.

repeated .operations_research.sat.IntegerVariableProto variables = 2;

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ hasFloatingPointObjective()

boolean com.google.ortools.sat.CpModelProtoOrBuilder.hasFloatingPointObjective ( )
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 that 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.

.operations_research.sat.FloatObjectiveProto floating_point_objective = 9;

Returns
Whether the floatingPointObjective field is set.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ hasObjective()

boolean com.google.ortools.sat.CpModelProtoOrBuilder.hasObjective ( )
The objective to minimize. Can be empty for pure decision problems.

.operations_research.sat.CpObjectiveProto objective = 4;

Returns
Whether the objective field is set.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ hasSolutionHint()

boolean com.google.ortools.sat.CpModelProtoOrBuilder.hasSolutionHint ( )
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.

.operations_research.sat.PartialVariableAssignment solution_hint = 6;

Returns
Whether the solutionHint field is set.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.

◆ hasSymmetry()

boolean com.google.ortools.sat.CpModelProtoOrBuilder.hasSymmetry ( )
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.

.operations_research.sat.SymmetryProto symmetry = 8;

Returns
Whether the symmetry field is set.

Implemented in com.google.ortools.sat.CpModelProto.Builder, and com.google.ortools.sat.CpModelProto.


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