12 #ifndef SingleRangeVarDoubleObjectiveOptimalValueSelectorHppIncluded 13 #define SingleRangeVarDoubleObjectiveOptimalValueSelectorHppIncluded 31 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
69 virtual void setRequirement(Bool
const SetNotUnset);
82 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
94 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
100 Expr * tParamExprs[2] = { pObjectiveExpr0, pObjectiveExpr1 };
105 if (tSelSerial != InvalidSerial)
106 return scast<SingleRangeVarDoubleObjectiveOptimalValueSelector *>(pSystem->LocateSel(tSelSerial));
117 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
129 tFunction = scast<Function *>(this->
ParamExprs[1]);
146 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
151 scast<Function *>(this->
ParamExprs[0])->activateLazyHalfAutoExec(SetNotUnset);
162 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
187 #if UseFlexiSimulForSelector 188 this->
SysMaster->setSimulFlexiVar(tRangeVar);
190 this->
SysMaster->setSimulFixedVar(tRangeVar);
193 this->
SysMaster->setSimulFixedVar(tRangeVar);
195 this->
SysMaster->setSimulFlexiVar(tRangeVar);
202 varType tExecValue = tRangeVar->
ExecValue();
207 if (tExecValue < tMinValue || tExecValue > tMaxValue)
208 for(varType tSimulValue = tMinValue; tSimulValue <= tMaxValue; nextAssign<varType>::iof(tSimulValue, tStepValue))
225 tRunObj0 = tNextObj0;
231 else if (eq<objType0,Bool>::iof(tRunObj0, tNextObj0))
241 tRunObj1 = tNextObj1;
243 else if (eq<objType1,Bool>::iof(tRunObj1, tNextObj1))
263 for(varType tSimulValue = tMinValue; tSimulValue < tExecValue; nextAssign<varType>::iof(tSimulValue, tStepValue))
280 tRunObj0 = tNextObj0;
286 else if (eq<objType0,Bool>::iof(tRunObj0, tNextObj0))
296 tRunObj1 = tNextObj1;
298 else if (eq<objType1,Bool>::iof(tRunObj1, tNextObj1))
302 for(varType tSimulValue = tMaxValue; tSimulValue > tExecValue; prevAssign<varType>::iof(tSimulValue, tStepValue))
319 tRunObj0 = tNextObj0;
325 else if (eq<objType0,Bool>::iof(tRunObj0, tNextObj0))
335 tRunObj1 = tNextObj1;
337 else if (eq<objType1,Bool>::iof(tRunObj1, tNextObj1))
344 Index tIndex = uniformRandom(pRandom, this->
mSelectedValues.ItemCount());
358 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
383 #if UseFlexiSimulForSelector 384 this->
SysMaster->setSimulFlexiVar(tRangeVar);
386 this->
SysMaster->setSimulFixedVar(tRangeVar);
389 this->
SysMaster->setSimulFixedVar(tRangeVar);
391 this->
SysMaster->setSimulFlexiVar(tRangeVar);
398 varType tExecValue = tRangeVar->
ExecValue();
403 if (tExecValue < tMinValue || tExecValue > tMaxValue)
404 for(varType tSimulValue = tMinValue; tSimulValue <= tMaxValue; nextAssign<varType>::iof(tSimulValue, tStepValue))
421 tRunObj0 = tNextObj0;
427 else if (eq<objType0,Bool>::iof(tRunObj0, tNextObj0))
437 tRunObj1 = tNextObj1;
439 else if (eq<objType1,Bool>::iof(tRunObj1, tNextObj1))
459 for(varType tSimulValue = tMinValue; tSimulValue < tExecValue; nextAssign<varType>::iof(tSimulValue, tStepValue))
476 tRunObj0 = tNextObj0;
482 else if (eq<objType0,Bool>::iof(tRunObj0, tNextObj0))
492 tRunObj1 = tNextObj1;
494 else if (eq<objType1,Bool>::iof(tRunObj1, tNextObj1))
498 for(varType tSimulValue = tMaxValue; tSimulValue > tExecValue; prevAssign<varType>::iof(tSimulValue, tStepValue))
515 tRunObj0 = tNextObj0;
521 else if (eq<objType0,Bool>::iof(tRunObj0, tNextObj0))
531 tRunObj1 = tNextObj1;
533 else if (eq<objType1,Bool>::iof(tRunObj1, tNextObj1))
540 Index tIndex = uniformRandom(pRandom, this->
mSelectedValues.ItemCount());
555 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
568 template<Order MaxiOrMini0, Order MaxiOrMini1,
typename varType,
typename objType0,
typename objType1>
581 #endif //SingleRangeVarDoubleObjectiveOptimalValueSelectorHppIncluded void setSimulMode(SysMode::ModeEnum const pModeEnum)
Set the simulation mode.
Definition: system1.hpp:361
void includeCurrValue(Bool const SetNotUnset)
Include current value in search.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:569
Clock SimulClock() const
Get the simulation clock.
Definition: system1.hpp:249
Functions that depend on other expressions.
Definition: function0.hpp:31
Bool ActiveLazyHalf() const
Get whether active.
Definition: selector1.hpp:64
xb< Wrap > mSelectedValues
Selector values.
Definition: selector0.hpp:246
void setExecReady(Bool const SetNotUnset)
Set ready for execution.
Definition: selector1.hpp:144
void setSelFormat(Identifier const pFormat)
Set selector format.
Definition: selector1.hpp:100
#define openKangarooSpace
Open the project namespace.
Definition: project.hpp:74
xb< Variable * > const FactorVars
Factor variables that this function transitively depends on.
Definition: function0.hpp:177
virtual Bool DynamicDomainUpdateDefined() const
Whether the dynamic domain update defined.
Definition: variable1.hpp:39
constexpr char const * kSelNotRequiredVars
Selector does not have required variables.
Definition: messages.hpp:108
Range variables that have domains defined by ranges of values.
Definition: rangeVariable.hpp:31
virtual Serial ValueTypeSerial() const overridefinal
Value type serial.
Definition: rangeVariable.hpp:307
void setSelHash(Hash const pHash)
Set selector hash.
Definition: selector1.hpp:130
kb< Expression * > const ParamExprs
The parameter expressions.
Definition: selector0.hpp:240
static data First(Byte1 const OffSet)
Definition: datatypes.hpp:252
virtual void simulateIncrValue(value const &Value)=0
Simulate incrementally with a given value.
data const & ExecData() const
Return execution data in execution buffer.
Definition: scalarrecord.hpp:287
Dynamic domain.
Definition: variable0.hpp:60
constexpr char const * kWrongTypeEncountered
Wrong type encountered.
Definition: messages.hpp:42
virtual void simulateAnewValue(value const &Value)=0
Simulate anew with a given value.
Abstract variable class.
Definition: variable0.hpp:86
static void performExecution(Expression *const pExpression)
Execute in current (anew or incrmental) mode.
Definition: expression1.hpp:237
SingleRangeVarDoubleObjectiveOptimalValueSelector(System *const pSystem, Expression *const *pParamExprs, DomainType const StaticOrDynamic)
Param constructor.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:119
constexpr char const * kSysYetNotInitialised
System yet uninitialised.
Definition: messages.hpp:167
void setDynamicRange(Bool const SetNotUnset)
Set dynamic range.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:556
void setHoldValue(Bool const SetNotUnset)
Set whether holds values.
Definition: selector1.hpp:158
Index for Library Frames.
xb< Variable * > mSelectedVars
Selector variables.
Definition: selector0.hpp:245
value SimulValue() const
Simulation value of the variable.
Definition: rangeVariable.hpp:282
virtual Bool selectAnew(Random &pRandom)
Run the selector in the system.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:163
Unique identifier of a class.
Represents sorting order binary operators.
Definition: datatypes.hpp:171
ValueRecord< objType1 > const * mObjValueRecord1
Objective value.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:73
ValueRecord< objType0 > const * mObjValueRecord0
Objective value.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:72
value ExecValue() const
Execution value of the variable.
Definition: rangeVariable.hpp:269
virtual void updateDynamicDomain()
Update the dynamic domain.
Definition: variable1.hpp:27
Null computation mode.
Definition: sysmode.hpp:43
Hash calcSelHash() const
Calculate hash value.
Definition: selector1.hpp:197
Selects variables or values or moves.
Definition: selector0.hpp:40
virtual Bool selectIncr(Random &pRandom)
Run the selector in the system.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:359
Selector(System *const pSystem, Dim const ParamCount)
Param constructor.
Definition: selector1.hpp:81
Incremental assignment propagation mode.
Definition: sysmode.hpp:47
static void performSimulIncr(Expression *const pExpression)
Simulate in incremental mode.
Definition: expression1.hpp:326
Constraint-based local search systems.
Definition: system0.hpp:45
static Serial defineWithinSystem(Selector *const pSelector)
Define the selector.
Definition: selector1.hpp:244
void setParameters(Dim const ParamCount, Expression *const *const pParamExprs, ParamSpecType const *const pParamSpecs=nullptr)
Set the parameters.
Definition: selector1.hpp:260
Bool mIncludeCurr
Include current value.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:75
Bool ActiveLazyHalfDynamicDomainUpdate() const
Whether the dynamic domain update is active in lazy half mode.
Definition: variable1.hpp:51
Selecting an optimal value for a range variable, optimising two objectives.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:33
Incremental assignment application mode.
Definition: sysmode.hpp:46
Anew propagation mode.
Definition: sysmode.hpp:45
virtual value StepSizeValue() const =0
The step size value of the domain.
Bool CheckExecMode(SysMode::ModeEnum const pModeEnum) const
Check the execution mode.
Definition: system1.hpp:390
DomainType mDomainType
Whether dynamic range.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:74
constexpr char const * kNoVarsForSelection
No variables found for selection.
Definition: messages.hpp:109
#define closeKangarooSpace
Close the project namespace.
Definition: project.hpp:75
DomainType
Domain types.
Definition: variable0.hpp:57
Anew application mode.
Definition: sysmode.hpp:44
static SingleRangeVarDoubleObjectiveOptimalValueSelector * define(System *const pSystem, Expression *const pObjectiveExpr0, Expression *const pObjectiveExpr1, DomainType const StaticOrDynamic=StaticDomain)
< Define a selector that selects an optimal value for a range variable, optimising two objectives...
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:97
~SingleRangeVarDoubleObjectiveOptimalValueSelector()
Destructor.
Definition: singleRangeVarDoubleObjectiveOptimalValueSelector.hpp:83
System *const SysMaster
Selector's system.
Definition: selector0.hpp:239
data const & SimulData(Clock const SimulClock) const
SimulDiff ? SimulBuffer : ExecBuffer().
Definition: valuerecord.hpp:408
Wrappers for values.
Definition: wrapper.hpp:68
virtual value MaxValue(DomainType const StaticOrDynamic) const =0
The maximum value of the domain.
Wrapper Wrap
Shortcut for Wrapper.
Definition: wrapper.hpp:321
Represents data type meta.
Definition: datatypes.hpp:73
Abstract expressions.
Definition: expression0.hpp:41
static void performSimulAnew(Expression *const pExpression)
Simulate in anew mode.
Definition: expression1.hpp:310
virtual value MinValue(DomainType const StaticOrDynamic) const =0
The Minimum value of the domain.
Static domain.
Definition: variable0.hpp:59