View Javadoc

1   package cz.cuni.amis.pogamut.usar2004.agent.module.sensor;
2   
3   import cz.cuni.amis.pogamut.usar2004.agent.module.datatypes.SensorType;
4   
5   /**
6    * Sensor message representative for Sound sensor.
7    *
8    * @author vejmanm
9    */
10  public class SensorSound extends SuperSensor
11  {
12      //public static final String type="Sound";
13      public static final SensorType type = SensorType.SOUND_SENSOR;
14  
15      /**
16       * Ctor. Sensor type describes particular subject about which we want to
17       * know about. It is used to distinguish incoming message from the server.
18       */
19      public SensorSound()
20      {
21          super(type);
22      }
23  
24      /**
25       * Loudnes from the sound sensor.
26       *
27       * @return Returns loundness of a sound.
28       */
29      public double getLoudness()
30      {
31          return lastMessage.getLoudness();
32      }
33  
34      /**
35       * Duration of a sound from the sound sensor.
36       *
37       * @return Returns a drutaion of a sound.
38       */
39      public double getDuration()
40      {
41          return lastMessage.getDuration();
42      }
43  }