aim4.im

## Class RoadBasedTrackModel

- java.lang.Object
- - aim4.im.RoadBasedTrackModel

- All Implemented Interfaces:
    TrackModel

      public class RoadBasedTrackModel
      extends Object
      implements TrackModel

  A track model for road based intersections

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoadBasedTrackModel(RoadBasedIntersection intersection)` Basic class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RoadBasedIntersection` | `getIntersection()` Get the intersection managed by this track model
    `List<Lane>` | `getSortedDepartureLanes(Lane arrivalLane, Road departure)` Given an arrival Lane and a departure Road, get an ordered List of Lanes that represents the Lanes from highest to lowest priority based on distance from the arrival Lane.
    `boolean` | `trajectoriesConflict(int l11, int l12, int l21, int l22)` Determine whether two trajectories overlap.
    `double` | `traversalDistance(int arrivalID, int departureID)` Get the distance from the entry of the Lane with the first given ID, to the departure of the Lane with the other given ID, if traveling along segments through their point of intersection.
    `double` | `traversalDistance(Lane arrival, Lane departure)` Get the distance from the entry of the given Lane, to the departure of the other given Lane, if traveling along segments through their point of intersection.
    `double` | `traversalDistance(Road arrival, Road departure)` Get the distance from the entry of the given Road, to the departure of the other given Road.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RoadBasedTrackModel

          public RoadBasedTrackModel(RoadBasedIntersection intersection)

      Basic class constructor. Takes an lane-based intersection and construct a track model for the intersection.
      Parameters:
        `intersection` - a lane-based intersection.

  - ### Method Detail

    - #### getIntersection

          public RoadBasedIntersection getIntersection()

      Get the intersection managed by this track model
      Specified by:
        `getIntersection` in interface `TrackModel`
      Returns:
        the intersection managed by this track model

    - #### getSortedDepartureLanes

          public List<Lane> getSortedDepartureLanes(Lane arrivalLane,
                                           Road departure)

      Given an arrival Lane and a departure Road, get an ordered List of Lanes that represents the Lanes from highest to lowest priority based on distance from the arrival Lane.
      Specified by:
        `getSortedDepartureLanes` in interface `TrackModel`
      Parameters:
        `arrivalLane` - the Lane in which the vehicle is arriving
        `departure` - the Road by which the vehicle is departing
      Returns:
        the ordered List of Lanes, by priority, into which the vehicle should try to turn

    - #### trajectoriesConflict

          public boolean trajectoriesConflict(int l11,
                                     int l12,
                                     int l21,
                                     int l22)

      Determine whether two trajectories overlap. Errs on the side of caution.
      Specified by:
        `trajectoriesConflict` in interface `TrackModel`
      Parameters:
        `l11` - the ID number of the entry lane for the first trajectory
        `l12` - the ID number of the exit lane for the first trajectory
        `l21` - the ID number of the entry lane for the second trajectory
        `l22` - the ID number of the exit lane for the second trajectory
      Returns:
        whether the trajectories specified conflict

    - #### traversalDistance

          public double traversalDistance(Road arrival,
                                 Road departure)

      Get the distance from the entry of the given Road, to the departure of the other given Road.
      Specified by:
        `traversalDistance` in interface `TrackModel`
      Parameters:
        `arrival` - the arrival Road
        `departure` - the departure Road
      Returns:
        the distance from the entry of the arrival Road to the exit of the departure Road

    - #### traversalDistance

          public double traversalDistance(Lane arrival,
                                 Lane departure)

      Get the distance from the entry of the given Lane, to the departure of the other given Lane, if traveling along segments through their point of intersection.
      Specified by:
        `traversalDistance` in interface `TrackModel`
      Parameters:
        `arrival` - the arrival Lane
        `departure` - the departure Lane
      Returns:
        the distance from the entry of the arrival Lane to the exit of the departure Lane through their intersection

    - #### traversalDistance

          public double traversalDistance(int arrivalID,
                                 int departureID)

      Get the distance from the entry of the Lane with the first given ID, to the departure of the Lane with the other given ID, if traveling along segments through their point of intersection.
      Specified by:
        `traversalDistance` in interface `TrackModel`
      Parameters:
        `arrivalID` - the ID number of the arrival Lane
        `departureID` - the ID number of the departure Lane
      Returns:
        the distance from the entry of the arrival Lane to the exit of the departure Lane through their intersection

Copyright © 2013. All rights reserved.