View Javadoc

1   /*
2    * Created on Jun 25, 2003
3    * 
4    * Copyright (c) 2003, 2004 Delft University of Technology Jaffalaan 5, 2628 BX
5    * Delft, the Netherlands All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the General Public License
9    */
10  
11  package nl.tudelft.simulation.traffic.vehicle;
12  
13  import java.rmi.RemoteException;
14  import javax.vecmath.Point3d;
15  import nl.tudelft.simulation.dsol.animation.LocatableInterface;
16  import nl.tudelft.simulation.event.EventListenerInterface;
17  import nl.tudelft.simulation.event.EventProducerInterface;
18  import nl.tudelft.simulation.event.EventType;
19  import nl.tudelft.simulation.traffic.track.TrackInterface;
20  
21  /***
22   * This interface defines the behaviour of the physical part of a vehicle.
23   * 
24   * <br>
25   * (c) copyright 2003-2004 <a href="http://www.simulation.tudelft.nl">Delft
26   * University of Technology </a>, the Netherlands. <br>
27   * See for project information <a href="http://www.simulation.tudelft.nl">
28   * www.simulation.tudelft.nl </a> <br>
29   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
30   * License (GPL) </a>, no warranty <br>
31   * 
32   * @version Jul 4, 2004 <br>
33   * @author <a
34   * href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
35   * Verbraeck </a>
36   */
37  public interface VehiclePhysicalInterface
38          extends
39              EventProducerInterface,
40              LocatableInterface,
41              EventListenerInterface
42  {
43      /***
44       * This event signals that the vehicle is leaving the infrastructure.
45       */
46      public static final EventType REMOVE_EVENT = new EventType("REMOVE_EVENT");
47  
48      /***
49       * this method is needed to tell the vehicle to start driving
50       */
51      public void startDriving();
52  
53      /***
54       * Returns the vehicle's current acceleration
55       * 
56       * @param speed
57       * @param progression
58       * @return double
59       */
60      public double getCurrentAcceleration(final double speed,
61              final double progression);
62  
63      /***
64       * @param speed
65       * @param progression
66       * @return the new speed and progresssion if they have been changed
67       */
68      public double[] setSpeedAndProgression(final double speed,
69              final double progression);
70  
71      /***
72       * Sets the vehicle's maximum speed
73       * 
74       * @param speed
75       */
76      public void setMaximumSpeed(final double speed);
77  
78      /***
79       * Returns the vehicle's current speed
80       * 
81       * @return double
82       */
83      public double getCurrentSpeed();
84  
85      /***
86       * Returns the vehicle's current progression on the track where it is
87       * located.
88       * 
89       * @return progression
90       */
91      public double getProgression();
92  
93      /***
94       * Returns the vehicle's current track
95       * 
96       * @return Track
97       */
98      public TrackInterface getCurrentTrack();
99  
100     /***
101      * Returns the location of a position 'distace' meters behind the front of
102      * the vehicle
103      * 
104      * @param distance
105      * @return
106      */
107     public Point3d getBackwardLocation(final double distance);
108 
109     /***
110      * Returns the vehicleType.
111      * 
112      * @return vehicleType.
113      */
114     public VehicleType getVehicleType();
115 
116     /***
117      * Returns the control associated to this physical vehicle.
118      * 
119      * @return vehicleControl
120      */
121     public VehicleControlInterface getVehicleControl();
122 
123     /***
124      * @param vehicleControl The vehicleControl to set.
125      */
126     public void setVehicleControl(VehicleControlInterface vehicleControl);
127 
128     /***
129      * this method is used for verification etc.
130      * 
131      * @return total distance the vehicle has traveled
132      */
133     public double getDistanceTraveled();
134 
135     /***
136      * remove the vehicle from the track
137      * 
138      * @throws RemoteException
139      */
140     public void removeVehicle() throws RemoteException;
141 }