kangaroo
1.0
the cbls library
|
Rank variables optimally based on mapped parameter expressions using heaps and respecting single variable tabu. More...
#include <heapOptimalMapVarRankSingleVarTabuDoCallback.hpp>
Public Types | |
typedef paramValue | ParamValueType |
Parameter value type. | |
typedef buffer | BufferType |
Buffer type. | |
Public Types inherited from MapVarRankFunction< buffer > | |
typedef buffer | BufferType |
Buffer type. | |
Public Member Functions | |
Variable Ranking | |
virtual Serial | RankedParamBegin () const overridefinal |
Get the parameter serial of the inclusive begin of the ranked list. More... | |
virtual Serial | RankedParamEnd () const overridefinal |
Get the parameter serial of the exclusive end of the ranked list. More... | |
virtual Dim | RankedParamCount () const overridefinal |
Get the number of ranked parameters among all parameter expresessions. More... | |
virtual Serial | RankedParamNext (Serial const ParamSerial) const overridefinal |
Get the parameter serial of the next in the ranked list. More... | |
virtual Serial | IndexedRankedParam (Index const RankIndex) const overridefinal |
Get the parameter serial from the rank index of the ranked list. More... | |
virtual Serial | RandomRankedParam (Random &pRandom) const overridefinal |
Get a randomly selected parameter serial from the ranked list. More... | |
Tabu Effect | |
virtual void | computeTabuEffect () overridefinal |
Compute tabu effect. More... | |
virtual Identifier | CareTabuModel () const overridefinal |
Care for tabu effect. More... | |
virtual SvTabuDoCall const * | CareTabuInstance () const overridefinal |
Care tabu instance. More... | |
Variable Ranking | |
Public Member Functions inherited from Function | |
Bool | ActiveLazyHalfAutoExec () const |
Whether auto execution in lazy half mode is active? More... | |
void | activateLazyHalfAutoExec (Bool const SetNotUnset) |
Activate auto execution in lazy half mode. More... | |
virtual Bool | CareLockEffect () const |
Care for lock effect? More... | |
virtual Bool | CareFactorSerial () const |
Care factor serial? More... | |
virtual | ~Function () |
Destructor. More... | |
Serial | FuncVarToFactorSerial (Serial const VarSerial) const |
Find the factor serial for a given variable serial. More... | |
Public Member Functions inherited from Expression | |
Bool | Terminal () const |
Whether the expression terminal—variables or constants are terminals, functions are not. More... | |
Bool | Updatable () const |
Whether the expression updatable—variables are updatable, functions may be updatable. More... | |
Bool | Computable () const |
Whether the expression computable—functions are normally computable, but may not be updatable as well. More... | |
virtual Serial | ValueTypeSerial () const |
Value type serial number. More... | |
virtual Serial | MetricTypeSerial () const |
Metric type serial number. More... | |
Bool | CompatibleValueMetricTypes () const |
Whether value and metric types are compatible. More... | |
virtual ValueBase const * | ExprValueRecord () const |
Expression value record or null if no value is present. More... | |
virtual ScalarBase const * | ExprScalarRecord (Order const MaxiOrMini) const |
Expression scalar record or null if no scalar is present. More... | |
virtual VectorBase const * | ExprVectorRecord (Order const MaxiOrMini) const |
Expression vector record or null if no vector is present. More... | |
virtual VectorType | ExprVectorType () const |
Expression vector type: fields for params or factors or values. More... | |
virtual Bool | SharedOptiMetrics () const |
Whether maxi and mini metrics share the same metric record. More... | |
virtual Order | ActiveSharedOptiMetric () const |
When shared, the active one between the maxi or mini metrics. More... | |
virtual Bool | NeedLazyModeUserExecution () const |
Needs user initiated execution in lazy computation mode, since there might be backlog: call this in propagation mode. More... | |
virtual Bool | NeedDownwardUserSimulation () const |
Needs simulation since simulation has not been performed, call this after propagation: call this in propagation mode. More... | |
Clock | ExecClock () const |
The execution clock of the expression. More... | |
Clock | SimulClock () const |
The simulation clock of the expression. More... | |
Bool | ChangedSystemExecClock () const |
Whether the system's execution clock changed from the expression's execution clock. More... | |
Bool | ChangedSystemSimulClock () const |
Whether the system's simulation clock changed from the expression's simulation clock. More... | |
Static Public Member Functions | |
static HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer > * | define (System *const pSystem, SvTabuDoCall *const SysTabu, Dim const ParamCount, Expression *const *pParamExprs, Variable *const *pParamMappedVars) |
Define a function that ranks variables optimally based on mapped parameter expressions using heaps and respecting single variable tabu. More... | |
Static Public Member Functions inherited from Expression | |
static void | performExecution (Expression *const pExpression) |
Execute in current (anew or incrmental) mode. More... | |
static void | performSimulation (Expression *const pExpression) |
Simulate in current (anew or incremental) mode. More... | |
static void | performExecAnew (Expression *const pExpression) |
Execute in anew mode. More... | |
static void | performExecIncr (Expression *const pExpression) |
Execute in incremental mode. More... | |
static void | performSimulAnew (Expression *const pExpression) |
Simulate in anew mode. More... | |
static void | performSimulIncr (Expression *const pExpression) |
Simulate in incremental mode. More... | |
Static Public Attributes | |
static Order const | HeapOrder = MaxiOrMini |
Heap order: maxi or mini heap. | |
Private Member Functions | |
Essential Methods | |
~HeapOptimalMapVarRankSingleVarTabuDoCallback () | |
Destructor. More... | |
HeapOptimalMapVarRankSingleVarTabuDoCallback (System *const pSystem, SvTabuDoCall *const SysTabu, Dim const ParamCount, Expression *const *ParamExprPointers, Variable *const *VarPointers) | |
Param constructor. More... | |
HeapOptimalMapVarRankSingleVarTabuDoCallback (HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer > &&that) noexcept=delete | |
Move constructor. | |
HeapOptimalMapVarRankSingleVarTabuDoCallback (HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer > const &that)=delete | |
Copy constructor. | |
HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer > & | operator= (HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer > &&that) noexcept=delete |
Move assignment. | |
HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer > & | operator= (HeapOptimalMapVarRankSingleVarTabuDoCallback< MaxiOrMini, paramValue, buffer > const &that)=delete |
Copy assignment. | |
Computation Methods | |
virtual void | computeFinal () overridefinal |
Compute the expression. More... | |
virtual void | executeAnew () overridefinal |
Execute the expression. More... | |
virtual void | executeIncr () overridefinal |
Execute the expression. More... | |
Data Members | |
typedef DataTypeMeta< buffer >::TempBuffType | HeapDataType |
Heap data type. | |
typedef OrderComparator< MaxiOrMini, HeapDataType, Bool > | HeapComare |
Heap comparator. | |
typedef OrderBoundary< MaxiOrMini, HeapDataType > | HeapBounds |
Heap boundaries. | |
typedef HeapComare::RegularOp | HeapOper |
Heap operator. | |
nhmi< Serial, Serial > const | mVarSerialToParamSerialMap |
Variable serial to parameter serial mapping. | |
SvTabuDoCall const * | mSysTabu |
System's single tabu. | |
kb< ValueRecord< paramValue > const * > | mParamExprValueRecords |
Parameter records. | |
khpp< HeapOper, Serial > * | mHeapParamValues |
The heap holding values. | |
Additional Inherited Members | |
Data Fields inherited from MapVarRankFunction< buffer > | |
kb< Variable * > const | ParamMappedVars |
Get the variable from the parameter serial of this function. | |
Data Fields inherited from Function | |
Index const | NestingIndex |
Function nesting index; starts from 0. | |
Serial const | FuncSerial |
Unique over all functions. | |
kb< Expression * > const | ParamExprs |
Parameter expressions that this function immediately depends on. | |
kb< ParamSpecType > const *const | ParamSpecs |
Parameter specifications i.e. how to use values and metrics. | |
xb< Variable * > const | FactorVars |
Factor variables that this function transitively depends on. | |
nrl< xb< Serial > > const | ParamFactors |
Variables that parameters depend on. Factor serial of the function are use to represent parameter variables. | |
Data Fields inherited from Expression | |
Identifier const | ExprFamily |
Expression family is either void, variable, constant or function. | |
Identifier const | ExprModel |
Expression model is a category within each expression family. | |
Identifier const | ExprFormat |
Expression format is a concrete expression implementation. | |
System *const | SysMaster |
The system that contains this expression. | |
Hash const | ExprHash |
Expression hash value is used in quick matching of a certain expression. | |
xb< Function * > const | PatronFuncs |
Patron functions of the current expression. | |
xb< Serial > const | PatronParams |
Parameter serials in the patron expressions. | |
Protected Member Functions inherited from MapVarRankFunction< buffer > | |
void | copyParamMappedVars (Variable *const *ParamMappedVars) |
Copy mapped variables. More... | |
virtual void | simulateAnew () |
Compute in anew simulation mode. More... | |
virtual void | simulateIncr () |
Compute in incr simulation mode. More... | |
virtual Serial | setPatron (Function *const pFunction, Serial ParamSerial) overridefinal |
Set a patron in the expression and return patron serial. More... | |
virtual Wrap | ExecWrappedValue () const overridefinal |
Execution value wrap of the expression—throws error. More... | |
virtual Wrap | SimulWrappedValue () const overridefinal |
Simulation value wrap of the expression—throws error. More... | |
virtual Wrap | ExecWrappedScalar (Order const MaxiOrMini) const overridefinal |
Execution scalar wrap of the expression—throws error. More... | |
virtual Dim | VectorFieldCount () const overridefinal |
Number of fields in the vector metrics—throws error. More... | |
virtual Wrap | ExecWrappedVectorField (Order const MaxiOrMini, Serial const FieldSerial) const overridefinal |
Execution value wrap of a vector field—throws error. More... | |
virtual | ~MapVarRankFunction () |
Destructor. More... | |
MapVarRankFunction (System *const pSystem, Dim const ParamCount) | |
Param constructor. More... | |
MapVarRankFunction (MapVarRankFunction< buffer > &&that) noexcept=delete | |
Move constructor. | |
MapVarRankFunction (MapVarRankFunction< buffer > const &that)=delete | |
Copy constructor. | |
MapVarRankFunction< buffer > & | operator= (MapVarRankFunction< buffer > &&that) noexcept=delete |
Move assignment. | |
MapVarRankFunction< buffer > & | operator= (MapVarRankFunction< buffer > const &that)=delete |
Copy assignment. | |
Protected Member Functions inherited from Function | |
virtual void | setupComputation () |
Set up various things for computation. More... | |
virtual void | adjustMemAuto () override |
Adjust memory requirement automatically. More... | |
virtual void | syncExecClock () override |
Synchronize the execution clock. More... | |
void | setFuncSerial (Serial const pSerial) |
Set function serial. More... | |
Hash | calcExprHash () const |
Calculate expression hash value. More... | |
virtual Bool | equate (Expression const &that) const override |
Compare expressions for equality. More... | |
virtual void | computeLockEffect () |
Compute the lock effect up on callback. More... | |
Function (System *const pSystem, Dim const ParamCount) | |
Param constructor. More... | |
Function (Function &&that) noexcept=delete | |
Move constructor. | |
Function (Function const &that)=delete | |
Copy constructor. | |
Function & | operator= (Function &&that) noexcept=delete |
Move assignment. | |
Function & | operator= (Function const &that)=delete |
Copy assignment. | |
void | setParameters (ParamOrder const pParamOrder, Dim const ParamCount, Expression *const *const pParamExprs, ParamSpecType const *const pParamSpecs=nullptr, Index *const pParamIndexes=nullptr) |
Set the parameters, if unordered then expression pointers along with indexes (if given) are sorted. More... | |
void | defineRootWithinSystem () |
Define as a root within the system. More... | |
Serial | RootFuncSerial () const |
The root function serial within the system. More... | |
void | setRootFuncSerial (Serial const RootFuncSerial) |
Set the root function serial with the system. More... | |
Protected Member Functions inherited from Expression | |
virtual | ~Expression () |
Destructor. More... | |
Expression (System *const pSystem) | |
Param constructor. More... | |
Expression (Expression &&that) noexcept=delete | |
Move constructor. | |
Expression (Expression const &that)=delete | |
Copy constructor. | |
Expression & | operator= (Expression &&that) noexcept=delete |
Move assignment. | |
Expression & | operator= (Expression const &that)=delete |
Copy assignment. | |
void | setExprFamily (Identifier const pFamily) |
Set expression family. More... | |
void | setExprModel (Identifier const pModel) |
Set expression model. More... | |
void | setExprFormat (Identifier const pFormat) |
Set expression format. More... | |
void | setExprHash (Hash const pHash) |
Set expression hash value. More... | |
void | setUpdatable (Bool const SetNotUnset) |
Set expression updatablity. More... | |
void | updateExecClock () |
Update the execution clock. More... | |
void | updateSimulClock () |
Update the simulation clock. More... | |
virtual void | syncSimulClock () |
Synchronize the simulation clock. More... | |
virtual void | syncExecBatchClock () |
Synchronize the execution batch clock. More... | |
virtual void | syncSimulBatchClock () |
Synchronize the simulation batch clock. More... | |
Static Protected Member Functions inherited from Function | |
static Serial | defineWithinSystem (Function *const pFunction) |
Define the function in the system. More... | |
Protected Attributes inherited from Function | |
Serial | mRootFuncSerial |
Root function serial in the system. | |
Protected Attributes inherited from Expression | |
friend | System |
Friend access to System. | |
Clock | mEmulClock |
The emulation clock, when the expression was emulated. | |
Clock | mExecClock |
The execution clock, when the expression was executed. | |
Clock | mSimulClock |
The simulation clock, when the expression was simulated. | |
Rank variables optimally based on mapped parameter expressions using heaps and respecting single variable tabu.
Order | The maximisation or minimisation order. |
paramValue | The value type of the parameters. |
buffer | The buffer type to be used inside for ranking. |
|
inlineprivate |
Destructor.
|
inlineprivate |
Param constructor.
|
inlinefinaloverridevirtual |
Get the parameter serial of the inclusive begin of the ranked list.
Implements MapVarRankFunction< buffer >.
|
inlinefinaloverridevirtual |
Get the parameter serial of the exclusive end of the ranked list.
Implements MapVarRankFunction< buffer >.
|
inlinefinaloverridevirtual |
Get the number of ranked parameters among all parameter expresessions.
Implements MapVarRankFunction< buffer >.
|
inlinefinaloverridevirtual |
Get the parameter serial of the next in the ranked list.
Implements MapVarRankFunction< buffer >.
|
inlinefinaloverridevirtual |
Get the parameter serial from the rank index of the ranked list.
Implements MapVarRankFunction< buffer >.
|
inlinefinaloverridevirtual |
Get a randomly selected parameter serial from the ranked list.
Implements MapVarRankFunction< buffer >.
|
inlinefinaloverridevirtual |
Apply the effect of the tabooed variables on the varorder.
Reimplemented from Function.
|
inlinefinaloverridevirtual |
Care tabu effect.
Reimplemented from Function.
|
inlinefinaloverridevirtual |
Care tabu effect?
Reimplemented from Function.
|
inlinefinaloverrideprivatevirtual |
Compute the expression.
Implements Function.
|
inlinefinaloverrideprivatevirtual |
Compute the expression in execution mode.
Implements Expression.
|
inlinefinaloverrideprivatevirtual |
Compute the expression in execution mode.
Implements Expression.