aim4.im.v2i.policy

## Interface BasePolicyCallback

- All Known Subinterfaces:
    ExtendedBasePolicyCallback
  All Known Implementing Classes:
    BasePolicy

      public interface BasePolicyCallback

  The base policy's callback interface.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BasePolicy.ReserveParam` | `findReserveParam(Request msg, List<Request.Proposal> proposals)` Compute the reservation parameter given the request message and a set of proposals.
    `double` | `getCurrentTime()` Get the current time
    `TrackModel` | `getTrackMode()`
    `boolean` | `hasReservation(int vin)` Check whether the vehicle currently has a reservation.
    `void` | `sendComfirmMsg(int latestRequestId, BasePolicy.ReserveParam reserveParam)` Send a confirm message
    `void` | `sendRejectMsg(int vin, int latestRequestId, Reject.Reason reason)` Send a reject message

- - ### Method Detail

    - #### sendComfirmMsg

          void sendComfirmMsg(int latestRequestId,
                            BasePolicy.ReserveParam reserveParam)

      Send a confirm message
      Parameters:
        `latestRequestId` - the latest request id of the vehicle
        `reserveParam` - the reservation parameter

    - #### sendRejectMsg

          void sendRejectMsg(int vin,
                           int latestRequestId,
                           Reject.Reason reason)

      Send a reject message
      Parameters:
        `vin` - the VIN
        `latestRequestId` - the latest request id of the vehicle
        `reason` - the reason of rejection

    - #### findReserveParam

          BasePolicy.ReserveParam findReserveParam(Request msg,
                                                 List<Request.Proposal> proposals)

      Compute the reservation parameter given the request message and a set of proposals.
      Parameters:
        `msg` - the request message
        `proposals` - the set of proposals
      Returns:
        the reservation parameters; null if the reservation is infeasible.

    - #### getCurrentTime

          double getCurrentTime()

      Get the current time
      Returns:
        the current time

    - #### hasReservation

          boolean hasReservation(int vin)

      Check whether the vehicle currently has a reservation.
      Parameters:
        `vin` - the VIN of the vehicle
      Returns:
        whether the vehicle currently has a reservation.

    - #### getTrackMode

          TrackModel getTrackMode()

Copyright © 2013. All rights reserved.