30 #include "utility/kernel/NamedEntity.h" 31 #include "ActionRelationships.h" 38 class ActionWrapperList;
48 std::string description;
53 void clean_names(
void);
54 bool incompatible(
const Action &f)
const;
55 void multiplica(
const double &d);
56 void suma(
const Action &f);
59 Action(
const std::string &n=
"",
const std::string &descrip=
"");
63 inline void setName(
const std::string &nmb)
68 {
return description; }
71 { description= desc; }
73 {
return relaciones; }
74 inline double getWeightingFactor(
void)
const 76 inline void setWeightingFactor(
const double &f)
79 inline bool notDeterminant(
void)
const 81 void setNotDeterminant(
const bool &b)
84 typedef std::map<std::string,float> map_descomp;
87 boost::python::dict
getPyDict(
void)
const;
88 void setPyDict(
const boost::python::dict &);
102 inline bool Nula(
const double &tol= zero)
const 103 {
return (fabs(f_pond)<tol); }
137 std::vector<double>
getCoefficients(
const std::vector<std::string> &)
const;
139 virtual void Print(std::ostream &os)
const;
142 std::ostream &operator<<(std::ostream &os,
const Action &acc);
147 template <
class InputIterator>
151 InputIterator i=begin;
152 retval= (*i).getName(); i++;
154 retval+=
"," + (*i).getName();
159 template <
class InputIterator>
163 InputIterator i=begin;
164 retval= (*i)->getName(); i++;
166 retval+=
"," + (*i)->getName();
map_descomp getComponents(void) const
When the actions is a combination return its decomposition.
Definition: Action.cc:70
bool Compatible(const Action &f) const
Return true if this actions is compatible with the argument one.
Definition: Action.h:93
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Action.cc:121
friend Action operator*(const Action &f, const double &d)
Product by a scalar.
Definition: Action.h:127
static const double zero
Treshold to consider the action as zero.
Definition: Action.h:58
List of representative values of actions (ActionWrapper objects).
Definition: ActionWrapperList.h:42
void setName(const std::string &nmb)
Sets the name to the action.
Definition: Action.h:63
Routines to generate combinations of actions.
bool Incompatible(const Action &) const
Return true if this actions is not compatible with the argument one, so they cannot be present both i...
Definition: Action.cc:272
bool Simple(void) const
Return true if the action is not a combination of simpler ones.
Definition: Action.cc:52
std::string actionPtrsNames(InputIterator begin, InputIterator end)
Returns a list with the action names.
Definition: Action.h:160
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Action.cc:132
bool incompatibles(const Action &acc_i, const Action &acc_j)
Return true if actions are incompatible.
Definition: Action.cc:355
Action & operator+=(const Action &f)
Addition.
Definition: Action.h:118
Action(const std::string &n="", const std::string &descrip="")
Default constructor.
Definition: Action.cc:39
std::string & Name(void)
Return a reference to the object name.
Definition: NamedEntity.h:52
boost::python::list getCoefficientsPy(const boost::python::list &) const
When it's a combination, it returns the factors that multiply each of the actions in the argument...
Definition: Action.cc:162
Action or linear combination of actions.
Definition: Action.h:46
Action & operator*=(const double &d)
Producto por un escalar.
Definition: Action.h:112
std::string actionsNames(InputIterator begin, InputIterator end)
Returns a list with the action names.
Definition: Action.h:148
bool ContainsAnyOf(const ActionWrapper &) const
Return true if any of the given actions is found on this container.
Definition: Action.cc:309
const std::string & getDescription(void) const
Return the description of the action.
Definition: Action.h:67
boost::python::dict getComponentsPy(void) const
Return the action components in a Python dictionary.
Definition: Action.cc:107
virtual void Print(std::ostream &os) const
Print stuff.
Definition: Action.cc:348
static Action NULA(void)
Return una acción nula.
Definition: Action.cc:44
bool Contains(const Action &f) const
Return true if this actions contains the given one.
Definition: Action.cc:284
friend Action operator+(const Action &f1, const Action &f2)
Addition.
Definition: Action.h:130
const std::string getExpandedName(void) const
Return the expandend name by applying the distributive property of the multiplication so...
Definition: Action.cc:58
void setDescription(const std::string &desc)
Set the description of the action.
Definition: Action.h:70
Base class for action design values and action groups.
Definition: ActionWrapper.h:42
Object identified by a name.
Definition: NamedEntity.h:37
std::vector< double > getCoefficients(const std::vector< std::string > &) const
When it's a combination, it returns the factors that multiply each of the actions in the argument...
Definition: Action.cc:145
Action GetMult(const double &d) const
Return la acción multiplicada por un escalar.
Definition: Action.h:105
Relationship of an action with the other ones.
Definition: ActionRelationships.h:39
friend Action operator*(const double &d, const Action &f)
Product by a scalar.
Definition: Action.h:124
Family of actions (permanent, variable, accidental,...)
Definition: ActionsFamily.h:44
bool Nula(const double &tol=zero) const
Return verdadero si la acción es nula.
Definition: Action.h:102