Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::ModelParser Class Reference

Model Parser. More...

#include <constraint_solveri.h>

Inheritance diagram for operations_research::ModelParser:
operations_research::ModelVisitor operations_research::BaseObject

Public Member Functions

 ModelParser ()
 -------— ModelParser ------—
 
 ~ModelParser () override
 
void BeginVisitModel (const std::string &solver_name) override
 Header/footers.
 
void EndVisitModel (const std::string &solver_name) override
 
void BeginVisitConstraint (const std::string &type_name, const Constraint *constraint) override
 
void EndVisitConstraint (const std::string &type_name, const Constraint *constraint) override
 
void BeginVisitIntegerExpression (const std::string &type_name, const IntExpr *expr) override
 
void EndVisitIntegerExpression (const std::string &type_name, const IntExpr *expr) override
 
void VisitIntegerVariable (const IntVar *variable, IntExpr *delegate) override
 
void VisitIntegerVariable (const IntVar *variable, const std::string &operation, int64_t value, IntVar *delegate) override
 
void VisitIntervalVariable (const IntervalVar *variable, const std::string &operation, int64_t value, IntervalVar *delegate) override
 
void VisitSequenceVariable (const SequenceVar *variable) override
 
void VisitIntegerArgument (const std::string &arg_name, int64_t value) override
 Integer arguments.
 
void VisitIntegerArrayArgument (const std::string &arg_name, const std::vector< int64_t > &values) override
 
void VisitIntegerMatrixArgument (const std::string &arg_name, const IntTupleSet &values) override
 
void VisitIntegerExpressionArgument (const std::string &arg_name, IntExpr *argument) override
 Variables.
 
void VisitIntegerVariableArrayArgument (const std::string &arg_name, const std::vector< IntVar * > &arguments) override
 
void VisitIntervalArgument (const std::string &arg_name, IntervalVar *argument) override
 Visit interval argument.
 
void VisitIntervalArrayArgument (const std::string &arg_name, const std::vector< IntervalVar * > &arguments) override
 
void VisitSequenceArgument (const std::string &arg_name, SequenceVar *argument) override
 Visit sequence argument.
 
void VisitSequenceArrayArgument (const std::string &arg_name, const std::vector< SequenceVar * > &arguments) override
 
- Public Member Functions inherited from operations_research::ModelVisitor
 ~ModelVisitor () override
 Methods.
 
virtual void BeginVisitExtension (const std::string &type)
 
virtual void EndVisitExtension (const std::string &type)
 
virtual void VisitIntegerVariableEvaluatorArgument (const std::string &arg_name, const Solver::Int64ToIntVar &arguments)
 Helpers.
 
void VisitInt64ToBoolExtension (Solver::IndexFilter1 filter, int64_t index_min, int64_t index_max)
 --— Helpers --—
 
void VisitInt64ToInt64Extension (const Solver::IndexEvaluator1 &eval, int64_t index_min, int64_t index_max)
 
void VisitInt64ToInt64AsArray (const Solver::IndexEvaluator1 &eval, const std::string &arg_name, int64_t index_max)
 Expands function as array when index min is 0.
 
- Public Member Functions inherited from operations_research::BaseObject
 BaseObject ()
 
 BaseObject (const BaseObject &)=delete
 This type is neither copyable nor movable.
 
BaseObjectoperator= (const BaseObject &)=delete
 
virtual ~BaseObject ()
 
virtual std::string DebugString () const
 

Protected Member Functions

void PushArgumentHolder ()
 
void PopArgumentHolder ()
 
ArgumentHolderTop () const
 

Additional Inherited Members

- Static Public Attributes inherited from operations_research::ModelVisitor
static const char kAbs [] = "Abs"
 Constraint and Expression types.
 
static const char kAbsEqual [] = "AbsEqual"
 
static const char kAllDifferent [] = "AllDifferent"
 
static const char kAllowedAssignments [] = "AllowedAssignments"
 
static const char kAtMost [] = "AtMost"
 
static const char kIndexOf [] = "IndexOf"
 
static const char kBetween [] = "Between"
 
static const char kConditionalExpr [] = "ConditionalExpr"
 
static const char kCircuit [] = "Circuit"
 
static const char kConvexPiecewise [] = "ConvexPiecewise"
 
static const char kCountEqual [] = "CountEqual"
 
static const char kCover [] = "Cover"
 
static const char kCumulative [] = "Cumulative"
 
static const char kDeviation [] = "Deviation"
 
static const char kDifference [] = "Difference"
 
static const char kDisjunctive [] = "Disjunctive"
 
static const char kDistribute [] = "Distribute"
 
static const char kDivide [] = "Divide"
 
static const char kDurationExpr [] = "DurationExpression"
 
static const char kElement [] = "Element"
 
static const char kLightElementEqual [] = "LightElementEqual"
 
static const char kElementEqual [] = "ElementEqual"
 
static const char kEndExpr [] = "EndExpression"
 
static const char kEquality [] = "Equal"
 
static const char kFalseConstraint [] = "FalseConstraint"
 
static const char kGlobalCardinality [] = "GlobalCardinality"
 
static const char kGreater [] = "Greater"
 
static const char kGreaterOrEqual [] = "GreaterOrEqual"
 
static const char kIntegerVariable [] = "IntegerVariable"
 
static const char kIntervalBinaryRelation [] = "IntervalBinaryRelation"
 
static const char kIntervalDisjunction [] = "IntervalDisjunction"
 
static const char kIntervalUnaryRelation [] = "IntervalUnaryRelation"
 
static const char kIntervalVariable [] = "IntervalVariable"
 
static const char kInversePermutation [] = "InversePermutation"
 
static const char kIsBetween [] = "IsBetween;"
 
static const char kIsDifferent [] = "IsDifferent"
 
static const char kIsEqual [] = "IsEqual"
 
static const char kIsGreater [] = "IsGreater"
 
static const char kIsGreaterOrEqual [] = "IsGreaterOrEqual"
 
static const char kIsLess [] = "IsLess"
 
static const char kIsLessOrEqual [] = "IsLessOrEqual"
 
static const char kIsMember [] = "IsMember;"
 
static const char kLess [] = "Less"
 
static const char kLessOrEqual [] = "LessOrEqual"
 
static const char kLexLess [] = "LexLess"
 
static const char kLinkExprVar [] = "CastExpressionIntoVariable"
 
static const char kMapDomain [] = "MapDomain"
 
static const char kMax [] = "Max"
 
static const char kMaxEqual [] = "MaxEqual"
 
static const char kMember [] = "Member"
 
static const char kMin [] = "Min"
 
static const char kMinEqual [] = "MinEqual"
 
static const char kModulo [] = "Modulo"
 
static const char kNoCycle [] = "NoCycle"
 
static const char kNonEqual [] = "NonEqual"
 
static const char kNotBetween [] = "NotBetween"
 
static const char kNotMember [] = "NotMember"
 
static const char kNullIntersect [] = "NullIntersect"
 
static const char kOpposite [] = "Opposite"
 
static const char kPack [] = "Pack"
 
static const char kPathCumul [] = "PathCumul"
 
static const char kDelayedPathCumul [] = "DelayedPathCumul"
 
static const char kPerformedExpr [] = "PerformedExpression"
 
static const char kPower [] = "Power"
 
static const char kProduct [] = "Product"
 
static const char kScalProd [] = "ScalarProduct"
 
static const char kScalProdEqual [] = "ScalarProductEqual"
 
static const char kScalProdGreaterOrEqual []
 
static const char kScalProdLessOrEqual [] = "ScalarProductLessOrEqual"
 
static const char kSemiContinuous [] = "SemiContinuous"
 
static const char kSequenceVariable [] = "SequenceVariable"
 
static const char kSortingConstraint [] = "SortingConstraint"
 
static const char kSquare [] = "Square"
 
static const char kStartExpr [] = "StartExpression"
 
static const char kSum [] = "Sum"
 
static const char kSumEqual [] = "SumEqual"
 
static const char kSumGreaterOrEqual [] = "SumGreaterOrEqual"
 
static const char kSumLessOrEqual [] = "SumLessOrEqual"
 
static const char kTrace [] = "Trace"
 
static const char kTransition [] = "Transition"
 
static const char kTrueConstraint [] = "TrueConstraint"
 
static const char kVarBoundWatcher [] = "VarBoundWatcher"
 
static const char kVarValueWatcher [] = "VarValueWatcher"
 
static const char kCountAssignedItemsExtension [] = "CountAssignedItems"
 Extension names:
 
static const char kCountUsedBinsExtension [] = "CountUsedBins"
 
static const char kInt64ToBoolExtension [] = "Int64ToBoolFunction"
 
static const char kInt64ToInt64Extension [] = "Int64ToInt64Function"
 
static const char kObjectiveExtension [] = "Objective"
 
static const char kSearchLimitExtension [] = "SearchLimit"
 
static const char kUsageEqualVariableExtension [] = "UsageEqualVariable"
 
static const char kUsageLessConstantExtension [] = "UsageLessConstant"
 
static const char kVariableGroupExtension [] = "VariableGroup"
 
static const char kVariableUsageLessConstantExtension []
 
static const char kWeightedSumOfAssignedEqualVariableExtension []
 
static const char kActiveArgument [] = "active"
 argument names:
 
static const char kAssumePathsArgument [] = "assume_paths"
 
static const char kBranchesLimitArgument [] = "branches_limit"
 
static const char kCapacityArgument [] = "capacity"
 
static const char kCardsArgument [] = "cardinalities"
 
static const char kCoefficientsArgument [] = "coefficients"
 
static const char kCountArgument [] = "count"
 
static const char kCumulativeArgument [] = "cumulative"
 
static const char kCumulsArgument [] = "cumuls"
 
static const char kDemandsArgument [] = "demands"
 
static const char kDurationMaxArgument [] = "duration_max"
 
static const char kDurationMinArgument [] = "duration_min"
 
static const char kEarlyCostArgument [] = "early_cost"
 
static const char kEarlyDateArgument [] = "early_date"
 
static const char kEndMaxArgument [] = "end_max"
 
static const char kEndMinArgument [] = "end_min"
 
static const char kEndsArgument [] = "ends"
 
static const char kExpressionArgument [] = "expression"
 
static const char kFailuresLimitArgument [] = "failures_limit"
 
static const char kFinalStatesArgument [] = "final_states"
 
static const char kFixedChargeArgument [] = "fixed_charge"
 
static const char kIndex2Argument [] = "index2"
 
static const char kIndexArgument [] = "index"
 
static const char kInitialState [] = "initial_state"
 
static const char kIntervalArgument [] = "interval"
 
static const char kIntervalsArgument [] = "intervals"
 
static const char kLateCostArgument [] = "late_cost"
 
static const char kLateDateArgument [] = "late_date"
 
static const char kLeftArgument [] = "left"
 
static const char kMaxArgument [] = "max_value"
 
static const char kMaximizeArgument [] = "maximize"
 
static const char kMinArgument [] = "min_value"
 
static const char kModuloArgument [] = "modulo"
 
static const char kNextsArgument [] = "nexts"
 
static const char kOptionalArgument [] = "optional"
 
static const char kPartialArgument [] = "partial"
 
static const char kPositionXArgument [] = "position_x"
 
static const char kPositionYArgument [] = "position_y"
 
static const char kRangeArgument [] = "range"
 
static const char kRelationArgument [] = "relation"
 
static const char kRightArgument [] = "right"
 
static const char kSequenceArgument [] = "sequence"
 
static const char kSequencesArgument [] = "sequences"
 
static const char kSizeArgument [] = "size"
 
static const char kSizeXArgument [] = "size_x"
 
static const char kSizeYArgument [] = "size_y"
 
static const char kSmartTimeCheckArgument [] = "smart_time_check"
 
static const char kSolutionLimitArgument [] = "solutions_limit"
 
static const char kStartMaxArgument [] = "start_max"
 
static const char kStartMinArgument [] = "start_min"
 
static const char kStartsArgument [] = "starts"
 
static const char kStepArgument [] = "step"
 
static const char kTargetArgument [] = "target_variable"
 
static const char kTimeLimitArgument [] = "time_limit"
 
static const char kTransitsArgument [] = "transits"
 
static const char kTuplesArgument [] = "tuples"
 
static const char kValueArgument [] = "value"
 
static const char kValuesArgument [] = "values"
 
static const char kVariableArgument [] = "variable"
 
static const char kVarsArgument [] = "variables"
 
static const char kEvaluatorArgument [] = "evaluator"
 
static const char kMirrorOperation [] = "mirror"
 Operations.
 
static const char kRelaxedMaxOperation [] = "relaxed_max"
 
static const char kRelaxedMinOperation [] = "relaxed_min"
 
static const char kSumOperation [] = "sum"
 
static const char kDifferenceOperation [] = "difference"
 
static const char kProductOperation [] = "product"
 
static const char kStartSyncOnStartOperation [] = "start_synced_on_start"
 
static const char kStartSyncOnEndOperation [] = "start_synced_on_end"
 
static const char kTraceOperation [] = "trace"
 

Detailed Description

Model Parser.

Definition at line 2715 of file constraint_solveri.h.

Constructor & Destructor Documentation

◆ ModelParser()

operations_research::ModelParser::ModelParser ( )

-------— ModelParser ------—

Definition at line 126 of file visitor.cc.

◆ ~ModelParser()

operations_research::ModelParser::~ModelParser ( )
override

Definition at line 128 of file visitor.cc.

Member Function Documentation

◆ BeginVisitConstraint()

void operations_research::ModelParser::BeginVisitConstraint ( const std::string & type_name,
const Constraint * constraint )
overridevirtual

Reimplemented from operations_research::ModelVisitor.

Definition at line 138 of file visitor.cc.

◆ BeginVisitIntegerExpression()

void operations_research::ModelParser::BeginVisitIntegerExpression ( const std::string & type_name,
const IntExpr * expr )
overridevirtual

Reimplemented from operations_research::ModelVisitor.

Definition at line 149 of file visitor.cc.

◆ BeginVisitModel()

void operations_research::ModelParser::BeginVisitModel ( const std::string & solver_name)
overridevirtual

Header/footers.

Reimplemented from operations_research::ModelVisitor.

Definition at line 130 of file visitor.cc.

◆ EndVisitConstraint()

void operations_research::ModelParser::EndVisitConstraint ( const std::string & type_name,
const Constraint * constraint )
overridevirtual

Constraint parsing is usually done here.

Reimplemented from operations_research::ModelVisitor.

Definition at line 143 of file visitor.cc.

◆ EndVisitIntegerExpression()

void operations_research::ModelParser::EndVisitIntegerExpression ( const std::string & type_name,
const IntExpr * expr )
overridevirtual

Expression parsing is usually done here.

Reimplemented from operations_research::ModelVisitor.

Definition at line 154 of file visitor.cc.

◆ EndVisitModel()

void operations_research::ModelParser::EndVisitModel ( const std::string & solver_name)
overridevirtual

Reimplemented from operations_research::ModelVisitor.

Definition at line 134 of file visitor.cc.

◆ PopArgumentHolder()

void operations_research::ModelParser::PopArgumentHolder ( )
protected

Definition at line 251 of file visitor.cc.

◆ PushArgumentHolder()

void operations_research::ModelParser::PushArgumentHolder ( )
protected

Definition at line 247 of file visitor.cc.

◆ Top()

ArgumentHolder * operations_research::ModelParser::Top ( ) const
protected

Definition at line 257 of file visitor.cc.

◆ VisitIntegerArgument()

void operations_research::ModelParser::VisitIntegerArgument ( const std::string & arg_name,
int64_t value )
overridevirtual

Integer arguments.

Reimplemented from operations_research::ModelVisitor.

Definition at line 187 of file visitor.cc.

◆ VisitIntegerArrayArgument()

void operations_research::ModelParser::VisitIntegerArrayArgument ( const std::string & arg_name,
const std::vector< int64_t > & values )
overridevirtual

Reimplemented from operations_research::ModelVisitor.

Definition at line 192 of file visitor.cc.

◆ VisitIntegerExpressionArgument()

void operations_research::ModelParser::VisitIntegerExpressionArgument ( const std::string & arg_name,
IntExpr * argument )
overridevirtual

Variables.

Reimplemented from operations_research::ModelVisitor.

Definition at line 203 of file visitor.cc.

◆ VisitIntegerMatrixArgument()

void operations_research::ModelParser::VisitIntegerMatrixArgument ( const std::string & arg_name,
const IntTupleSet & values )
overridevirtual

Reimplemented from operations_research::ModelVisitor.

Definition at line 197 of file visitor.cc.

◆ VisitIntegerVariable() [1/2]

void operations_research::ModelParser::VisitIntegerVariable ( const IntVar * variable,
const std::string & operation,
int64_t value,
IntVar * delegate )
overridevirtual

Usual place for parsing.

Reimplemented from operations_research::ModelVisitor.

Definition at line 165 of file visitor.cc.

◆ VisitIntegerVariable() [2/2]

void operations_research::ModelParser::VisitIntegerVariable ( const IntVar * variable,
IntExpr * delegate )
overridevirtual

Usual place for parsing.

Reimplemented from operations_research::ModelVisitor.

Definition at line 160 of file visitor.cc.

◆ VisitIntegerVariableArrayArgument()

void operations_research::ModelParser::VisitIntegerVariableArrayArgument ( const std::string & arg_name,
const std::vector< IntVar * > & arguments )
overridevirtual

Reimplemented from operations_research::ModelVisitor.

Definition at line 209 of file visitor.cc.

◆ VisitIntervalArgument()

void operations_research::ModelParser::VisitIntervalArgument ( const std::string & arg_name,
IntervalVar * argument )
overridevirtual

Visit interval argument.

Reimplemented from operations_research::ModelVisitor.

Definition at line 218 of file visitor.cc.

◆ VisitIntervalArrayArgument()

void operations_research::ModelParser::VisitIntervalArrayArgument ( const std::string & arg_name,
const std::vector< IntervalVar * > & arguments )
overridevirtual

Reimplemented from operations_research::ModelVisitor.

Definition at line 224 of file visitor.cc.

◆ VisitIntervalVariable()

void operations_research::ModelParser::VisitIntervalVariable ( const IntervalVar * variable,
const std::string & operation,
int64_t value,
IntervalVar * delegate )
overridevirtual

Usual place for parsing.

Reimplemented from operations_research::ModelVisitor.

Definition at line 172 of file visitor.cc.

◆ VisitSequenceArgument()

void operations_research::ModelParser::VisitSequenceArgument ( const std::string & arg_name,
SequenceVar * argument )
overridevirtual

Visit sequence argument.

Reimplemented from operations_research::ModelVisitor.

Definition at line 233 of file visitor.cc.

◆ VisitSequenceArrayArgument()

void operations_research::ModelParser::VisitSequenceArrayArgument ( const std::string & arg_name,
const std::vector< SequenceVar * > & arguments )
overridevirtual

Reimplemented from operations_research::ModelVisitor.

Definition at line 239 of file visitor.cc.

◆ VisitSequenceVariable()

void operations_research::ModelParser::VisitSequenceVariable ( const SequenceVar * variable)
overridevirtual

Usual place for parsing.

Reimplemented from operations_research::ModelVisitor.

Definition at line 182 of file visitor.cc.


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