Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 10446 was 7276, checked in by svonolfe, 13 years ago

Improved incremental evaluation (#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    public double Quality { get; set; }
54
55    public int Vehicle { get; set; }
56
57    private List<StopInsertionInfo> stopInsertionInfos;
58
59    public TourInsertionInfo(int vehicle)
60      : base() {
61      stopInsertionInfos = new List<StopInsertionInfo>();
62      Vehicle = vehicle;
63    }
64
65    public void AddStopInsertionInfo(StopInsertionInfo info) {
66      stopInsertionInfos.Add(info);
67    }
68
69   public StopInsertionInfo GetStopInsertionInfo(int stop) {
70      return stopInsertionInfos[stop];
71    }
72
73    public int GetStopCount() {
74      return stopInsertionInfos.Count;
75    }
76  }
77
78  public class InsertionInfo {
79    private List<TourInsertionInfo> tourInsertionInfos;
80   
81    public InsertionInfo()
82      : base() {
83        tourInsertionInfos = new List<TourInsertionInfo>();
84    }
85
86    public void AddTourInsertionInfo(TourInsertionInfo info) {     
87      tourInsertionInfos.Add(info);
88    }
89
90    public TourInsertionInfo GetTourInsertionInfo(int tour) {
91      return tourInsertionInfos[tour];
92    }
93  }
94 
95  public class VRPEvaluation {
96    public double Quality { get; set; }
97    public double Distance { get; set; }
98    public int VehicleUtilization { get; set; }
99    public InsertionInfo InsertionInfo { get; set; }
100
101    public double Penalty { get; set; }
102
103    public VRPEvaluation() {
104      InsertionInfo = new InsertionInfo();
105    }
106  }
107}
Note: See TracBrowser for help on using the repository browser.