RCL - RoboCLuedo  v1.0
Francesco Ganci - S4143910 - Experimental Robotics Lab - Assignment 1

◆ AddIndiv()

bool ArmorCluedo::AddIndiv ( std::string  indivname,
std::string  classname,
bool  makeDisjoint = true 
)

add an individual to the ontology

In simple words, this function adds the individual to the database.

Due to the need of the command "DISJOINT" in order to make the reasoner able to classify the hypotheses, and due to an issue with the command "DISJOINT IND CLASS", this function works in a more complex way. Here is how it works:

  1. before starting, if the individual has class HYPOTHESIS and was discarded, return false immediately
  2. The individual is tracked, i.e. put into an array which contains all the defined individuals
  3. then, the individual is added
  4. call the command "REASON"
  5. if the last argument makeDisjoint is ture, the function also performs "DISJOINT" between the element to add and all the other elements. It is the only working and reliable way to ensure a correct classification by the reasoner right now.

Since in RCL, the hypotheses are the only individuals with properties, there's no need to DISJOINT them. Hence, that last option can be useful to reduce the complexity of the method: if makeDisjoint is set to false, the function doesn't perform the last step. The element is tracked anyway.

Parameters
indivnamethe individual to add
classnamethe class of the individual to add
makeDisjointperform disjoint or not?
Returns
true if the individual doesn't appear in the database; false otherwise
Warning
remember: call upload before any manipolation command!
Examples
ArmorCluedo - 001 - Working on Individuals, ArmorCluedo - 002 - Working with properties, and ArmorCluedo - 003 - Reasoning Workflow.

Definition at line 53 of file armor_cluedo.cpp.

References ArmorTools::SendCommand().

+ Here is the call graph for this function: