64 int size_family = int(
getDouble(keyPrefix +
"_SIZE_FAMILY", 1));
66 std::ostringstream str;
67 str << keyPrefix <<
"\n" <<
"size fam" << size_family;
71 std::vector< std::map <std::string, std::string > > sliced_maps;
73 for (
int i = 0; i < size_family; i++) {
83 for (
int token_counter = 0; token_counter < size_family; ++token_counter) {
84 if (token_counter >= (
int)tokens.size()) {
85 std::ostringstream errorMessage;
86 errorMessage <<
"Error in " << key <<
": not enough tokens.";
91 std::ostringstream str;
92 str <<
"found token " << tokens[token_counter] <<
" position " << token_counter;
95 sliced_maps[token_counter][key] = tokens[token_counter];
99 for (
int i = 0; i < size_family; i++) {
116 double best_stimulus = -1;
117 for (std::vector<MSSOTLPolicy5DStimulus*>::const_iterator it =
family.begin(); it !=
family.end(); it++) {
118 double temp_stimulus = (*it)->computeDesirability(vehInMeasure, vehOutMeasure, vehInDispersionMeasure, vehOutDispersionMeasure);
120 std::ostringstream str;
121 str <<
"STIMULUS: " << temp_stimulus;
124 if (temp_stimulus > best_stimulus) {
125 best_stimulus = temp_stimulus;
130 std::ostringstream str;
131 str <<
"BEST STIMULUS: " << best_stimulus;
134 return best_stimulus;
144 std::ostringstream ot;
145 for (
int i = 0; i < (int)
family.size(); i++) {
146 ot <<
" gaussian " << i <<
":" <<
family[i]->getMessage();
#define WRITE_MESSAGE(msg)
std::vector< MSSOTLPolicy5DStimulus * > family
virtual double computeDesirability(double vehInMeasure, double vehOutMeasure)
Calculates the desirability of the policy.
Parameterised::Map default_values
std::vector< std::string > params_names
MSSOTLPolicy5DFamilyStimulus(std::string keyPrefix, const Parameterised::Map ¶meters)
This class determines the desirability algorithm of a MSSOTLPolicy when used in combination with a hi...
std::map< std::string, std::string > Map
parameters map
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
std::vector< std::string > getVector()
return vector of strings