Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataPreprocessing/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluation.cs @ 10158

Last change on this file since 10158 was 9456, checked in by swagner, 12 years ago

Updated copyright year and added some missing license headers (#1889)

File size: 2.7 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2013 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.Collections.Generic;
23
24namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
25  public class StopInsertionInfo {
26    private int start;
27
28    public int Start {
29      get { return start; }
30    }
31
32    private int end;
33
34    public int End {
35      get { return end; }
36    }
37
38    public StopInsertionInfo(int start, int end)
39      : base() {
40      this.start = start;
41      this.end = end;
42    }
43  }
44
45  public class TourInsertionInfo {
46    public double Penalty { get; set; }
47    public double Quality { get; set; }
48
49    public int Vehicle { get; set; }
50
51    private List<StopInsertionInfo> stopInsertionInfos;
52
53    public TourInsertionInfo(int vehicle)
54      : base() {
55      stopInsertionInfos = new List<StopInsertionInfo>();
56      Vehicle = vehicle;
57    }
58
59    public void AddStopInsertionInfo(StopInsertionInfo info) {
60      stopInsertionInfos.Add(info);
61    }
62
63    public StopInsertionInfo GetStopInsertionInfo(int stop) {
64      return stopInsertionInfos[stop];
65    }
66
67    public int GetStopCount() {
68      return stopInsertionInfos.Count;
69    }
70  }
71
72  public class InsertionInfo {
73    private List<TourInsertionInfo> tourInsertionInfos;
74
75    public InsertionInfo()
76      : base() {
77      tourInsertionInfos = new List<TourInsertionInfo>();
78    }
79
80    public void AddTourInsertionInfo(TourInsertionInfo info) {
81      tourInsertionInfos.Add(info);
82    }
83
84    public TourInsertionInfo GetTourInsertionInfo(int tour) {
85      return tourInsertionInfos[tour];
86    }
87  }
88
89  public class VRPEvaluation {
90    public double Quality { get; set; }
91    public double Distance { get; set; }
92    public int VehicleUtilization { get; set; }
93    public InsertionInfo InsertionInfo { get; set; }
94
95    public double Penalty { get; set; }
96
97    public VRPEvaluation() {
98      InsertionInfo = new InsertionInfo();
99    }
100  }
101}
Note: See TracBrowser for help on using the repository browser.