8 #include <argos3/core/simulator/simulator.h>
9 #include <argos3/core/simulator/space/space.h>
10 #include <argos3/plugins/simulator/media/tag_medium.h>
29 const std::string& str_id,
34 const std::string& str_payload) :
36 m_cObservableAngle(c_observable_angle),
37 m_fSideLength(f_side_length),
38 m_strPayload(str_payload),
39 m_strInitPayload(str_payload),
108 "\" has no medium associated.");
130 c_space_hash.
UpdateCell(m_nI, m_nJ, m_nK, c_element);
145 m_cGrid.PositionToCell(m_nI, m_nJ, m_nK, c_entity.
GetPosition());
147 m_cGrid.UpdateCell(m_nI, m_nJ, m_nK, c_entity);
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
#define THROW_ARGOSEXCEPTION(message)
This macro throws an ARGoS exception with the passed message.
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
void GetNodeAttributeOrDefault(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer, const T &t_default)
Returns the value of a node's attribute, or the passed default value.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
REGISTER_SPACE_OPERATION(CSpaceOperationAddEntity, CSpaceOperationAddCFloorEntity, CFloorEntity)
CRadians ToRadians(const CDegrees &c_degrees)
Converts CDegrees to CRadians.
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
Basic class for an entity that contains other entities.
void Disable()
Disables the entity.
const std::string & GetId() const
Returns the id of this entity.
std::string GetContext() const
Returns the context of this entity.
bool IsEnabled() const
Returns true if the entity is enabled.
virtual void SetEnabled(bool b_enabled)
Enables or disables an entity.
ssize_t GetIndex() const
Returns the entity index.
const CVector3 & GetPosition() const
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
The abstract definition of a space hash.
virtual void UpdateCell(SInt32 n_x, SInt32 n_y, SInt32 n_z, ENTITY &c_entity)=0
Adds an entity to a cell of the space hash.
virtual SInt32 SpaceToHashTable(Real f_coord, UInt32 un_axis)
Converts a single space coordinate into a space hash cell coordinate.
void AddEntity(ENTITY &c_entity)
Adds an entity of the given type.
void RemoveEntity(ENTITY &c_entity)
Removes an entity of the given type.
The exception that wraps all errors in ARGoS.
It defines the basic type CRadians, used to store an angle value in radians.
It defines the basic type CDegrees, used to store an angle value in degrees.
void ApplyTo(CSpace &c_space, CTagEntity &c_entity)
void ApplyTo(CSpace &c_space, CTagEntity &c_entity)
virtual void SetEnabled(bool b_enabled)
Enables or disables an entity.
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
CTagMedium & GetMedium() const
Returns the medium associated to this tag.
void SetPayload(const std::string &str_payload)
Sets the current payload of the tag.
void SetMedium(CTagMedium &c_medium)
Sets the medium associated to this entity.
CRadians m_cObservableAngle
virtual void Destroy()
Destroys the entity, undoing whatever was done by Init() or by the standalone constructor.
CTagEntity(CComposableEntity *pc_parent)
std::string m_strInitPayload
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
virtual void operator()(CAbstractSpaceHash< CTagEntity > &c_space_hash, CTagEntity &c_element)
Updates the necessary cells of a space hash.
CTagEntityGridUpdater(CGrid< CTagEntity > &c_grid)
virtual bool operator()(CTagEntity &c_entity)
void AddEntity(CTagEntity &c_entity)
Adds the specified entity to the list of managed entities.
void RemoveEntity(CTagEntity &c_entity)
Removes the specified entity from the list of managed entities.