RCL - RoboCLuedo  v1.0
Francesco Ganci - S4143910 - Experimental Robotics Lab - Assignment 1
armor_cluedo.h
Go to the documentation of this file.
1 
2 
14 #ifndef __H_ARMOR_CLUEDO_H__
15 #define __H_ARMOR_CLUEDO_H__
16 
18 
19 #include <vector>
20 #include <iostream>
21 #include <string>
22 
23 
24 
25 
26 
56 class ArmorCluedo : public ArmorTools
57 {
58 public:
59 
60 
70  ArmorCluedo( bool debugmode = ARMOR_DEFAULT_DEBUGMODE );
71 
72 
74  ~ArmorCluedo( );
75 
76 
77 
99  bool Init( std::string ontologyPath );
100 
101 
102 
103  // ======== individuals and classes
104  // methods for adding individuals to the ontology
105 
106 
144  bool AddIndiv( std::string indivname, std::string classname, bool makeDisjoint = true );
145 
146 
147 
164  std::vector<std::string> GetClassOfIndiv( std::string indivname, bool deep );
165 
166 
167 
179  std::vector<std::string> GetIndivOfClass( std::string classname );
180 
181 
182 
192  bool ExistsIndiv( std::string indivname );
193 
194 
195 
196  // ======== properties
197  // methods for checking and adding properties between individuals
198 
199 
215  bool SetObjectProperty( std::string prop, std::string Aelem, std::string Belem );
216 
217 
218 
231  std::vector<std::string> GetValuedOfIndiv( std::string prop, std::string indivname );
232 
233 
234 
235  // ======== hypotheses
236  // methods for formulating and working with hypotheses
237 
238 
250  std::vector<std::string> FindCompleteHypotheses( );
251 
252 
253 
267  std::vector<std::string> FindInconsistentHypotheses( );
268 
269 
270 
291  bool RemoveHypothesis( std::string hypTag );
292 
293 
294 
295  // ======== utilities
296  // general-purpose methods
297 
298 
307  std::string FilterValue( std::string raw );
308 
309 
310 
322  std::vector<std::string> FilterVector( std::vector<std::string>& itemlist );
323 
324 private:
325  // all the entities added
326  std::vector<std::string> individuals;
327 
328  // removed hypotheses
329  std::vector<std::string> DiscardHypotheses;
330 
331  // check if a string exists in one array
332  bool ExistsItem( std::string item, const std::vector<std::string>& container );
333 
334  // track individual
335  bool TrackIndiv( std::string indivname );
336 
337  // disjoint all the individuals
338  void DisjointAllIndiv( std::string from );
339 
340  // search for a specific iterator on a vector
341  // it return vector::end() if the element is not contained
342  std::vector<std::string>::iterator GetPositionOf( std::string tag, std::vector<std::string>& list );
343 };
344 
345 #endif
ArmorCluedo::AddIndiv
bool AddIndiv(std::string indivname, std::string classname, bool makeDisjoint=true)
add an individual to the ontology
Definition: armor_cluedo.cpp:53
ArmorCluedo::SetObjectProperty
bool SetObjectProperty(std::string prop, std::string Aelem, std::string Belem)
set a property true
Definition: armor_cluedo.cpp:131
ArmorCluedo::Init
bool Init(std::string ontologyPath)
initizalize the interface
Definition: armor_cluedo.cpp:34
ArmorCluedo::FilterValue
std::string FilterValue(std::string raw)
rewrite a string like '<uri#value>' into 'value'
Definition: armor_cluedo.cpp:223
ArmorCluedo::GetValuedOfIndiv
std::vector< std::string > GetValuedOfIndiv(std::string prop, std::string indivname)
get the values of a property related to a gven individual
Definition: armor_cluedo.cpp:150
ArmorCluedo::GetIndivOfClass
std::vector< std::string > GetIndivOfClass(std::string classname)
find the individuals belonging to a class
Definition: armor_cluedo.cpp:97
ArmorCluedo::~ArmorCluedo
~ArmorCluedo()
class destructor
Definition: armor_cluedo.cpp:26
ArmorCluedo::FilterVector
std::vector< std::string > FilterVector(std::vector< std::string > &itemlist)
filter all the strings inside the array
Definition: armor_cluedo.cpp:235
ArmorCluedo::FindInconsistentHypotheses
std::vector< std::string > FindInconsistentHypotheses()
find all the inconsistent hypotheses
Definition: armor_cluedo.cpp:184
ArmorTools
A minimal C++ client for aRMOR.
Definition: armor_tools.h:90
ArmorCluedo::ArmorCluedo
ArmorCluedo(bool debugmode=ARMOR_DEFAULT_DEBUGMODE)
class constructor of ArmorCluedo
Definition: armor_cluedo.cpp:18
ArmorCluedo::GetClassOfIndiv
std::vector< std::string > GetClassOfIndiv(std::string indivname, bool deep)
get the class of a given individual
Definition: armor_cluedo.cpp:81
ArmorCluedo
additional utilities for aRMOR
Definition: armor_cluedo.h:56
ArmorCluedo::ExistsIndiv
bool ExistsIndiv(std::string indivname)
check if an individual exists
Definition: armor_cluedo.cpp:112
armor_tools.h
A minimal C++ client for aRMOR.
ArmorCluedo::RemoveHypothesis
bool RemoveHypothesis(std::string hypTag)
discard one hypothesis
Definition: armor_cluedo.cpp:192
ArmorCluedo::FindCompleteHypotheses
std::vector< std::string > FindCompleteHypotheses()
find all the complete hypotheses
Definition: armor_cluedo.cpp:165
ARMOR_DEFAULT_DEBUGMODE
#define ARMOR_DEFAULT_DEBUGMODE
Definition: armor_tools.h:34