Package rinde.sim.event

Examples of rinde.sim.event.Event


        addTickListener((TickListener) m);
      }
    }
    modelManager.configure();
    configured = true;
    dispatcher.dispatchEvent(new Event(SimulatorEventType.CONFIGURED, this));
  }
View Full Code Here


    if (!configured) {
      throw new IllegalStateException(
          "Simulator can not be started when it is not configured.");
    }
    if (!isPlaying) {
      dispatcher.dispatchEvent(new Event(SimulatorEventType.STARTED, this));
    }
    isPlaying = true;
    while (isPlaying) {
      tick();
    }
    dispatcher.dispatchEvent(new Event(SimulatorEventType.STOPPED, this));
  }
View Full Code Here

    while ((e = scenarioQueue.peek()) != null && e.time <= timeLapse.getTime()) {
      scenarioQueue.poll();
      if (status == null) {
        LOGGER.info("scenario started at virtual time:" + timeLapse.getTime());
        status = EventType.SCENARIO_STARTED;
        disp.dispatchEvent(new Event(status, this));
      }
      disp.dispatchEvent(e);
    }
    if (e == null && status != EventType.SCENARIO_FINISHED) {
      status = EventType.SCENARIO_FINISHED;
      disp.dispatchEvent(new Event(status, this));
    }
    if (ticks == 0 && status == EventType.SCENARIO_FINISHED) {
      LOGGER.info("scenario finished at virtual time:" + timeLapse.getTime()
          + "[stopping simulation]");
      simulator.stop();
View Full Code Here

            ((DefaultVehicle) me.roadUser).dto.startPosition) < MOVE_THRESHOLD) {
          // only override time if the vehicle did actually move
          if (me.pathProgress.distance.getValue().doubleValue() > MOVE_THRESHOLD) {
            lastArrivalTimeAtDepot.put(me.roadUser, simulator.getCurrentTime());
            if (totalVehicles == lastArrivalTimeAtDepot.size()) {
              eventDispatcher.dispatchEvent(new Event(
                  StatisticsEventType.ALL_VEHICLES_AT_DEPOT, this));
            }
          }
        } else {
          lastArrivalTimeAtDepot.remove(me.roadUser);
View Full Code Here

TOP

Related Classes of rinde.sim.event.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.