Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PersistenceReintegration/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluation.cs @ 15018

Last change on this file since 15018 was 14929, checked in by gkronber, 8 years ago

#2520 fixed unit tests for new persistence: loading & storing all samples

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