class Gambit::functor

Function wrapper (functor) base class.

#include <functors.hpp>

Inherited by Gambit::backend_functor_common< TYPE(*)(ARGS…), TYPE, ARGS… >, Gambit::backend_functor_common< variadic_ptr< TYPE, ARGS… >::type, TYPE, ARGS… >, Gambit::backend_functor_common< variadic_ptr< void, ARGS… >::type, void, ARGS… >, Gambit::backend_functor_common< void(*)(ARGS…), void, ARGS… >, Gambit::backend_functor_common< PTR_TYPE, TYPE, ARGS >, Gambit::module_functor_common

Public Functions

Name
virtual doublegetRuntimeAverage()
virtual doublegetInvalidationRate()
virtual voidsetFadeRate(double )
virtual voidnotifyOfInvalidation(const str & )
virtual voidreset()
functor(str func_name, str func_capability, str result_type, str origin_name, Models::ModelFunctorClaw & claw)
Constructor.
virtual~functor()
Destructor.
virtual voidcalculate()
Virtual calculate(); needs to be redefined in daughters.
virtual voidreset_and_calculate()
Reset-then-recalculate method.
voidsetStatus(FunctorStatus stat)
Setter for status.
virtual voidsetInUse(bool )
Set the inUse flag (must be overridden in derived class to have any effect).
voidsetPurpose(str purpose)
Setter for purpose (relevant only for next-to-output functors)
voidsetVertexID(int ID)
Setter for vertex ID (used in printer system)
voidsetTimingVertexID(int ID)
Set ID for timing ‘vertex’ (used in printer system)
strname() const
Getter for the wrapped function’s name.
strcapability() const
Getter for the wrapped function’s reported capability.
strtype() const
Getter for the wrapped function’s reported return type.
strorigin() const
Getter for the wrapped function’s origin (module or backend name)
virtual strversion() const
Getter for the version of the wrapped function’s origin (module or backend)
virtual strsafe_version() const
Getter for the ‘safe’ incarnation of the version of the wrapped function’s origin (module or backend)
FunctorStatusstatus() const
Getter for the functors current status.
boolisAvailable() const
Checks whether the functor is available (or even already activated)
boolisActive() const
Checks whether the functor is active.
boolisDisabled() const
Checks whether the functor is disabled (discriminant is negative)
boolisEnabled() const
Checks whether the functor is enabled (discriminant is non negative)
sspairquantity() const
Getter for the overall quantity provided by the wrapped function (capability-type pair)
strpurpose() const
Getter for purpose (relevant for output nodes, aka helper structures for the dep. resolution)
strcitationKey() const
Getter for the citation key.
intvertexID() const
Getter for vertex ID.
inttimingVertexID() const
Getter for timing vertex ID.
strlabel() const
Getter for string label.
strtimingLabel() const
Getter for the printer timing label.
virtual boolrequiresPrinting() const
Getter indicating if the wrapped function’s result should to be printed.
virtual boolrequiresTimingPrinting() const
Getter indicating if the timing data for this function’s execution should be printed.
virtual voidsetPrintRequirement(bool flag)
Setter for indicating if the wrapped function’s result should to be printed.
virtual voidsetTimingPrintRequirement(bool flag)
Setter for indicating if the timing data for this function’s execution should be printed.
virtual voidsetNestedList(std::vector< functor * > & )
Set the ordered list of pointers to other functors that should run nested in a loop managed by this one.
virtual voidsetIteration(long long )
Set the iteration number in a loop in which this functor runs.
virtual boolcanBeLoopManager()
Getter for revealing whether this is permitted to be a manager functor.
virtual boolneedsLoopManager()
Getter for revealing whether this functor needs a loop manager.
virtual strloopManagerCapability()
Getter for revealing the required capability of the wrapped function’s loop manager.
virtual strloopManagerType()
Getter for revealing the required type of the wrapped function’s loop manager.
virtual strloopManagerName()
Getter for revealing the name of the wrapped function’s assigned loop manager.
virtual strloopManagerOrigin()
Getter for revealing the module of the wrapped function’s assigned loop manager.
virtual voidbreakLoop()
Tell the functor that the loop it manages should break now.
virtual std::set< sspair >dependencies()
Getter for listing currently activated dependencies.
virtual std::set< sspair >backendclassloading()
Getter for listing backends that require class loading.
virtual std::set< str >backendgroups()
Getter for listing backend requirement groups.
virtual std::set< sspair >backendreqs()
Getter for listing all backend requirements.
virtual std::set< sspair >backendreqs(str )
Getter for listing backend requirements from a specific group.
virtual std::set< sspair >backendspermitted(sspair )
Getter for listing permitted backends.
virtual std::set< str >backendreq_tags(sspair )
Getter for listing tags associated with backend requirements.
virtual std::set< sspair >forcematchingbackend(str )
Getter for listing backend requirements that must be resolved from the same backend.
virtual std::set< sspair >backend_conditional_dependencies(str , str , str , str )
Getter for listing backend-specific conditional dependencies (4-string version)
virtual std::set< sspair >backend_conditional_dependencies(str req, str type, str be)
Getter for backend-specific conditional dependencies (3-string version)
virtual std::set< sspair >backend_conditional_dependencies(functor * be_functor)
Getter for backend-specific conditional dependencies (backend functor pointer version)
virtual std::set< sspair >model_conditional_dependencies(str model)
Getter for listing model-specific conditional dependencies (matches also on parents and friends)
virtual std::set< sspair >model_conditional_dependencies_exact(str model)
Getter for listing model-specific conditional dependencies (matches on the exact model)
virtual std::set< sspair >model_conditional_backend_reqs(str model)
Getter for listing model-specific conditional backend requirements (matches also on parents and friends)
virtual std::set< sspair >model_conditional_backend_reqs_exact(str model)
Getter for listing model-specific conditional backend requirements (matches on the exact model)
virtual voidresolveDependency(functor * )
Resolve a dependency using a pointer to another functor object.
virtual voidresolveLoopManager(functor * )
Set this functor’s loop manager (if it has one)
virtual voidresolveBackendReq(functor * )
Resolve a backend requirement using a pointer to another functor object.
virtual voidnotifyOfModel(str )
Notify the functor that a certain model is being scanned, so that it can activate itself accordingly.
virtual voidnotifyOfDependee(functor * )
Notify the functor that it is being used to fill a dependency of another functor.
virtual voidnotifyOfBackends(std::map< str, std::set< str > > )
Indicate to the functor which backends are actually loaded and working.
virtual voidprint(Printers::BasePrinter * printer, const int pointID, int thread_num)
Printer function.
virtual voidprint(Printers::BasePrinter * printer, const int pointID)
Printer function (no-thread-index short-circuit)
virtual invalid_point_exception *retrieve_invalid_point_exception()
Retrieve the previously saved exception generated when this functor invalidated the current point in model space.
voidnotifyOfIniOptions(const Options & opt)
template <typename TYPE >
void
setOption(const str & key, const TYPE val)
Set an option for the functor directly (for use in standalone executables).
safe_ptr< Options >getOptions()
Return a safe pointer to the options that this functor is supposed to run with (e.g. from the ini file).
voidnotifyOfSubCaps(const str & subcap_string)
Notify the functor about a string in YAML that contains the sub-capability information (for use in standalones)
voidnotifyOfSubCaps(const Options & subcaps)
Notify the functor about an instance of the options class that contains sub-capability information.
template <typename TYPE >
void
setSubCap(const str & key, const TYPE val)
Set a sub-capability (subcap)for the functor directly (for use in standalone executables).
safe_ptr< Options >getSubCaps()
Return a safe pointer to the subcaps that this functor realises it is supposed to facilitate downstream calculation of.
safe_ptr< std::set< sspair > >getDependees()
Return a safe pointer to the vector of all capability,type pairs of functors arranged downstream of this one in the dependency tree.
const std::set< str > &getAllowedModels()
Getter for listing allowed models.
const std::set< str > &getConditionalModels()
Getter for listing conditional models.
const std::map< str, std::set< str > > &getModelGroups()
Getter for map of model groups and the set of models in each group.
boolallModelsAllowed()
Test whether the functor is allowed to be used with all models.
boolmodelAllowed(str model)
Test whether the functor is always allowed (either explicitly or implicitly) to be used with a given model.
boolmodelExplicitlyAllowed(str model)
Test whether the functor is explictly always allowed to be used with a given model.
voidsetAllowedModel(str model)
Add a model to the internal list of models for which this functor is allowed to be used.
boolmodelComboAllowed(std::set< str > combo)
Test whether the functor is allowed (either explicitly or implicitly) to be used with a given combination of models.
boolmodelComboExplicitlyAllowed(std::set< str > combo)
Test whether the functor has been explictly allowed to be used with a given combination of models.
voidsetModelGroup(str group, str contents)
Add a model group definition to the internal list of model groups.
voidsetAllowedModelGroupCombo(str groups)
Add a combination of model groups to the internal list of combinations for which this functor is allowed to be used.
voidaddMatchedObservable(const DRes::Observable * obs)
Add an observable to the set of those that this functor matches.
const std::set< const DRes::Observable * > &getMatchedObservables()
Retrieve the set of observables that this functor matches.
voidaddMatchedModuleRule(const DRes::ModuleRule * r)
Add a module rule to the set of those against which this functor has been tested and found to match.
voidaddMatchedBackendRule(const DRes::BackendRule * r)
Add a backend rule to the set of those against which this functor has been tested and found to match.
const std::set< const DRes::ModuleRule * > &getMatchedModuleRules()
Retrieve the set of module rules against which this functor has been tested and found to match.
const std::set< const DRes::BackendRule * > &getMatchedBackendRules()
Retrieve the set of backend rules against which this functor has been tested and found to match.
template <class RuleT >
const std::set< RuleT * > &
getMatchedRules()
Retrieve matched rules by type.
const std::set< const DRes::ModuleRule * > &getMatchedRules()

Protected Functions

Name
virtual voidreset(int )
Reset functor for one thread only.
voidfailBigTime(str method)
Attempt to retrieve a dependency or model parameter that has not been resolved.
boolallowed_parent_or_friend_exists(str model)
Test if there is a model in the functor’s allowedModels list as which this model can be interpreted.
boolin_allowed_combo(str model)
Check that a model is actually part of a combination that is allowed to be used with this functor.
boolcontains_anything_interpretable_as_member_of(std::set< str > combo, str group)
Test whether any of the entries in a given model group is a valid interpretation of any members in a given combination.
boolhas_common_elements(std::set< str > combo, str group)
Work out whether a given combination of models and a model group have any elements in common.
strfind_friend_or_parent_model_in_map(str model, std::map< str, std::set< sspair > > karta)
Try to find a parent or friend model in some user-supplied map from models to sspair vectors.

Protected Attributes

Name
strmyName
Internal storage of the function name.
strmyCapability
Internal storage of exactly what the function calculates.
strmyType
Internal storage of the type of what the function calculates.
strmyOrigin
Internal storage of the name of the module or backend to which the function belongs.
strmyPurpose
Purpose of the function (relevant for output and next-to-output functors)
strmyCitationKey
Citation key: BibTex key of the reference.
const Models::ModelFunctorClaw *myClaw
Bound model functor claw, for checking relationships between models.
const strmyLabel
String label, used to label functor results for printer system.
const strmyTimingLabel
String label, used to label functor timing data for printer system.
FunctorStatusmyStatus
Status:
intmyVertexID
Internal storage of the vertex ID number used by the printer system to identify functors.
intmyTimingVertexID
ID assigned by printers to the timing data output stream.
boolverbose
Debug flag.
OptionsmyOptions
Internal storage of function options, as a YAML node.
OptionsmySubCaps
Internal storage of function sub-capabilities, as a YAML node.
std::set< sspair >myDependees
List of all capability,type pairs of functors downstream of this one in the dependency tree.
std::set< str >allowedModels
List of allowed models.
std::set< str >conditionalModels
List of conditional models.
std::set< std::set< str > >allowedGroupCombos
List of allowed model group combinations.
std::map< str, std::set< str > >modelGroups
Map from model group names to group contents.
std::set< const DRes::Observable * >matched_observables
The set of observables that this functor matches.
std::set< const DRes::ModuleRule * >matched_module_rules
Set of module rules against which this functor has been tested and found to match.
std::set< const DRes::BackendRule * >matched_backend_rules
Set of backend rules against which this functor has been tested and found to match.

Public Functions Documentation

function getRuntimeAverage

virtual double getRuntimeAverage()

Reimplemented by: Gambit::module_functor_common::getRuntimeAverage

Interfaces for runtime optimization Need to be implemented by daughters

function getInvalidationRate

virtual double getInvalidationRate()

Reimplemented by: Gambit::module_functor_common::getInvalidationRate

function setFadeRate

virtual void setFadeRate(
    double 
)

Reimplemented by: Gambit::module_functor_common::setFadeRate

function notifyOfInvalidation

virtual void notifyOfInvalidation(
    const str & 
)

Reimplemented by: Gambit::module_functor_common::notifyOfInvalidation

function reset

virtual void reset()

Reimplemented by: Gambit::module_functor_common::reset

function functor

functor(
    str func_name,
    str func_capability,
    str result_type,
    str origin_name,
    Models::ModelFunctorClaw & claw
)

Constructor.

function ~functor

inline virtual ~functor()

Destructor.

function calculate

virtual void calculate()

Virtual calculate(); needs to be redefined in daughters.

Reimplemented by: Gambit::module_functor::calculate, Gambit::module_functor::calculate, Gambit::module_functor< void >::calculate

function reset_and_calculate

virtual void reset_and_calculate()

Reset-then-recalculate method.

function setStatus

void setStatus(
    FunctorStatus stat
)

Setter for status.

function setInUse

inline virtual void setInUse(
    bool 
)

Set the inUse flag (must be overridden in derived class to have any effect).

Reimplemented by: Gambit::backend_functor_common::setInUse, Gambit::backend_functor_common::setInUse, Gambit::backend_functor_common::setInUse, Gambit::backend_functor_common::setInUse, Gambit::backend_functor_common::setInUse

function setPurpose

void setPurpose(
    str purpose
)

Setter for purpose (relevant only for next-to-output functors)

function setVertexID

void setVertexID(
    int ID
)

Setter for vertex ID (used in printer system)

function setTimingVertexID

void setTimingVertexID(
    int ID
)

Set ID for timing ‘vertex’ (used in printer system)

Acquire ID for timing ‘vertex’ (used in printer system)

function name

str name() const

Getter for the wrapped function’s name.

function capability

str capability() const

Getter for the wrapped function’s reported capability.

function type

str type() const

Getter for the wrapped function’s reported return type.

function origin

str origin() const

Getter for the wrapped function’s origin (module or backend name)

function version

virtual str version() const

Getter for the version of the wrapped function’s origin (module or backend)

Reimplemented by: Gambit::backend_functor_common::version, Gambit::backend_functor_common::version, Gambit::backend_functor_common::version, Gambit::backend_functor_common::version, Gambit::backend_functor_common::version

function safe_version

virtual str safe_version() const

Getter for the ‘safe’ incarnation of the version of the wrapped function’s origin (module or backend)

Reimplemented by: Gambit::backend_functor_common::safe_version, Gambit::backend_functor_common::safe_version, Gambit::backend_functor_common::safe_version, Gambit::backend_functor_common::safe_version, Gambit::backend_functor_common::safe_version

function status

FunctorStatus status() const

Getter for the functors current status.

function isAvailable

bool isAvailable() const

Checks whether the functor is available (or even already activated)

Checks whether the functor is available (or even already activate)

function isActive

bool isActive() const

Checks whether the functor is active.

Checks whether the functor is active (or even hyperactive)

function isDisabled

bool isDisabled() const

Checks whether the functor is disabled (discriminant is negative)

function isEnabled

bool isEnabled() const

Checks whether the functor is enabled (discriminant is non negative)

function quantity

sspair quantity() const

Getter for the overall quantity provided by the wrapped function (capability-type pair)

function purpose

str purpose() const

Getter for purpose (relevant for output nodes, aka helper structures for the dep. resolution)

function citationKey

str citationKey() const

Getter for the citation key.

Getter for citation key.

function vertexID

int vertexID() const

Getter for vertex ID.

function timingVertexID

int timingVertexID() const

Getter for timing vertex ID.

function label

str label() const

Getter for string label.

Getter for the printer label.

function timingLabel

str timingLabel() const

Getter for the printer timing label.

function requiresPrinting

virtual bool requiresPrinting() const

Getter indicating if the wrapped function’s result should to be printed.

Reimplemented by: Gambit::module_functor::requiresPrinting, Gambit::module_functor::requiresPrinting

function requiresTimingPrinting

virtual bool requiresTimingPrinting() const

Getter indicating if the timing data for this function’s execution should be printed.

Reimplemented by: Gambit::module_functor_common::requiresTimingPrinting

function setPrintRequirement

virtual void setPrintRequirement(
    bool flag
)

Setter for indicating if the wrapped function’s result should to be printed.

Reimplemented by: Gambit::module_functor::setPrintRequirement, Gambit::module_functor::setPrintRequirement

function setTimingPrintRequirement

virtual void setTimingPrintRequirement(
    bool flag
)

Setter for indicating if the timing data for this function’s execution should be printed.

Reimplemented by: Gambit::module_functor_common::setTimingPrintRequirement

Setter for indicating if the timing data for this functor should be printed.

function setNestedList

virtual void setNestedList(
    std::vector< functor * > & 
)

Set the ordered list of pointers to other functors that should run nested in a loop managed by this one.

Reimplemented by: Gambit::module_functor_common::setNestedList

function setIteration

virtual void setIteration(
    long long 
)

Set the iteration number in a loop in which this functor runs.

Reimplemented by: Gambit::module_functor_common::setIteration

function canBeLoopManager

virtual bool canBeLoopManager()

Getter for revealing whether this is permitted to be a manager functor.

Reimplemented by: Gambit::module_functor_common::canBeLoopManager

function needsLoopManager

virtual bool needsLoopManager()

Getter for revealing whether this functor needs a loop manager.

Reimplemented by: Gambit::module_functor_common::needsLoopManager

function loopManagerCapability

virtual str loopManagerCapability()

Getter for revealing the required capability of the wrapped function’s loop manager.

Reimplemented by: Gambit::module_functor_common::loopManagerCapability

function loopManagerType

virtual str loopManagerType()

Getter for revealing the required type of the wrapped function’s loop manager.

Reimplemented by: Gambit::module_functor_common::loopManagerType

function loopManagerName

virtual str loopManagerName()

Getter for revealing the name of the wrapped function’s assigned loop manager.

Reimplemented by: Gambit::module_functor_common::loopManagerName

function loopManagerOrigin

virtual str loopManagerOrigin()

Getter for revealing the module of the wrapped function’s assigned loop manager.

Reimplemented by: Gambit::module_functor_common::loopManagerOrigin

function breakLoop

virtual void breakLoop()

Tell the functor that the loop it manages should break now.

Reimplemented by: Gambit::module_functor_common::breakLoop

function dependencies

virtual std::set< sspair > dependencies()

Getter for listing currently activated dependencies.

Reimplemented by: Gambit::module_functor_common::dependencies

function backendclassloading

virtual std::set< sspair > backendclassloading()

Getter for listing backends that require class loading.

Reimplemented by: Gambit::module_functor_common::backendclassloading

function backendgroups

virtual std::set< str > backendgroups()

Getter for listing backend requirement groups.

Reimplemented by: Gambit::module_functor_common::backendgroups

function backendreqs

virtual std::set< sspair > backendreqs()

Getter for listing all backend requirements.

Reimplemented by: Gambit::module_functor_common::backendreqs

function backendreqs

virtual std::set< sspair > backendreqs(
    str 
)

Getter for listing backend requirements from a specific group.

Reimplemented by: Gambit::module_functor_common::backendreqs

function backendspermitted

virtual std::set< sspair > backendspermitted(
    sspair 
)

Getter for listing permitted backends.

Reimplemented by: Gambit::module_functor_common::backendspermitted

function backendreq_tags

virtual std::set< str > backendreq_tags(
    sspair 
)

Getter for listing tags associated with backend requirements.

Reimplemented by: Gambit::module_functor_common::backendreq_tags

function forcematchingbackend

virtual std::set< sspair > forcematchingbackend(
    str 
)

Getter for listing backend requirements that must be resolved from the same backend.

Reimplemented by: Gambit::module_functor_common::forcematchingbackend

function backend_conditional_dependencies

virtual std::set< sspair > backend_conditional_dependencies(
    str ,
    str ,
    str ,
    str 
)

Getter for listing backend-specific conditional dependencies (4-string version)

Reimplemented by: Gambit::module_functor_common::backend_conditional_dependencies

function backend_conditional_dependencies

virtual std::set< sspair > backend_conditional_dependencies(
    str req,
    str type,
    str be
)

Getter for backend-specific conditional dependencies (3-string version)

Reimplemented by: Gambit::module_functor_common::backend_conditional_dependencies

function backend_conditional_dependencies

virtual std::set< sspair > backend_conditional_dependencies(
    functor * be_functor
)

Getter for backend-specific conditional dependencies (backend functor pointer version)

Reimplemented by: Gambit::module_functor_common::backend_conditional_dependencies

function model_conditional_dependencies

virtual std::set< sspair > model_conditional_dependencies(
    str model
)

Getter for listing model-specific conditional dependencies (matches also on parents and friends)

Reimplemented by: Gambit::module_functor_common::model_conditional_dependencies

function model_conditional_dependencies_exact

virtual std::set< sspair > model_conditional_dependencies_exact(
    str model
)

Getter for listing model-specific conditional dependencies (matches on the exact model)

Reimplemented by: Gambit::module_functor_common::model_conditional_dependencies_exact

function model_conditional_backend_reqs

virtual std::set< sspair > model_conditional_backend_reqs(
    str model
)

Getter for listing model-specific conditional backend requirements (matches also on parents and friends)

Reimplemented by: Gambit::module_functor_common::model_conditional_backend_reqs

function model_conditional_backend_reqs_exact

virtual std::set< sspair > model_conditional_backend_reqs_exact(
    str model
)

Getter for listing model-specific conditional backend requirements (matches on the exact model)

Reimplemented by: Gambit::module_functor_common::model_conditional_backend_reqs_exact

function resolveDependency

virtual void resolveDependency(
    functor * 
)

Resolve a dependency using a pointer to another functor object.

Reimplemented by: Gambit::module_functor_common::resolveDependency

function resolveLoopManager

virtual void resolveLoopManager(
    functor * 
)

Set this functor’s loop manager (if it has one)

Reimplemented by: Gambit::module_functor_common::resolveLoopManager

function resolveBackendReq

virtual void resolveBackendReq(
    functor * 
)

Resolve a backend requirement using a pointer to another functor object.

Reimplemented by: Gambit::module_functor_common::resolveBackendReq

function notifyOfModel

virtual void notifyOfModel(
    str 
)

Notify the functor that a certain model is being scanned, so that it can activate itself accordingly.

Reimplemented by: Gambit::module_functor_common::notifyOfModel

Notify the functor that a certain model is being scanned, so that it can activate its dependencies accordingly.

function notifyOfDependee

virtual void notifyOfDependee(
    functor * 
)

Notify the functor that it is being used to fill a dependency of another functor.

Reimplemented by: Gambit::module_functor_common::notifyOfDependee

function notifyOfBackends

virtual void notifyOfBackends(
    std::map< str, std::set< str > > 
)

Indicate to the functor which backends are actually loaded and working.

Reimplemented by: Gambit::module_functor_common::notifyOfBackends

function print

virtual void print(
    Printers::BasePrinter * printer,
    const int pointID,
    int thread_num
)

Printer function.

Reimplemented by: Gambit::module_functor< void >::print, Gambit::module_functor::print, Gambit::module_functor::print

Print function.

function print

virtual void print(
    Printers::BasePrinter * printer,
    const int pointID
)

Printer function (no-thread-index short-circuit)

Reimplemented by: Gambit::module_functor< void >::print, Gambit::module_functor::print, Gambit::module_functor::print

function retrieve_invalid_point_exception

virtual invalid_point_exception * retrieve_invalid_point_exception()

Retrieve the previously saved exception generated when this functor invalidated the current point in model space.

Reimplemented by: Gambit::module_functor_common::retrieve_invalid_point_exception

function notifyOfIniOptions

void notifyOfIniOptions(
    const Options & opt
)

Notify the functor about an instance of the options class that contains information from its corresponding ini-file entry in the auxiliaries or observables section.

function setOption

template <typename TYPE >
inline void setOption(
    const str & key,
    const TYPE val
)

Set an option for the functor directly (for use in standalone executables).

function getOptions

safe_ptr< Options > getOptions()

Return a safe pointer to the options that this functor is supposed to run with (e.g. from the ini file).

function notifyOfSubCaps

void notifyOfSubCaps(
    const str & subcap_string
)

Notify the functor about a string in YAML that contains the sub-capability information (for use in standalones)

function notifyOfSubCaps

void notifyOfSubCaps(
    const Options & subcaps
)

Notify the functor about an instance of the options class that contains sub-capability information.

function setSubCap

template <typename TYPE >
inline void setSubCap(
    const str & key,
    const TYPE val
)

Set a sub-capability (subcap)for the functor directly (for use in standalone executables).

function getSubCaps

safe_ptr< Options > getSubCaps()

Return a safe pointer to the subcaps that this functor realises it is supposed to facilitate downstream calculation of.

function getDependees

safe_ptr< std::set< sspair > > getDependees()

Return a safe pointer to the vector of all capability,type pairs of functors arranged downstream of this one in the dependency tree.

function getAllowedModels

const std::set< str > & getAllowedModels()

Getter for listing allowed models.

function getConditionalModels

const std::set< str > & getConditionalModels()

Getter for listing conditional models.

function getModelGroups

const std::map< str, std::set< str > > & getModelGroups()

Getter for map of model groups and the set of models in each group.

function allModelsAllowed

bool allModelsAllowed()

Test whether the functor is allowed to be used with all models.

function modelAllowed

bool modelAllowed(
    str model
)

Test whether the functor is always allowed (either explicitly or implicitly) to be used with a given model.

Test whether the functor is allowed (either explicitly or implicitly) to be used with a given model.

function modelExplicitlyAllowed

bool modelExplicitlyAllowed(
    str model
)

Test whether the functor is explictly always allowed to be used with a given model.

Test whether the functor has been explictly allowed to be used with a given model.

function setAllowedModel

void setAllowedModel(
    str model
)

Add a model to the internal list of models for which this functor is allowed to be used.

function modelComboAllowed

bool modelComboAllowed(
    std::set< str > combo
)

Test whether the functor is allowed (either explicitly or implicitly) to be used with a given combination of models.

function modelComboExplicitlyAllowed

bool modelComboExplicitlyAllowed(
    std::set< str > combo
)

Test whether the functor has been explictly allowed to be used with a given combination of models.

function setModelGroup

void setModelGroup(
    str group,
    str contents
)

Add a model group definition to the internal list of model groups.

function setAllowedModelGroupCombo

void setAllowedModelGroupCombo(
    str groups
)

Add a combination of model groups to the internal list of combinations for which this functor is allowed to be used.

Add a model group combination to the internal list of combinations for which this functor is allowed to be used.

function addMatchedObservable

void addMatchedObservable(
    const DRes::Observable * obs
)

Add an observable to the set of those that this functor matches.

function getMatchedObservables

const std::set< const DRes::Observable * > & getMatchedObservables()

Retrieve the set of observables that this functor matches.

function addMatchedModuleRule

void addMatchedModuleRule(
    const DRes::ModuleRule * r
)

Add a module rule to the set of those against which this functor has been tested and found to match.

function addMatchedBackendRule

void addMatchedBackendRule(
    const DRes::BackendRule * r
)

Add a backend rule to the set of those against which this functor has been tested and found to match.

function getMatchedModuleRules

const std::set< const DRes::ModuleRule * > & getMatchedModuleRules()

Retrieve the set of module rules against which this functor has been tested and found to match.

function getMatchedBackendRules

const std::set< const DRes::BackendRule * > & getMatchedBackendRules()

Retrieve the set of backend rules against which this functor has been tested and found to match.

function getMatchedRules

template <class RuleT >
const std::set< RuleT * > & getMatchedRules()

Retrieve matched rules by type.

function getMatchedRules

const std::set< const DRes::ModuleRule * > & getMatchedRules()

Protected Functions Documentation

function reset

virtual void reset(
    int 
)

Reset functor for one thread only.

Reimplemented by: Gambit::module_functor_common::reset

function failBigTime

static void failBigTime(
    str method
)

Attempt to retrieve a dependency or model parameter that has not been resolved.

function allowed_parent_or_friend_exists

inline bool allowed_parent_or_friend_exists(
    str model
)

Test if there is a model in the functor’s allowedModels list as which this model can be interpreted.

function in_allowed_combo

inline bool in_allowed_combo(
    str model
)

Check that a model is actually part of a combination that is allowed to be used with this functor.

function contains_anything_interpretable_as_member_of

inline bool contains_anything_interpretable_as_member_of(
    std::set< str > combo,
    str group
)

Test whether any of the entries in a given model group is a valid interpretation of any members in a given combination.

function has_common_elements

inline bool has_common_elements(
    std::set< str > combo,
    str group
)

Work out whether a given combination of models and a model group have any elements in common.

function find_friend_or_parent_model_in_map

str find_friend_or_parent_model_in_map(
    str model,
    std::map< str, std::set< sspair > > karta
)

Try to find a parent or friend model in some user-supplied map from models to sspair vectors.

Try to find a parent or friend model in some user-supplied map from models to sspair vectors Preferentially returns the ’least removed’ parent or friend, i.e. less steps back in the model lineage.

Protected Attributes Documentation

variable myName

str myName;

Internal storage of the function name.

variable myCapability

str myCapability;

Internal storage of exactly what the function calculates.

variable myType

str myType;

Internal storage of the type of what the function calculates.

variable myOrigin

str myOrigin;

Internal storage of the name of the module or backend to which the function belongs.

variable myPurpose

str myPurpose;

Purpose of the function (relevant for output and next-to-output functors)

variable myCitationKey

str myCitationKey;

Citation key: BibTex key of the reference.

variable myClaw

const Models::ModelFunctorClaw * myClaw;

Bound model functor claw, for checking relationships between models.

variable myLabel

const str myLabel;

String label, used to label functor results for printer system.

variable myTimingLabel

const str myTimingLabel;

String label, used to label functor timing data for printer system.

variable myStatus

FunctorStatus myStatus;

Status:

variable myVertexID

int myVertexID;

Internal storage of the vertex ID number used by the printer system to identify functors.

variable myTimingVertexID

int myTimingVertexID;

ID assigned by printers to the timing data output stream.

variable verbose

bool verbose;

Debug flag.

variable myOptions

Options myOptions;

Internal storage of function options, as a YAML node.

variable mySubCaps

Options mySubCaps;

Internal storage of function sub-capabilities, as a YAML node.

variable myDependees

std::set< sspair > myDependees;

List of all capability,type pairs of functors downstream of this one in the dependency tree.

variable allowedModels

std::set< str > allowedModels;

List of allowed models.

variable conditionalModels

std::set< str > conditionalModels;

List of conditional models.

variable allowedGroupCombos

std::set< std::set< str > > allowedGroupCombos;

List of allowed model group combinations.

variable modelGroups

std::map< str, std::set< str > > modelGroups;

Map from model group names to group contents.

variable matched_observables

std::set< const DRes::Observable * > matched_observables;

The set of observables that this functor matches.

variable matched_module_rules

std::set< const DRes::ModuleRule * > matched_module_rules;

Set of module rules against which this functor has been tested and found to match.

variable matched_backend_rules

std::set< const DRes::BackendRule * > matched_backend_rules;

Set of backend rules against which this functor has been tested and found to match.


Updated on 2024-07-18 at 13:53:30 +0000