MultiAgentDecisionProcess
|
StateFactorDiscrete is a class that represents a state variable, or factor. More...
#include <StateFactorDiscrete.h>
Public Member Functions | |
Index | AddStateFactorValue (const std::string &v="rec.undef.by StateFactorDiscrete") |
Adds a value to this state factor and returns the new index. More... | |
std::string | GetStateFactorValue (Index domainI) const |
StateFactorDiscrete & | operator= (const StateFactorDiscrete &o) |
Copy assignment operator. More... | |
std::string | SoftPrint () const |
Soft prints this state factor. More... | |
StateFactorDiscrete (const std::string &n="undef. name", const std::string &d="undef. descr.") | |
(default) Constructor More... | |
StateFactorDiscrete (size_t nrVs, const std::string &n="undef. name", const std::string &d="undef. descr.") | |
Constructor specifying the number of values. More... | |
StateFactorDiscrete (const StateFactorDiscrete &a) | |
Copy constructor. More... | |
~StateFactorDiscrete () | |
Destructor. More... | |
Public Member Functions inherited from NamedDescribedEntity | |
std::string | GetDescription () const |
Get the description of the NamedDescribedEntity. More... | |
std::string | GetName () const |
Get the name of the NamedDescribedEntity. More... | |
NamedDescribedEntity (const std::string &name=std::string("undefined"), const std::string &description=std::string("undefined")) | |
(default) Constructor More... | |
void | Print () const |
Prints the name and description (by default). More... | |
void | PrintBrief () const |
Prints the name (by default). More... | |
void | SetDescription (const std::string &description) |
Set the description. More... | |
void | SetName (const std::string &name) |
Set the name. More... | |
virtual std::string | SoftPrintBrief () const |
Returns the name (if not reimplemented). More... | |
virtual | ~NamedDescribedEntity () |
Destructor. More... | |
Private Attributes | |
size_t | _m_domainSize |
The size of the domain. More... | |
std::vector< std::string > | _m_domainValues |
The vector containing the domain values. More... | |
Additional Inherited Members | |
Protected Attributes inherited from NamedDescribedEntity | |
std::string | _m_description |
The description. More... | |
std::string | _m_name |
The name. More... | |
StateFactorDiscrete is a class that represents a state variable, or factor.
It has a name and description (handled by NamedDescribedEntity), as well as a domain: the list of discrete values it can take. These domain values are indexed and associated with a string.
E.g. a state variable 'color' could have domain 0-'red', 1-'blue', 2-'yellow'.
And Xpos could have domain: 0 -'-2', 1-'-1', 2-'0', 3-'+1', 4-'+2'
In the future we might include special state factor types for numerical domains(?).
StateFactorDiscrete::StateFactorDiscrete | ( | const std::string & | n = "undef. name" , |
const std::string & | d = "undef. descr." |
||
) |
(default) Constructor
StateFactorDiscrete::StateFactorDiscrete | ( | size_t | nrVs, |
const std::string & | n = "undef. name" , |
||
const std::string & | d = "undef. descr." |
||
) |
Constructor specifying the number of values.
This constructs n unnamed values.
References _m_domainSize.
StateFactorDiscrete::StateFactorDiscrete | ( | const StateFactorDiscrete & | a | ) |
Copy constructor.
StateFactorDiscrete::~StateFactorDiscrete | ( | ) |
Destructor.
Index StateFactorDiscrete::AddStateFactorValue | ( | const std::string & | v = "rec.undef.by StateFactorDiscrete" | ) |
Adds a value to this state factor and returns the new index.
I.e., the domain index or 'state factor value' index.
References _m_domainSize, and _m_domainValues.
|
inline |
StateFactorDiscrete & StateFactorDiscrete::operator= | ( | const StateFactorDiscrete & | o | ) |
Copy assignment operator.
|
virtual |
Soft prints this state factor.
Reimplemented from NamedDescribedEntity.
References _m_domainValues, NamedDescribedEntity::GetDescription(), and NamedDescribedEntity::GetName().
|
private |
The size of the domain.
Referenced by AddStateFactorValue(), and StateFactorDiscrete().
|
private |
The vector containing the domain values.
E.g. for factor 'color' this contains 'blue', 'red', etc.
Referenced by AddStateFactorValue(), and SoftPrint().