5 #ifndef BPP_NUMERIC_ABSTRACTPARAMETRIZABLE_H 6 #define BPP_NUMERIC_ABSTRACTPARAMETRIZABLE_H 45 return parameters_.
parameter(prefix_ + name);
48 const std::shared_ptr<Parameter>&
getParameter(
const std::string& name)
const 78 std::unique_ptr< std::vector<size_t>> updatedParameters(
new std::vector<size_t>());
90 void setConstraint(
const std::string& name, std::shared_ptr<ConstraintInterface> constraint)
override 139 if (index >= parameters_.
size())
168 return parameters_.
parameter(prefix_ + name);
192 if (index >= parameters_.
size())
194 return parameters_[index];
199 if (index >= parameters_.
size())
201 return parameters_[index];
222 #endif // BPP_NUMERIC_ABSTRACTPARAMETRIZABLE_H Exception thrown when a parameter is not found, for instance in a ParameterList.
ParameterList parameters_
const std::shared_ptr< Parameter > & getParameter(size_t i) const
std::string getNamespace() const override
void setAllParametersValues(const ParameterList ¶meters) override
Set the parameters values to be equals to those of parameters.
virtual const Parameter & parameter(const std::string &name) const
Get the parameter with name name.
virtual void includeParameters(const ParameterList ¶ms)
Add parameters to the list. If the parameter already exists, only the value is updated, otherwise the new parameter is added at the end of the list.
virtual void reset()
Reset the list: delete all parameters.
virtual ParameterList createSubList(const std::vector< std::string > &names) const
Get given parameters as a sublist.
Parameter & getParameter_(size_t index)
void setConstraint(const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override
Set/Change the constraint associated with one parameter.
virtual bool matchParametersValues(const ParameterList ¶ms, std::vector< size_t > *updatedParameters=0)
Update the parameters from params.
A partial implementation of the Parametrizable interface.
virtual void deleteParameter_(std::string &name)
virtual void deleteParameters(const std::vector< std::string > &names, bool mustExist=true)
Delete several parameters from the list.
void setNamespace(const std::string &prefix) override
Set the namespace for the parameter names.
virtual void shareParameter(const std::shared_ptr< Parameter > ¶m)
Share a parameter at the end of the list.
const std::shared_ptr< Parameter > & getParameter(const std::string &name) const
std::shared_ptr< Parameter > & getParameter(size_t i)
This class is designed to facilitate the manipulation of parameters.
virtual void setAllParametersValues(const ParameterList ¶ms)
Set the parameters to be equals to params.
virtual void setConstraint(std::shared_ptr< ConstraintInterface > constraint)
Set a constraint to this parameter.
virtual void deleteParameter(const std::string &name)
Delete a parameter from the list.
virtual void setParameterValue(const std::string &name, double value)
Set the value of parameter with name name to be equal to value.
double getParameterValue(const std::string &name) const override
Get the value for parameter of name 'name'.
This is the interface for all objects that imply parameters.
Parameter & getParameterWithNamespace_(const std::string &name)
The parameter list object.
virtual void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
virtual void addParameters(const ParameterList ¶ms)
Add new parameters at the end of the list.
AbstractParametrizable(const std::string &prefix)
void setParametersValues(const ParameterList ¶meters) override
Update the parameters from parameters.
const Parameter & getParameterWithNamespace_(const std::string &name) const
bool matchParametersValues(const ParameterList ¶meters) override
Update the parameters from parameters.
virtual void includeParameters_(const ParameterList ¶meters)
virtual bool hasParameter(const std::string &name) const
bool hasParameter(const std::string &name) const override
Tell if there is a parameter with specified name.
virtual ~AbstractParametrizable()
virtual void shareParameters(const ParameterList ¶ms)
Share parameters with a given list. They are added the end of this list.
ParameterList & getParameters_() override
Get all parameters available.
void removeConstraint(const std::string &name) override
Remove the constraint associated with one parameter, if any.
virtual void deleteParameters_(const std::vector< std::string > &names)
virtual ParameterList shareSubList(const std::vector< std::string > &names) const
Share given parameters as a sublist.
virtual void addParameter(const Parameter ¶m)
Add a new parameter at the end of the list.
std::string getParameterNameWithoutNamespace(const std::string &name) const override
Resolves a parameter name according to the current namespace.
void setParameterValue(const std::string &name, double value) override
Set the value of parameter with name name to be equal to value.
virtual void addParameter_(Parameter *parameter)
const Parameter & getParameter_(size_t index) const
virtual void shareParameter_(const std::shared_ptr< Parameter > ¶meter)
virtual double getValue() const
Get the value of this parameter.
virtual void shareParameters_(const ParameterList ¶meters)
virtual void deleteParameter_(size_t index)
Parameter & getParameter_(const std::string &name)
Index out of bounds exception class.
size_t getNumberOfParameters() const override
Get the number of parameters.
virtual const std::shared_ptr< Parameter > & getParameter(size_t i) const
const Parameter & parameter(const std::string &name) const override
Get the parameter with specified name.
virtual void setParametersValues(const ParameterList ¶ms)
Update the parameters from the ones in params that have matching names.
const ParameterList & getParameters() const override
Get all parameters available.
virtual std::shared_ptr< ConstraintInterface > removeConstraint()
Remove the constraint associated to this parameter.
virtual void addParameters_(const ParameterList ¶meters)