private void insertSmellPos(GameObject go, DateTime dt) { CartesianPos cPos = new CartesianPos(go.transform.position.x, go.transform.position.y, go.transform.position.z); SmellProperties auxSmellProperties = go.GetComponent <SmellProperties>(); OlfactoryAttribute smellType = OlfactoryAttribute.noSmell; if (auxSmellProperties != null) { smellType = auxSmellProperties.getSmellType(); } RobotSmell rs = new RobotSmell( dt, // the event occurs now cPos, // source position smellType); // it is a putrid odor try // Try to access a resource. { rs.insert(); // using dotNetRDF library inserts the information in the triple store } catch (Exception e) { Debug.Log("System>>> " + e.Message); // change for your: LogError(e); // Call a custom error logging procedure. } }
private string sPosition = null; // Sparql command for generate the position information /// Constructor of the RobotSmell class. The objective is to create a instance for a odor perception. /// The instant parameter represens the exact moment of the odor capture. /// The idObject parameter represents an unique identifier associated the object responsible to produce the the smell. /// The odor parameter identifies the odor. /// /// /// public RobotSmell(DateTime instant, long idObject, OlfactoryAttribute odor) { long countEv = getEventCount(); // get a unique identifier for position and color // to create a Sparql command for generate the olfatory information sSmell = string.Format(SparqlAccess.INSERT_SMELL, countEv, instant.ToString(SparqlAccess.XSD_DATETIME), idObject, odor); }
/// Constructor of the RobotSmell class. The objective is to create a instance for a odor perception. /// The instant parameter represens the exact moment of the odor capture. /// The pos parameter represents the position of an unknow object responsible to produce the the smell. /// The odor parameter identifies the odor. public RobotSmell(DateTime instant, CartesianPos pos, OlfactoryAttribute odor) { long countEv = getEventCount(); // get a unique identifier for position and color // to create a Sparql command for generate the position information // sPosition = string.Format(SparqlAccess.INSERT_POSITION_LOCAL, countEv, pos.cartesianX, pos.cartesianY, pos.cartesianZ); // to create a Sparql command for generate the olfatory information sSmell = string.Format(SparqlAccess.INSERT_SMELL_POS, countEv, instant.ToString(SparqlAccess.XSD_DATETIME), odor); }