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 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.Linq;
|
---|
25 | using System.Text;
|
---|
26 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
27 | using HeuristicLab.Core;
|
---|
28 | using HeuristicLab.Common;
|
---|
29 |
|
---|
30 | namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
|
---|
31 | public class StopInsertionInfo {
|
---|
32 | private int start;
|
---|
33 |
|
---|
34 | public int Start {
|
---|
35 | get { return start; }
|
---|
36 | }
|
---|
37 |
|
---|
38 | private int end;
|
---|
39 |
|
---|
40 | public int End {
|
---|
41 | get { return end; }
|
---|
42 | }
|
---|
43 |
|
---|
44 | public StopInsertionInfo(int start, int end)
|
---|
45 | : base() {
|
---|
46 | this.start = start;
|
---|
47 | this.end = end;
|
---|
48 | }
|
---|
49 | }
|
---|
50 |
|
---|
51 | public class TourInsertionInfo {
|
---|
52 | public double Penalty { get; set; }
|
---|
53 |
|
---|
54 | private List<StopInsertionInfo> stopInsertionInfos;
|
---|
55 |
|
---|
56 | public TourInsertionInfo()
|
---|
57 | : base() {
|
---|
58 | stopInsertionInfos = new List<StopInsertionInfo>();
|
---|
59 | }
|
---|
60 |
|
---|
61 | public void AddStopInsertionInfo(StopInsertionInfo info) {
|
---|
62 | stopInsertionInfos.Add(info);
|
---|
63 | }
|
---|
64 |
|
---|
65 | public StopInsertionInfo GetStopInsertionInfo(int stop) {
|
---|
66 | return stopInsertionInfos[stop];
|
---|
67 | }
|
---|
68 |
|
---|
69 | public int GetStopCount() {
|
---|
70 | return stopInsertionInfos.Count;
|
---|
71 | }
|
---|
72 | }
|
---|
73 |
|
---|
74 | public class InsertionInfo {
|
---|
75 | private List<TourInsertionInfo> tourInsertionInfos;
|
---|
76 |
|
---|
77 | public InsertionInfo()
|
---|
78 | : base() {
|
---|
79 | tourInsertionInfos = new List<TourInsertionInfo>();
|
---|
80 | }
|
---|
81 |
|
---|
82 | public void AddTourInsertionInfo(TourInsertionInfo info) {
|
---|
83 | tourInsertionInfos.Add(info);
|
---|
84 | }
|
---|
85 |
|
---|
86 | public TourInsertionInfo GetTourInsertionInfo(int tour) {
|
---|
87 | return tourInsertionInfos[tour];
|
---|
88 | }
|
---|
89 | }
|
---|
90 |
|
---|
91 | public class VRPEvaluation {
|
---|
92 | public double Quality { get; set; }
|
---|
93 | public double Distance { get; set; }
|
---|
94 | public int VehicleUtilization { get; set; }
|
---|
95 | public InsertionInfo InsertionInfo { get; set; }
|
---|
96 |
|
---|
97 | public double Penalty { get; set; }
|
---|
98 |
|
---|
99 | public VRPEvaluation() {
|
---|
100 | InsertionInfo = new InsertionInfo();
|
---|
101 | }
|
---|
102 | }
|
---|
103 | }
|
---|