Skip to content

Class Paramita::CategoricalParameter

Represents a categorical parameter with discrete choices.

Values for the choices are std::string.

  • #include <ParameterSpace.hpp>

Inherits the following classes: Paramita::Parameter

Public Functions

Type Name
CategoricalParameter (std::string default_value, std::vector< std::string > choices)
Construct a new categorical parameter.
CategoricalParameter (const CategoricalParameter &)
CategoricalParameter (CategoricalParameter &&) noexcept
std::vector< std::string > choices () const
virtual ParameterType default_value () override const
The default value for this parameter.
virtual bool is_valid (ParameterType value) override const
Checks that the value is in the domain and has the correct type.
CategoricalParameter & operator= (const CategoricalParameter &) = delete
CategoricalParameter & operator= (CategoricalParameter &&) = delete
~CategoricalParameter () override

Public Functions inherited from Paramita::Parameter

See Paramita::Parameter

Type Name
Parameter () = default
Parameter (const Parameter &) = delete
Deleted constructor (pure interface).
Parameter (Parameter &&) = delete
Deleted constructor (pure interface).
virtual ParameterType default_value () const = 0
The default value for this parameter.
virtual bool is_valid (ParameterType value) const = 0
Checks that the value is in the domain and has the correct type.
Parameter & operator= (const Parameter & container) = delete
Deleted constructor (pure interface).
Parameter & operator= (Parameter &&) = delete
Deleted constructor (pure interface).
virtual ~Parameter () = default

Public Functions Documentation

function CategoricalParameter [1/3]

Construct a new categorical parameter.

inline Paramita::CategoricalParameter::CategoricalParameter (
    std::string default_value,
    std::vector< std::string > choices
) 

Parameters:

  • default_value The default value used when the parameter is not specified.
  • choices A vector containing all possible string options available for this parameter.

function CategoricalParameter [2/3]

Paramita::CategoricalParameter::CategoricalParameter (
    const CategoricalParameter &
) 

function CategoricalParameter [3/3]

Paramita::CategoricalParameter::CategoricalParameter (
    CategoricalParameter &&
) noexcept

function choices

std::vector< std::string > Paramita::CategoricalParameter::choices () const

function default_value

The default value for this parameter.

virtual ParameterType Paramita::CategoricalParameter::default_value () override const

Returns:

The default value.

Implements Paramita::Parameter::default_value


function is_valid

Checks that the value is in the domain and has the correct type.

virtual bool Paramita::CategoricalParameter::is_valid (
    ParameterType value
) override const

Parameters:

  • value The value to check.

Returns:

True if the value is valid.

Implements Paramita::Parameter::is_valid


function operator=

CategoricalParameter & Paramita::CategoricalParameter::operator= (
    const CategoricalParameter &
) = delete

function operator=

CategoricalParameter & Paramita::CategoricalParameter::operator= (
    CategoricalParameter &&
) = delete

function ~CategoricalParameter

Paramita::CategoricalParameter::~CategoricalParameter () override