Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/OrderGenerators/Parsers/DynPDPParser.cs @ 15728

Last change on this file since 15728 was 8670, checked in by svonolfe, 12 years ago

Added first version of the dynamic vehicle routing addon (#1955)

File size: 2.3 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.IO;
25using System.Text.RegularExpressions;
26
27namespace HeuristicLab.PDPSimulation {
28  abstract class DynPDPParser {
29    public struct Vehicle {
30      public double xCoord;
31      public double yCoord;
32      public double capacity;
33      public double readyTime;
34      public double dueTime;
35    }
36
37    public struct Order {
38      public double revealedTime;
39      public double pickupXCoord;
40      public double pickupYCoord;
41      public double deliveryXCoord;
42      public double deliveryYCoord;
43      public double demand;
44      public double pickupServiceTime;
45      public double pickupReadyTime;
46      public double pickupDueTime;
47      public double deliveryServiceTime;
48      public double deliveryReadyTime;
49      public double deliveryDueTime;
50    }
51
52    protected string file;
53    protected string problemName;
54    protected List<Vehicle> vehicles;
55    protected List<Order> orders;
56
57    public string ProblemName {
58      get {
59        return new string(problemName.ToCharArray());
60      }
61    }
62
63    public Vehicle[] Vehicles {
64      get {
65        return vehicles.ToArray();
66      }
67    }
68
69    public Order[] Orders {
70      get {
71        return orders.ToArray();
72      }
73    }
74
75    public DynPDPParser(string file) {
76      this.file = file;
77      vehicles = new List<Vehicle>();
78      orders = new List<Order>();
79    }
80
81    public abstract void Parse();
82  }
83}
Note: See TracBrowser for help on using the repository browser.