1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2016 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 |
|
---|
22 | using System.Collections.Generic;
|
---|
23 | using HeuristicLab.Persistence;
|
---|
24 |
|
---|
25 | namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
|
---|
26 | [StorableType("dde417ca-cb1e-4aa8-b573-22e5451f0d4a")]
|
---|
27 | public class StopInsertionInfo {
|
---|
28 | private int start;
|
---|
29 |
|
---|
30 | public int Start {
|
---|
31 | get { return start; }
|
---|
32 | }
|
---|
33 |
|
---|
34 | private int end;
|
---|
35 |
|
---|
36 | public int End {
|
---|
37 | get { return end; }
|
---|
38 | }
|
---|
39 |
|
---|
40 | public StopInsertionInfo(int start, int end)
|
---|
41 | : base() {
|
---|
42 | this.start = start;
|
---|
43 | this.end = end;
|
---|
44 | }
|
---|
45 | }
|
---|
46 |
|
---|
47 | [StorableType("e80a6db1-bd54-46c5-96ed-e2b811c9b054")]
|
---|
48 | public class TourInsertionInfo {
|
---|
49 | public double Penalty { get; set; }
|
---|
50 | public double Quality { get; set; }
|
---|
51 |
|
---|
52 | public int Vehicle { get; set; }
|
---|
53 |
|
---|
54 | private List<StopInsertionInfo> stopInsertionInfos;
|
---|
55 |
|
---|
56 | public TourInsertionInfo(int vehicle)
|
---|
57 | : base() {
|
---|
58 | stopInsertionInfos = new List<StopInsertionInfo>();
|
---|
59 | Vehicle = vehicle;
|
---|
60 | }
|
---|
61 |
|
---|
62 | public void AddStopInsertionInfo(StopInsertionInfo info) {
|
---|
63 | stopInsertionInfos.Add(info);
|
---|
64 | }
|
---|
65 |
|
---|
66 | public StopInsertionInfo GetStopInsertionInfo(int stop) {
|
---|
67 | return stopInsertionInfos[stop];
|
---|
68 | }
|
---|
69 |
|
---|
70 | public int GetStopCount() {
|
---|
71 | return stopInsertionInfos.Count;
|
---|
72 | }
|
---|
73 | }
|
---|
74 |
|
---|
75 | [StorableType("6d3e38c2-65fe-494e-b683-eb77249df833")]
|
---|
76 | public class InsertionInfo {
|
---|
77 | private List<TourInsertionInfo> tourInsertionInfos;
|
---|
78 |
|
---|
79 | public InsertionInfo()
|
---|
80 | : base() {
|
---|
81 | tourInsertionInfos = new List<TourInsertionInfo>();
|
---|
82 | }
|
---|
83 |
|
---|
84 | public void AddTourInsertionInfo(TourInsertionInfo info) {
|
---|
85 | tourInsertionInfos.Add(info);
|
---|
86 | }
|
---|
87 |
|
---|
88 | public TourInsertionInfo GetTourInsertionInfo(int tour) {
|
---|
89 | return tourInsertionInfos[tour];
|
---|
90 | }
|
---|
91 | }
|
---|
92 |
|
---|
93 | [StorableType("6786408a-87bb-43db-9d44-1aefdf2548e6")]
|
---|
94 | public class VRPEvaluation {
|
---|
95 | public double Quality { get; set; }
|
---|
96 | public double Distance { get; set; }
|
---|
97 | public int VehicleUtilization { get; set; }
|
---|
98 | public InsertionInfo InsertionInfo { get; set; }
|
---|
99 |
|
---|
100 | public double Penalty { get; set; }
|
---|
101 |
|
---|
102 | public VRPEvaluation() {
|
---|
103 | InsertionInfo = new InsertionInfo();
|
---|
104 | }
|
---|
105 | }
|
---|
106 | }
|
---|