View Javadoc

1   /*
2    * Created on Dec 15, 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.track;
12  
13  import javax.vecmath.Point3d;
14  
15  import nl.tudelft.simulation.dsol.animation.LocatableInterface;
16  import nl.tudelft.simulation.traffic.track.util.TrackList;
17  
18  /***
19   * This interface defines the interface of TrackLinks. A link is used for
20   * connections between tracks. <br>
21   * <br>
22   * Tracks need to be explicitly added to links. The possibility to travel
23   * from track A to track B has to be explicitly defined using the
24   * addSuccessorToTrack() method. A connection between tracks is only
25   * possible between tracks added to the link. <br>
26   * <br>
27   * A simpleTrackLink is a location. <br>
28   * <br>
29   * 
30   * @see nl.tudelft.simulation.traffic.track.TrackInterface
31   * 
32   * @author <a
33   * href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
34   * Verbraeck </a> <br>
35   */
36  public interface TrackLinkInterface extends LocatableInterface
37  {
38      /***
39       * Adds a successor to this link.
40       * 
41       * @param successor
42       */
43      public void addSuccessor(final TrackInterface successor);
44  
45      /***
46       * Adds a predecessor to this link.
47       * 
48       * @param predecessor
49       */
50      public void addPredecessor(final TrackInterface predecessor);
51  
52      /***
53       * This method sets the active successor of the given track.
54       * 
55       * @param predecessor
56       * @param successor
57       */
58      public void setActiveSuccessor(final TrackInterface predecessor,
59              final TrackInterface successor);
60  
61      /***
62       * This method gets the active successor of the given track.
63       * 
64       * @param predecessor
65       * @return activeSuccessor
66       */
67      public TrackInterface getActiveSuccessor(final TrackInterface predecessor);
68  
69      /***
70       * Returns all successors for this link.
71       * 
72       * @return successors
73       */
74      public TrackList getSuccessors();
75  
76      /***
77       * Returns all predecessors for this link.
78       * 
79       * @return TrackList
80       */
81      public TrackList getPredecessors();
82  
83      /***
84       * @return position
85       */
86      public Point3d getPosition();
87  }