Package com.google.ortools.sat
Interface CpModelProtoOrBuilder
-
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
CpModelProto,CpModelProto.Builder
public interface CpModelProtoOrBuilder extends com.google.protobuf.MessageOrBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetAssumptions(int index)A list of literals.intgetAssumptionsCount()A list of literals.java.util.List<java.lang.Integer>getAssumptionsList()A list of literals.ConstraintProtogetConstraints(int index)repeated .operations_research.sat.ConstraintProto constraints = 3;intgetConstraintsCount()repeated .operations_research.sat.ConstraintProto constraints = 3;java.util.List<ConstraintProto>getConstraintsList()repeated .operations_research.sat.ConstraintProto constraints = 3;ConstraintProtoOrBuildergetConstraintsOrBuilder(int index)repeated .operations_research.sat.ConstraintProto constraints = 3;java.util.List<? extends ConstraintProtoOrBuilder>getConstraintsOrBuilderList()repeated .operations_research.sat.ConstraintProto constraints = 3;FloatObjectiveProtogetFloatingPointObjective()Advanced usage.FloatObjectiveProtoOrBuildergetFloatingPointObjectiveOrBuilder()Advanced usage.java.lang.StringgetName()For debug/logging only.com.google.protobuf.ByteStringgetNameBytes()For debug/logging only.CpObjectiveProtogetObjective()The objective to minimize.CpObjectiveProtoOrBuildergetObjectiveOrBuilder()The objective to minimize.DecisionStrategyProtogetSearchStrategy(int index)Defines the strategy that the solver should follow when the search_branching parameter is set to FIXED_SEARCH.intgetSearchStrategyCount()Defines the strategy that the solver should follow when the search_branching parameter is set to FIXED_SEARCH.java.util.List<DecisionStrategyProto>getSearchStrategyList()Defines the strategy that the solver should follow when the search_branching parameter is set to FIXED_SEARCH.DecisionStrategyProtoOrBuildergetSearchStrategyOrBuilder(int index)Defines the strategy that the solver should follow when the search_branching parameter is set to FIXED_SEARCH.java.util.List<? extends DecisionStrategyProtoOrBuilder>getSearchStrategyOrBuilderList()Defines the strategy that the solver should follow when the search_branching parameter is set to FIXED_SEARCH.PartialVariableAssignmentgetSolutionHint()Solution hint.PartialVariableAssignmentOrBuildergetSolutionHintOrBuilder()Solution hint.SymmetryProtogetSymmetry()For now, this is not meant to be filled by a client writing a model, but by our preprocessing step.SymmetryProtoOrBuildergetSymmetryOrBuilder()For now, this is not meant to be filled by a client writing a model, but by our preprocessing step.IntegerVariableProtogetVariables(int index)The associated Protos should be referred by their index in these fields.intgetVariablesCount()The associated Protos should be referred by their index in these fields.java.util.List<IntegerVariableProto>getVariablesList()The associated Protos should be referred by their index in these fields.IntegerVariableProtoOrBuildergetVariablesOrBuilder(int index)The associated Protos should be referred by their index in these fields.java.util.List<? extends IntegerVariableProtoOrBuilder>getVariablesOrBuilderList()The associated Protos should be referred by their index in these fields.booleanhasFloatingPointObjective()Advanced usage.booleanhasObjective()The objective to minimize.booleanhasSolutionHint()Solution hint.booleanhasSymmetry()For now, this is not meant to be filled by a client writing a model, but by our preprocessing step.-
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
For debug/logging only. Can be empty.
string name = 1;- Returns:
- The name.
-
getNameBytes
com.google.protobuf.ByteString getNameBytes()
For debug/logging only. Can be empty.
string name = 1;- Returns:
- The bytes for name.
-
getVariablesList
java.util.List<IntegerVariableProto> getVariablesList()
The associated Protos should be referred by their index in these fields.
repeated .operations_research.sat.IntegerVariableProto variables = 2;
-
getVariables
IntegerVariableProto getVariables(int index)
The associated Protos should be referred by their index in these fields.
repeated .operations_research.sat.IntegerVariableProto variables = 2;
-
getVariablesCount
int getVariablesCount()
The associated Protos should be referred by their index in these fields.
repeated .operations_research.sat.IntegerVariableProto variables = 2;
-
getVariablesOrBuilderList
java.util.List<? extends IntegerVariableProtoOrBuilder> getVariablesOrBuilderList()
The associated Protos should be referred by their index in these fields.
repeated .operations_research.sat.IntegerVariableProto variables = 2;
-
getVariablesOrBuilder
IntegerVariableProtoOrBuilder getVariablesOrBuilder(int index)
The associated Protos should be referred by their index in these fields.
repeated .operations_research.sat.IntegerVariableProto variables = 2;
-
getConstraintsList
java.util.List<ConstraintProto> getConstraintsList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
-
getConstraints
ConstraintProto getConstraints(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
-
getConstraintsCount
int getConstraintsCount()
repeated .operations_research.sat.ConstraintProto constraints = 3;
-
getConstraintsOrBuilderList
java.util.List<? extends ConstraintProtoOrBuilder> getConstraintsOrBuilderList()
repeated .operations_research.sat.ConstraintProto constraints = 3;
-
getConstraintsOrBuilder
ConstraintProtoOrBuilder getConstraintsOrBuilder(int index)
repeated .operations_research.sat.ConstraintProto constraints = 3;
-
hasObjective
boolean 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.
-
getObjective
CpObjectiveProto getObjective()
The objective to minimize. Can be empty for pure decision problems.
.operations_research.sat.CpObjectiveProto objective = 4;- Returns:
- The objective.
-
getObjectiveOrBuilder
CpObjectiveProtoOrBuilder getObjectiveOrBuilder()
The objective to minimize. Can be empty for pure decision problems.
.operations_research.sat.CpObjectiveProto objective = 4;
-
hasFloatingPointObjective
boolean 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.
-
getFloatingPointObjective
FloatObjectiveProto 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.
-
getFloatingPointObjectiveOrBuilder
FloatObjectiveProtoOrBuilder 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;
-
getSearchStrategyList
java.util.List<DecisionStrategyProto> 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;
-
getSearchStrategy
DecisionStrategyProto 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;
-
getSearchStrategyCount
int 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;
-
getSearchStrategyOrBuilderList
java.util.List<? extends DecisionStrategyProtoOrBuilder> 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;
-
getSearchStrategyOrBuilder
DecisionStrategyProtoOrBuilder 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;
-
hasSolutionHint
boolean 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.
-
getSolutionHint
PartialVariableAssignment 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.
-
getSolutionHintOrBuilder
PartialVariableAssignmentOrBuilder 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;
-
getAssumptionsList
java.util.List<java.lang.Integer> 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.
-
getAssumptionsCount
int 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.
-
getAssumptions
int 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:
index- The index of the element to return.- Returns:
- The assumptions at the given index.
-
hasSymmetry
boolean 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.
-
getSymmetry
SymmetryProto 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.
-
getSymmetryOrBuilder
SymmetryProtoOrBuilder 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;
-
-