Free cookie consent management tool by TermsFeed Policy Generator

source: branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluation.cs @ 6885

Last change on this file since 6885 was 6883, checked in by svonolfe, 13 years ago

Added vehicle information to the tour insertion info (#1177)

File size: 2.9 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.Linq;
25using System.Text;
26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
27using HeuristicLab.Core;
28using HeuristicLab.Common;
29
30namespace 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    public int Vehicle { get; set; }
55
56    private List<StopInsertionInfo> stopInsertionInfos;
57
58    public TourInsertionInfo(int vehicle)
59      : base() {
60      stopInsertionInfos = new List<StopInsertionInfo>();
61      Vehicle = vehicle;
62    }
63
64    public void AddStopInsertionInfo(StopInsertionInfo info) {
65      stopInsertionInfos.Add(info);
66    }
67
68   public StopInsertionInfo GetStopInsertionInfo(int stop) {
69      return stopInsertionInfos[stop];
70    }
71
72    public int GetStopCount() {
73      return stopInsertionInfos.Count;
74    }
75  }
76
77  public class InsertionInfo {
78    private List<TourInsertionInfo> tourInsertionInfos;
79   
80    public InsertionInfo()
81      : base() {
82        tourInsertionInfos = new List<TourInsertionInfo>();
83    }
84
85    public void AddTourInsertionInfo(TourInsertionInfo info) {     
86      tourInsertionInfos.Add(info);
87    }
88
89    public TourInsertionInfo GetTourInsertionInfo(int tour) {
90      return tourInsertionInfos[tour];
91    }
92  }
93 
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}
Note: See TracBrowser for help on using the repository browser.