Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8791


Ignore:
Timestamp:
10/11/12 13:40:54 (12 years ago)
Author:
svonolfe
Message:

Fixed order generation (#1955)

Location:
branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/OrderGenerators/PickupDeliveryPredefinedOrderGenerator.cs

    r8670 r8791  
    130130      for (int i = 0; i < orderMatrix.Rows; i++) {
    131131        double revealedTime = orderMatrix[i, 0];
    132         if (revealedTime >= timeStart && revealedTime < timeEnd) {
     132        if ((timeStart == timeEnd && revealedTime == timeStart) || (revealedTime >= timeStart && revealedTime < timeEnd)) {
    133133          Order order = new Order();
    134134          order.OrderState = OrderState.Waiting;
  • branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/PickupDeliverySimulation.cs

    r8779 r8791  
    426426      simulationObject = new SimulationObject();
    427427      lastResultCollection = 0;
    428       newSimulationTime = TimeStep;
     428      newSimulationTime = 0;
    429429
    430430      //create vehicles
     
    473473          Thread.Sleep(InitialDelayParameter.Value.Value);
    474474        }
     475
     476        Step();
    475477      }
    476478    }
     
    562564    }
    563565
     566    private void Step() {
     567      //next step
     568      SimulationTime = newSimulationTime;
     569      newSimulationTime = SimulationTime + TimeStep;
     570    }
     571
    564572    protected override void Run(CancellationToken cancellationToken) {
    565573      InitSimulation();
    566574
    567       while (!AllOrdersDelivered() || Scenario.MoreOrders(newSimulationTime) || (Scenario.RelocateBackToDepot && !AllVehiclesAtDepot())) {
     575      while (!AllOrdersDelivered() || Scenario.MoreOrders(SimulationTime) || (Scenario.RelocateBackToDepot && !AllVehiclesAtDepot())) {
    568576        //perform actions
    569577        UpdateSimulationState();
    570 
    571         //next step
    572         SimulationTime = newSimulationTime;
    573         newSimulationTime = SimulationTime + TimeStep;
    574 
    575578        UpdateOrders();
    576579        UpdateResults(false);
     580
     581        Step();
    577582
    578583        if (OptimizationRequired()) {
Note: See TracChangeset for help on using the changeset viewer.