Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluation.cs @ 12009

Last change on this file since 12009 was 12009, checked in by ascheibe, 10 years ago

#2212 updated copyright year

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