13.07.2015 Views

TESIS DOCTORAL - Robotics Lab - Universidad Carlos III de Madrid

TESIS DOCTORAL - Robotics Lab - Universidad Carlos III de Madrid

TESIS DOCTORAL - Robotics Lab - Universidad Carlos III de Madrid

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

136 Chapter 7. Implementing the <strong>de</strong>cision making system7.3.1 The external robot’s world class <strong>de</strong>signAfter the outline of the DMS class <strong>de</strong>sign has been presented, each part is <strong>de</strong>tailed. First,Figure 7.3 presents the full class diagram with the relationships among all classes relatedto the external robot’s world.In this work, lots of elements require a unique i<strong>de</strong>ntification. Then, all classes thatneed it inherit from the CId class which provi<strong>de</strong>s the operations required for managing ani<strong>de</strong>ntifier and a name.About the CObject class, it has a set of states which corresponds to the possible statesfor each object (the related_states attribute). In the same way, each object has a set ofactions which are accessed by the actions attribute.Objects always are in a particular state in relation to the robot. Then, the current stateand the previous one are referred by the state and oldstate attributes. When the state ofan object is updated, these pointers are modified. Both values are used to <strong>de</strong>fine the statetransitions for each item.In the class CAction, the events for starting and stopping an action are in the events_startand events_stop attributes. Since more than one event can be used to start/stop the action,they are brought together in vectors of CEvent objects. At the same time, each actionkeeps a pointer to its object (item); and the effects are stored as a vector of CEffectOfActioninstances accessed through the effects field.Since the same action can have different sort of effects, each effect has a different eventwhich indicates when it has to be applied. This is consi<strong>de</strong>red in the class CEffectOfActionin the attribute event_param. This element relates the internal robot’s world to the externalone; then, it keeps track of the action which provokes the effect (the action attribute) and theaffected drive (the drive attribute). The quantity of the effect is represented as an integer.In relation to the states of an object, each state remembers the object it is linked to bythe item attribute and, also, the event which <strong>de</strong>termines a new transition to this state. Sincestates for the same object are incompatible (in this implementation an object cannot be intwo different states at the same time), one event is enough to <strong>de</strong>termine a transition, and an“exit” event is not necessary. As said, more than one event can <strong>de</strong>termine the transition tothe state, so a vector of events is consi<strong>de</strong>red at each state.Besi<strong>de</strong>s, certain objects act as external stimuli; then, there is a connection betweenstates and external stimuli which is represented in the class CRelatedState class by a vectorof pointers to the external stimuli where the state takes part.External stimuli connect the objects and the motivations. This is implemented by meansof the class CExternStimulus. This class relates a particular state of an item (item_stateattribute) to a specific motivation (motivation attribute). The intensity of this stimulus isread from the value attribute.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!