View Javadoc

1   package cz.cuni.amis.pogamut.sposh.executor;
2   
3   import cz.cuni.amis.pogamut.sposh.engine.VariableContext;
4   
5   /**
6    * Interface for sense in state paradigma.
7    * <p/>
8    * Sense should <b>NEVER EVER</b> do any action. It is different from {@link IAction}.
9    * Think of it as constant method of C++ class.
10   * <p/>
11   * Examples:
12   * <ul>
13   *  <li>Can I see my base: true/false</li>
14   *  <li>Number of rabbits in my bag: number</li>
15   * </ul>
16   * @see IPrimitive
17   * @see StateWorkExecutor
18   * @author Honza
19   * @param <RETURN> Class of object that this sense returns every time it is queried.
20   */
21  public interface ISense<RETURN> {
22      /**
23       * Query current value of sense.
24       * @param params Variable context passed from posh plan to sense. Could be used for things like threshold and so on.
25       * @return what is sense currently sensing, e.g. number of friends in FOV
26       */
27      RETURN query(VariableContext params);
28  }