aim4.im.v2i.reservation

## Class ReservationGridManager

- java.lang.Object
- - aim4.im.v2i.reservation.ReservationGridManager

- All Implemented Interfaces:
    ReservationManager<ReservationGridManager.Query,ReservationGridManager.Plan,Integer>

      public class ReservationGridManager
      extends Object
      implements ReservationManager<ReservationGridManager.Query,ReservationGridManager.Plan,Integer>

  The reservation grid manager.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ReservationGridManager.Config` The configuration of the reservation grid manager.
    `static class` | `ReservationGridManager.Plan` The plan for the reservation.
    `static class` | `ReservationGridManager.Query` The reservation grid manager.
    `static class` | `ReservationGridManager.VinHistoryStatCollector` The statistic collector for VIN history.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ReservationGridManager.Config` | `config` The configuration of this reservation grid manager.
    `double` | `staticBufferSize` The size of the static buffer, in meters, used by this policy.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReservationGridManager(double currentTime, ReservationGridManager.Config config, Intersection intersection, TiledArea tiledArea, ReservationGrid reservationGrid)` Create a reservation grid manager.
    `ReservationGridManager(ReservationGridManager.Config config, Intersection intersection, TiledArea tiledArea, ReservationGrid reservationGrid)` Create a reservation grid manager.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Integer` | `accept(ReservationGridManager.Plan plan)` Accept the proposed plan.
    `void` | `act(double timeStep)` Advance the time step.
    `void` | `cancel(Integer reservationId)` Cancel the reservation.
    `ReservationGridManager.Config` | `getConfig()` Get the configuration.
    `List<? extends Shape>` | `getDebugShapes()` Get the rectangles for the ReservationTiles that have a reservation for the current time.
    `StatCollector<ReservationGridManager>` | `getStatCollector()` Get the statistic collector.
    `TiledArea` | `getTiledArea()` Get the tiled area.
    `ReservationGridManager.Plan` | `query(ReservationGridManager.Query q)` Find a set of space-time tile for a particular traversal proposal in a request message.

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

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

- - ### Field Detail

    - #### config

          public ReservationGridManager.Config config

      The configuration of this reservation grid manager.

    - #### staticBufferSize

          public double staticBufferSize

      The size of the static buffer, in meters, used by this policy.

  - ### Constructor Detail

    - #### ReservationGridManager

          public ReservationGridManager(ReservationGridManager.Config config,
                                Intersection intersection,
                                TiledArea tiledArea,
                                ReservationGrid reservationGrid)

      Create a reservation grid manager.
      Parameters:
        `config` - the configuration of the grid manager
        `intersection` - the intersection
        `tiledArea` - the tiled area
        `reservationGrid` - the reservation grid

    - #### ReservationGridManager

          public ReservationGridManager(double currentTime,
                                ReservationGridManager.Config config,
                                Intersection intersection,
                                TiledArea tiledArea,
                                ReservationGrid reservationGrid)

      Create a reservation grid manager.
      Parameters:
        `currentTime` - the current time
        `config` - the configuration of the grid manager
        `intersection` - the intersection
        `tiledArea` - the tiled area
        `reservationGrid` - the reservation grid

  - ### Method Detail

    - #### act

          public void act(double timeStep)

      Advance the time step.
      Parameters:
        `timeStep` - the time step

    - #### getConfig

          public ReservationGridManager.Config getConfig()

      Get the configuration.
      Returns:
        the configuration

    - #### getTiledArea

          public TiledArea getTiledArea()

      Get the tiled area.
      Returns:
        the tiled area

    - #### getStatCollector

          public StatCollector<ReservationGridManager> getStatCollector()

      Get the statistic collector.
      Returns:
        the statistic collector

    - #### query

          public ReservationGridManager.Plan query(ReservationGridManager.Query q)

      Find a set of space-time tile for a particular traversal proposal in a request message. This attempt can be either with attempting to setMaxAccelWithMaxTargetVelocity to maximum velocity or with a constant velocity.
      Specified by:
        `query` in interface `ReservationManager<ReservationGridManager.Query,ReservationGridManager.Plan,Integer>`
      Parameters:
        `q` - the query object
      Returns:
        a set of space-time tiles on the trajectory and the exit velocity of the vehicle if the reservation is successful; otherwise return null.

    - #### accept

          public Integer accept(ReservationGridManager.Plan plan)

      Accept the proposed plan.
      Specified by:
        `accept` in interface `ReservationManager<ReservationGridManager.Query,ReservationGridManager.Plan,Integer>`
      Parameters:
        `plan` - the plan genreated by query()
      Returns:
        the ticket of this reservation

    - #### cancel

          public void cancel(Integer reservationId)

      Cancel the reservation.
      Specified by:
        `cancel` in interface `ReservationManager<ReservationGridManager.Query,ReservationGridManager.Plan,Integer>`
      Parameters:
        `reservationId` - the reservation

    - #### getDebugShapes

          public List<? extends Shape> getDebugShapes()

      Get the rectangles for the ReservationTiles that have a reservation for the current time.
      Returns:
        the rectangles for the ReservationTiles that have a reservation for the current time

Copyright © 2013. All rights reserved.