View Javadoc
1   package org.opentrafficsim.road.gtu.lane.tactical;
2   
3   /**
4    * Interface for tactical planners to return the control state for visualization. 
5    * <p>
6    * Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
7    * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
8    * <p>
9    * @version $Revision$, $LastChangedDate$, by $Author$, initial version May 1, 2019 <br>
10   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
11   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
12   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
13   */
14  public interface Controllable
15  {
16      
17      /**
18       * Returns the control state.
19       * @return State; control state
20       */
21      State getControlState();
22      
23      /**
24       * Control state.
25       * <p>
26       * Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
27       * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
28       * <p>
29       * @version $Revision$, $LastChangedDate$, by $Author$, initial version May 1, 2019 <br>
30       * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
31       * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
32       * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
33       */
34      enum State
35      {
36          
37          /** GTU has no control. */
38          NONE,
39          
40          /** Control is disabled. */
41          DISABLED,
42          
43          /** Control is enabled. */
44          ENABLED;
45          
46          /**
47           * Returns whether this is NONE.
48           * @return boolean; whether this is NONE
49           */
50          public boolean isNone()
51          {
52              return this.equals(NONE);
53          }
54          
55          /**
56           * Returns whether this is DISABLED.
57           * @return boolean; whether this is DISABLED
58           */
59          public boolean isDisabled()
60          {
61              return this.equals(DISABLED);
62          }
63          
64          /**
65           * Returns whether this is ENABLED.
66           * @return boolean; whether this is ENABLED
67           */
68          public boolean isEnabled()
69          {
70              return this.equals(ENABLED);
71          }
72          
73      }
74      
75  }