WinnerTakeAll configurator. More...
#include <Neuro/WinnerTakeAllConfigurator.H>
Public Member Functions | |
WinnerTakeAllConfigurator (OptionManager &mgr, const std::string &descrName="Winner-Take-All Configurator", const std::string &tagName="WinnerTakeAllConfigurator") | |
Constructor. | |
virtual | ~WinnerTakeAllConfigurator () |
destructor | |
nub::ref< WinnerTakeAll > | getWTA () const |
Get the chosen WTA. | |
Protected Member Functions | |
virtual void | paramChanged (ModelParamBase *const param, const bool valueChanged, ParamClient::ChangeStatus *status) |
Intercept people changing our ModelParam. | |
Protected Attributes | |
OModelParam< std::string > | itsWTAtype |
type of winner-take-all |
WinnerTakeAll configurator.
This will export the --wta-type=XX command-line option and will instantiate a WTA of the desired type as the option gets assigned a value. As this happens, new options may become available in the command-line. To see them, use --help AFTER you have chosen the type to use. The current WTA may be retrieved using getWTA().
Definition at line 55 of file WinnerTakeAllConfigurator.H.
WinnerTakeAllConfigurator::WinnerTakeAllConfigurator | ( | OptionManager & | mgr, | |
const std::string & | descrName = "Winner-Take-All Configurator" , |
|||
const std::string & | tagName = "WinnerTakeAllConfigurator" | |||
) |
Constructor.
Definition at line 54 of file WinnerTakeAllConfigurator.C.
References ModelComponent::addSubComponent().
WinnerTakeAllConfigurator::~WinnerTakeAllConfigurator | ( | ) | [virtual] |
destructor
Definition at line 66 of file WinnerTakeAllConfigurator.C.
nub::ref< WinnerTakeAll > WinnerTakeAllConfigurator::getWTA | ( | ) | const |
Get the chosen WTA.
You should call this during start() of the ModelComponent that needs the WTA. CAUTION: this may be a rutz::shared_ptr(NULL) if no WTA type has been chosen.
Definition at line 72 of file WinnerTakeAllConfigurator.C.
void WinnerTakeAllConfigurator::paramChanged | ( | ModelParamBase *const | param, | |
const bool | valueChanged, | |||
ParamClient::ChangeStatus * | status | |||
) | [protected, virtual] |
Intercept people changing our ModelParam.
See ModelComponent.H; as parsing the command-line or reading a config file sets our name, we'll also here instantiate a controller of the proper type (and export its options)
Reimplemented from ModelComponent.
Definition at line 79 of file WinnerTakeAllConfigurator.C.
References ModelComponent::addSubComponent(), ModelComponent::getManager(), OModelParam< T >::getVal(), itsWTAtype, MC_RECURSE, ModelComponent::removeSubComponent(), and nub::ref< T >::reset().
OModelParam<std::string> WinnerTakeAllConfigurator::itsWTAtype [protected] |
type of winner-take-all
Definition at line 75 of file WinnerTakeAllConfigurator.H.
Referenced by paramChanged().