Representation of a line in the optimize section, an objective being considered a constraint.
More...
|
| | FMTConstraint () |
| | Default constructor for FMTConstraint.
|
| |
| | FMTConstraint (FMTconstrainttype ltype, const FMTOutput &loutput) |
| | Partial constructor specifying the output and the constraint type.
|
| |
| | FMTConstraint (const FMTConstraint &rhs) |
| | Copy constructor for FMTConstraint.
|
| |
| FMTConstraint & | operator= (const FMTConstraint &rhs) |
| | Copy assignment operator for FMTConstraint.
|
| |
| bool | operator== (const FMTConstraint &rhs) const |
| | Equality comparison operator of FMTConstraint.
|
| |
| bool | operator!= (const FMTConstraint &rhs) const |
| | Inequality comparison operator of FMTConstraint.
|
| |
| bool | extraVariables () const |
| | Return true if the constraint needs extra variables in the matrix formulation.
|
| |
| bool | isGoal () const |
| | Return true if the constraint has a goal weight.
|
| |
| bool | isSetFrom (const std::string &modeltype) const |
| | Return true if the constraint needs to be set from a specific model.
|
| |
| bool | isReIgnore (const int &replanningperiod) const |
| | Return true if the constraint must be ignored from the replanning period.
|
| |
| bool | doSupportRandom () const |
| | Return true if the constraint has only one source based on action area and supports the _RANDOM keyword.
|
| |
| Core::FMTConstraint | setFrom (const std::string &modeltype, const double &value) const |
| | Return a new constraint set with the value of the given model type.
|
| |
| double | getScheduleWeight () const |
| | Return the global schedule weight of the objective for a local model.
|
| |
| Core::FMTConstraint | getFromReplicate (const size_t &replicate, const int &period) const |
| | Return a new constraint with the replicate value, if the constraint is built with a replicate table. See _REPLICATE.
|
| |
| void | setFromReplicate (size_t p_replicate, int p_period) |
| | If the constraint is build with a replicate tables it will gives a new constraint with the corresponding replicate value See keyword _REPLICATE in optimization seciton.
|
| |
| bool | gotReplicate (const int &p_period) const |
| | Check if the constraint contains a replicate.
|
| |
| std::vector< std::string > | getPenalties (double &sense) const |
| | Return the names of the penalties of the constraint if it is a goal, like _GOAL(penaltyname, weight).
|
| |
| std::vector< std::string > | getVariableLevels () const |
| | Return the level names of the constraint if it is a level.
|
| |
| void | getGoal (std::string &name, double &value) const |
| | Fill up the name and weight of the goal of the constraint.
|
| |
| void | setGoal (const std::string &goalname, const double &value) |
| | Set a goal with a name and a value if the constraint is not an objective.
|
| |
| void | setPenalties (const std::string &penaltyoperator, const std::vector< std::string > &variables) |
| | Set the penalties if the constraint is an objective.
|
| |
| bool | isObjective () const |
| | Return true if the constraint is an objective.
|
| |
| double | sense () const |
| | Return the sense of the objective, 1 for minimisation and -1 for maximisation.
|
| |
| void | getBounds (double &lower, double &upper, int period=0) const |
| | Fill up the lower and upper bound for a given period if the constraint applies to it.
|
| |
| void | setRhs (double lower, double upper) |
| | Set the RHS of the constraint with a lower and upper bound.
|
| |
| void | setLength (int firstPeriod=1, int lastPeriod=std::numeric_limits< int >::max()) |
| | Set the length of the constraint.
|
| |
| void | getVariations (double &lower, double &upper) const |
| | Get the variation for constraints like _EVEN, _SEQ or _NDY.
|
| |
| bool | isMultiple () const |
| | Return true if the constraint allows some variability like _EVEN.
|
| |
| bool | acrossPeriod () const |
| | Return true if the constraint needs to be set across multiple periods like _EVEN, _SEQ or _NDY.
|
| |
| size_t | hash (bool hashrhs=true, bool hashoutputonly=false) const |
| | Return the hash of the constraint.
|
| |
| size_t | hasHasOutput () const |
| | Return the hash of the output of the constraint.
|
| |
| void | setOutput (const FMTOutput &out) |
| | Set the output of the constraint.
|
| |
| void | setConstraintType (FMTconstrainttype ltype) |
| | Set the type of the constraint.
|
| |
| FMTconstrainttype | getConstraintType () const |
| | Return the type of the constraint.
|
| |
| | operator std::string () const |
| | Return the string representation of the constraint as in the optimization section.
|
| |
| bool | isSpatial () const |
| | Return true if the constraint is a spatial constraint.
|
| |
| bool | isRandomAction () const |
| | Return true if the constraint is a random action constraint.
|
| |
| size_t | getGroup () const |
| | Return the group of the constraint (objective = 0, spatial = 1, other = 2 or user defined).
|
| |
| size_t | outputEmpty () const |
| | Return true if the output of the constraint is empty.
|
| |
| FMTConstraint | preSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &originalthemes, const std::vector< const FMTTheme * > &selectedthemes, const std::vector< FMTTheme > &newthemes, const std::vector< FMTAction > &actions, const std::vector< bool > &p_valideActions, const FMTYields &yields) const |
| | Presolve the constraint, potentially returning an empty constraint. See FMTOutput::preSolve.
|
| |
| void | preSolveRef (const FMTMaskFilter &p_filter, const std::vector< FMTTheme > &p_originalThemes, const std::vector< const FMTTheme * > &p_selectedThemes, const std::vector< FMTTheme > &p_newThemes, const std::vector< FMTAction > &p_actions, const std::vector< bool > &p_valideActions, const FMTYields &p_yields) |
| | Presolve the constraint in place. See FMTOutput::preSolve.
|
| |
| | ~FMTConstraint ()=default |
| | Default destructor for FMTConstraint.
|
| |
| double | evaluate (const std::vector< double > &temporalvalues) const |
| | Return a value representing the quality of the solution for the constraint.
|
| |
| std::vector< int > | getActionIds (const std::vector< Core::FMTAction > &actions) const |
| | Return the action ids to which the spatial constraint applies.
|
| |
| std::vector< bool > | isActionsused (const std::vector< Core::FMTAction > &actions) const |
| | Return a vector of booleans, true for the actions to which the spatial constraint applies.
|
| |
| bool | canBeTurnedToYieldsBasedOnTransitions (const std::vector< Core::FMTTheme > &p_themes, const std::vector< Core::FMTTransition > &p_trans, const std::vector< Core::FMTAction > &p_actions, const std::vector< bool > &p_valideActions) const |
| | Return true if the constraint can be turned to a simple action bound using a simple yield, checking the transitions.
|
| |
| void | turnToYieldsBasedOnTransition (const std::vector< Core::FMTTheme > &themes, const std::vector< Core::FMTTransition > &trans, std::vector< Core::FMTAction > &actions, const std::vector< bool > &p_valideActions, Core::FMTYields &yields, const int &constraintid) const |
| | Turn the constraint to yields and actions based on the transitions.
|
| |
| bool | canBeTurnedToYields () const |
| | Return true if the constraint can be turned to a simple action bound using a simple yield.
|
| |
| void | turnToYieldsAndActions (const std::vector< Core::FMTTheme > &themes, std::vector< Core::FMTAction > &actions, const std::vector< bool > &p_valideActions, Core::FMTYields &yields, const int &constraintid) const |
| | Generate two yield handlers from the constraint and include them in the yields, modifying the actions, to reduce the matrix size.
|
| |
| int | getThemeTarget () const |
| | Return the theme target of the constraint.
|
| |
| double | getWeight () const |
| | Return the weight of the constraint.
|
| |
| | FMTOutput () |
| | Default constructor for FMTOutput.
|
| |
| virtual | ~FMTOutput ()=default |
| | Default virtual destructor for FMTOutput.
|
| |
| | FMTOutput (const std::string &lname, const std::string &ldescription, const std::string &lgroup, const std::vector< FMTOutputSource > &lsources, const std::vector< FMTOperator > &loperators) |
| | Complete constructor from a name, a description, a group, sources and operators.
|
| |
| | FMTOutput (const std::string &lname) |
| | Partial constructor from a name only.
|
| |
| | FMTOutput (const FMTOutput &rhs) |
| | Copy constructor for FMTOutput.
|
| |
| FMTOutput & | operator= (const FMTOutput &rhs) |
| | Copy assignment operator for FMTOutput.
|
| |
| bool | operator== (const FMTOutput &rhs) const |
| | Equality comparison operator of FMTOutput, checking if they have the same name.
|
| |
| bool | operator!= (const FMTOutput &rhs) const |
| | Inequality comparison operator of FMTOutput, checking if they have a different name.
|
| |
| FMTOutput & | operator+= (const FMTOutput &rhs) |
| | Addition assignment operator with another FMTOutput.
|
| |
| FMTOutput & | operator-= (const FMTOutput &rhs) |
| | Subtraction assignment operator with another FMTOutput.
|
| |
| FMTOutput & | operator*= (const FMTOutputSource &p_source) |
| | FMTOutput multiplication assignment with a simple double to multiply the FMTOutputSource.
|
| |
| FMTOutput & | operator/= (const FMTOutputSource &p_source) |
| | FMTOutput division assignment with a source.
|
| |
| | operator std::string () const |
| | Convert the output to a readable string as in an output section.
|
| |
| std::string | getName () const |
| | Return the name of the output.
|
| |
| std::string | getDescription () const |
| | Return the description of the output.
|
| |
| std::string | getGroup () const |
| | Return the group of the output.
|
| |
| bool | empty () const |
| | Return true if the output has no output source.
|
| |
| size_t | size () const |
| | Return the number of output sources of the output.
|
| |
| bool | isLinear () const |
| | Return true if the output is linear, with no variable to variable multiplication or division.
|
| |
| bool | canBeNodesOnly () const |
| | Return true if the output can be used as nodes only in LP.
|
| |
| bool | isLevel () const |
| | Return true if one output source of the output is a level.
|
| |
| bool | isOnlyLevel () const |
| | Return true if all output sources of the output are levels.
|
| |
| bool | isConstantLevel () const |
| | Return true if all output sources of the output are constant levels.
|
| |
| bool | isConstant () const |
| | Return true if all output sources of the output are constants.
|
| |
| double | getConstantValue () const |
| | Return the constant value if the output is a single constant.
|
| |
| bool | containsLevel () const |
| | Return true if the output contains any level.
|
| |
| double | shuntingYard (const std::vector< double > &sourcevalues, const std::vector< FMTOperator > &simple_operators) const |
| | Evaluate the output using the shunting yard algorithm with source values and operators.
|
| |
| FMTOutput | boundTo (const std::vector< FMTTheme > &themes, const FMTPerBounds &bound, const std::string &specialbound, std::string attribute="") const |
| | Bound the output to specific period bounds and return the new output, optionally targeting a theme.
|
| |
| std::vector< FMTOutputNode > | getNodes (std::vector< std::string > &equation, double multiplier=1, bool orderbyoutputid=false, int period=1) const |
| | Return the output nodes generated from the output sources and operators, optionally multiplied by a factor.
|
| |
| bool | isSinglePeriod () const |
| | Return true if the output covers a single period of the graph.
|
| |
| bool | hasAverage () const |
| | Return true if the output needs to be averaged.
|
| |
| int | getTargetPeriod () const |
| | Return the targeted period of the output if it is single period.
|
| |
| size_t | hash () const |
| | Return the hash of the output.
|
| |
| void | setSources (const std::vector< FMTOutputSource > &p_sources) |
| | Set new sources for the output.
|
| |
| void | setOperators (const std::vector< FMTOperator > &p_operators) |
| | Set new operators for the output.
|
| |
| std::vector< FMTOutputSource > | getSources () const |
| | Return a copy of the output sources of the output.
|
| |
| const std::vector< FMTOutputSource > & | getSourcesReference () const |
| | Return a const reference to the output sources of the output.
|
| |
| std::vector< FMTOperator > | getOpes () const |
| | Return a copy of the operators of the output.
|
| |
| FMTTheme | targetTheme (const std::vector< FMTTheme > &themes) const |
| | Return the theme targeted by the output.
|
| |
| int | targetThemeId () const |
| | Return the id of the theme targeted by the output.
|
| |
| std::vector< std::string > | getThemeDecomposition (const FMTTheme &theme) const |
| | Return all possible attribute values the output can have for the given theme.
|
| |
| std::vector< std::string > | getDecomposition (const std::vector< FMTTheme > &themes) const |
| | Return all possible attribute values the output can have if the attribute target is set, else an empty vector.
|
| |
| FMTOutput | intersectWithMask (const Core::FMTMask &mask, const std::vector< Core::FMTTheme > &themes) const |
| | Return the output resulting from the intersection of a mask with this output.
|
| |
| FMTMask | getVariableIntersect () const |
| | Return the intersected mask of all variables.
|
| |
| FMTMask | getMasksUnion () const |
| | get the union of all masks of the sources and factor
|
| |
| std::vector< const Core::FMTTheme * > | getStaticThemes (const std::vector< Core::FMTTheme > &themes, const Core::FMTYields &yields, bool ignoreoutputvariables=false) const |
| | Return the static themes of the whole output.
|
| |
| FMTOutput | preSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &originalthemes, const std::vector< const FMTTheme * > &selectedthemes, const std::vector< FMTTheme > &newthemes, const std::vector< FMTAction > &actions, const std::vector< bool > &p_valideActions, const FMTYields &yields) const |
| | Presolve the output and remove unused output sources.
|
| |
| void | changeSourcesId (const std::set< int > &newoutputsorigin, const std::set< int > &newthemeid) |
| | Change the output origin and target theme id of each source with the distance from the beginning of the set, normally used after preSolve.
|
| |
| void | changeSourcesId (const int &outid) |
| | Change the output origin of each source, for the optimization parser.
|
| |
| Core::FMTOutput | removeRHSvalue () const |
| | Return a new output removing the extra constants from a mix of noded output and constant level.
|
| |
| void | getRHSvalue (const int &period, double &lower, double &upper) const |
| | Get the RHS values mixing a level with a variable node for a given period.
|
| |
| void | setPeriod (const int &newPeriod) |
| | Set the output sources to a single period.
|
| |
| bool | isActionBased () const |
| | Return true if the output contains action nodes.
|
| |
| bool | isVariableSizeOf (const size_t &masksize) const |
| | Return true if a variable source has a mask size equal to the given size, or if no source is variable.
|
| |
| bool | isInventory () const |
| | Return true if the output contains an inventory.
|
| |
| void | fillFromShuntingYard (const std::vector< std::string >baseeq, std::map< std::string, double > &results, const std::vector< Core::FMTOutputNode > &nodes, std::map< std::string, std::vector< std::string > > &allequations) const |
| | Get the values of a non linear output using the shunting yard algorithm.
|
| |
| | FMTObject () |
| | Default constructor for FMTObject.
|
| |
| virtual | ~FMTObject () |
| | Default virtual destructor for FMTObject.
|
| |
| | FMTObject (const std::unique_ptr< Exception::FMTExceptionHandler > exhandler) |
| | Construct a FMTObject passing in the exception handler of another FMTObject.
|
| |
| | FMTObject (const FMTObject &rhs) |
| | Copy constructor for FMTObject.
|
| |
| FMTObject & | operator= (const FMTObject &rhs) |
| | Copy assignment operator for FMTObject.
|
| |
| virtual void | passInLogger (const std::unique_ptr< Logging::FMTLogger > &logger) |
| | Pass in the logger of another FMTObject.
|
| |
| void | passInExceptionHandler (const std::unique_ptr< Exception::FMTExceptionHandler > &exhandler) |
| | Pass in the exception handler of another FMTObject.
|
| |
| void | redirectLogToFile (const std::string &location) |
| | Redirect the log to a specific file, appending to it.
|
| |
| virtual void | setDefaultLogger () |
| | Create and set a default logger to the FMTObject.
|
| |
| virtual void | setQuietLogger () |
| | Create and set a quiet logger to the FMTObject.
|
| |
| virtual void | setTaskLogger () |
| | Create and set a task logger to the FMTObject.
|
| |
| virtual void | setDebugLogger () |
| | Create and set a debug logger to the FMTObject.
|
| |
| void | setDefaultExceptionHandler () |
| | Create and set a default exception handler to the FMTObject.
|
| |
| void | setQuietExceptionHandler () |
| | Create and set a quiet exception handler to the FMTObject.
|
| |
| void | setDebugExceptionHandler () |
| | Create and set a debug exception handler to the FMTObject.
|
| |
| void | setFreeExceptionHandler () |
| | Create and set a free exception handler to the FMTObject.
|
| |
| void | disableNestedExceptions () |
| | Disable the nested exception throw of the exception handler.
|
| |
| void | enableNestedExceptions () |
| | Enable the nested exception throw of the exception handler.
|
| |
| void | setErrorsToWarnings (const std::vector< Exception::FMTexc > &errors) |
| | Set a list of errors to be cast to warnings on the exception handler.
|
| |
| void | setMaxWarningsBeforeSilenced (const size_t &maxwarningcount) |
| | Set the number of warnings raised before being silenced.
|
| |
| template<class Archive > |
| void | serialize (Archive &ar, const unsigned int version) |
| |