private string sPosition = null; // Sparql command for generate the position information /// Constructor of the RobotHear class. The objective is to create a instance for a sound perception. /// he instant parameter represens the exact moment of the sound capture. /// The idObject parameter represents an unique identifier associated the object responsible to produce the sound. /// The kind defines the kind of the sound. /// The volume parameter defines the sound volume. /// The detail parameter defines additional information associated with the sound, for example, if kind is MARIANA_VOICE then the detail represents the sentence said. /// /// /// public RobotHear(DateTime instant, long idObject, HearingAttribute kind, double volume, string detail) { long countEv = getEventCount(); // get a unique identifier for position and color // to create a Sparql command for generate the hear information sHear = string.Format(SparqlAccess.INSERT_HEAR, countEv, instant.ToString(SparqlAccess.XSD_DATETIME), idObject, volume, kind, detail); }
private void insertHearPos(GameObject go, DateTime dt) { CartesianPos cPos = new CartesianPos(go.transform.position.x, go.transform.position.y, go.transform.position.z); HearingProperties auxHearingProperties = go.GetComponent <HearingProperties>(); HearingAttribute soundType = HearingAttribute.unknownSound; float volume = 0; string desc = ""; if (auxHearingProperties != null) { soundType = auxHearingProperties.getSoundType(); volume = auxHearingProperties.getVolume(); desc = auxHearingProperties.getSoundDetail(); } RobotHear rh = new RobotHear( dt, // the event occurs now cPos, // object identifier soundType, // I heard a beautiful music volume, // the volume is in the middle desc); // sound detail try // Try to access a resource. { rh.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. } }
/// Constructor of the RobotHear class. The objective is to create a instance for a sound perception. /// The instant parameter represens the exact moment of the sound capture. /// The pos parameter represents the position of an unknow object responsible to produce the sound. /// The kind defines the kind of the sound. /// The volume parameter defines the sound volume. /// The detail parameter defines additional information associated with the sound, for example, if kind is MARIANA_VOICE then the detail represents the sentence said. public RobotHear(DateTime instant, CartesianPos pos, HearingAttribute kind, double volume, string detail) { 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 hear information sHear = string.Format(SparqlAccess.INSERT_HEAR_POS, countEv, instant.ToString(SparqlAccess.XSD_DATETIME), volume, kind, detail); }