コード例 #1
0
  /**
   * A process is using this method to put lane it has used back in the HoldingArea.
   *
   * @param l <code>Lane</code>: The lane which should be returned to the HoldingArea.
   */
  public void takeBack(Lane l) {

    // take back the lane as Res
    this.lanes.takeBack(1);

    // insert the line to the lanes queue
    this.laneQueue.insert(l);
    if (currentlySendTraceNotes())
      sendTraceNote("releases " + l.getName() + " to the " + this.getName());
  }
コード例 #2
0
  /**
   * Gets a Line from the HoldingArea and provides it to the sim-process to use it. As not enough
   * lanes are available at the moment the sim-process has to wait in a queue until a lane is
   * available again.
   *
   * @return <code>Lane</code>: The available lane of this HoldingArea.
   */
  public Lane getLane() {

    // check if there're available lanes
    if (!this.lanes.provide(1)) return null;

    // get the lane from the queue of the lanes
    Lane lane = this.laneQueue.first();

    // trace that a lane was taken from this HO
    if (currentlySendTraceNotes())
      sendTraceNote("takes " + lane.getName() + " from the " + this.getName());

    // remove lane from the Queue
    this.laneQueue.remove(lane);

    return lane;
  }