30 #include "utility/kernel/NamedEntity.h" 31 #include "ActionRelationships.h" 37 class ActionWrapperList;
46 std::string description;
51 void clean_names(
void);
52 bool incompatible(
const Action &f)
const;
53 void multiplica(
const double &d);
54 void suma(
const Action &f);
57 Action(
const std::string &n=
"",
const std::string &descrip=
"");
61 inline void setName(
const std::string &nmb)
66 {
return description; }
69 { description= desc; }
71 {
return relaciones; }
72 inline double getWeightingFactor(
void)
const 74 inline void setWeightingFactor(
const double &f)
77 inline bool notDeterminant(
void)
const 79 void setNotDeterminant(
const bool &b)
82 typedef std::map<std::string,float> map_descomp;
85 boost::python::dict
getPyDict(
void)
const;
86 void setPyDict(
const boost::python::dict &);
96 inline bool Nula(
const double &tol= zero)
const 97 {
return (fabs(f_pond)<tol); }
131 std::vector<double>
getCoefficients(
const std::vector<std::string> &)
const;
133 virtual void Print(std::ostream &os)
const;
136 std::ostream &operator<<(std::ostream &os,
const Action &acc);
141 template <
class InputIterator>
145 InputIterator i=begin;
146 retval= (*i).getName(); i++;
148 retval+=
"," + (*i).getName();
153 template <
class InputIterator>
157 InputIterator i=begin;
158 retval= (*i)->getName(); i++;
160 retval+=
"," + (*i)->getName();
map_descomp getComponents(void) const
When the actions is a combination return its decomposition.
Definition: Action.cc:68
bool Compatible(const Action &f) const
Return true if this actions is compatible with the argument one.
Definition: Action.h:91
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Action.cc:119
friend Action operator*(const Action &f, const double &d)
Product by a scalar.
Definition: Action.h:121
static const double zero
Treshold to consider the action as zero.
Definition: Action.h:56
void setName(const std::string &nmb)
Sets the name to the action.
Definition: Action.h:61
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:266
bool Simple(void) const
Return true if the action is not a combination of simpler ones.
Definition: Action.cc:50
std::string actionPtrsNames(InputIterator begin, InputIterator end)
Returns a list with the action names.
Definition: Action.h:154
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Action.cc:130
bool incompatibles(const Action &acc_i, const Action &acc_j)
Return true if actions are incompatible.
Definition: Action.cc:285
Action & operator+=(const Action &f)
Addition.
Definition: Action.h:112
Action(const std::string &n="", const std::string &descrip="")
Default constructor.
Definition: Action.cc:37
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:160
Action or linear combination of actions.
Definition: Action.h:44
Action & operator*=(const double &d)
Producto por un escalar.
Definition: Action.h:106
std::string actionsNames(InputIterator begin, InputIterator end)
Returns a list with the action names.
Definition: Action.h:142
const std::string & getDescription(void) const
Return the description of the action.
Definition: Action.h:65
boost::python::dict getComponentsPy(void) const
Return the action components in a Python dictionary.
Definition: Action.cc:105
virtual void Print(std::ostream &os) const
Print stuff.
Definition: Action.cc:278
static Action NULA(void)
Return una acción nula.
Definition: Action.cc:42
friend Action operator+(const Action &f1, const Action &f2)
Addition.
Definition: Action.h:124
const std::string getExpandedName(void) const
Return the expandend name by applying the distributive property of the multiplication so...
Definition: Action.cc:56
void setDescription(const std::string &desc)
Set the description of the action.
Definition: Action.h:68
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:143
Action GetMult(const double &d) const
Return la acción multiplicada por un escalar.
Definition: Action.h:99
Relationship of an action with the other ones.
Definition: ActionRelationships.h:37
friend Action operator*(const double &d, const Action &f)
Product by a scalar.
Definition: Action.h:118
bool Nula(const double &tol=zero) const
Return verdadero si la acción es nula.
Definition: Action.h:96