Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2839_HiveProjectManagement/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs @ 17398

Last change on this file since 17398 was 16057, checked in by jkarder, 6 years ago

#2839:

File size: 2.7 KB
RevLine 
[4362]1#region License Information
2/* HeuristicLab
[16057]3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
[4362]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.Collections.Generic;
23using System.Linq;
[8053]24using HeuristicLab.Common;
[4362]25using HeuristicLab.Core;
26using HeuristicLab.Data;
27using HeuristicLab.Optimization;
[8053]28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
[4362]29using HeuristicLab.PluginInfrastructure;
[8053]30using HeuristicLab.Problems.VehicleRouting.Interfaces;
[4363]31using HeuristicLab.Problems.VehicleRouting.Variants;
[4362]32
33namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
34  [Item("SingleDepotVRPProblemInstance", "Represents a single depot VRP instance.")]
35  [StorableClass]
[8053]36  public class SingleDepotVRPProblemInstance : VRPProblemInstance, ISingleDepotProblemInstance {
[4374]37    protected override IEnumerable<IOperator> GetOperators() {
38      return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>().Cast<IOperator>();
[4362]39    }
40
[4374]41    protected override IEnumerable<IOperator> GetAnalyzers() {
42      return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>()
43        .Where(o => o is IAnalyzer)
44        .Cast<IOperator>();
45    }
46
[4365]47    public override IntValue Cities {
48      get {
49        return new IntValue(Demand.Length - 1);
50      }
51    }
52
[4362]53    protected override IVRPEvaluator Evaluator {
54      get {
55        return new SingleDepotVRPEvaluator();
56      }
57    }
58
59    protected override IVRPCreator Creator {
60      get {
61        return new HeuristicLab.Problems.VehicleRouting.Encodings.Alba.RandomCreator();
62      }
63    }
[8053]64
[4362]65    [StorableConstructor]
66    protected SingleDepotVRPProblemInstance(bool deserializing) : base(deserializing) { }
67
68    public SingleDepotVRPProblemInstance() {
69    }
[4752]70
71    public override IDeepCloneable Clone(Cloner cloner) {
72      return new SingleDepotVRPProblemInstance(this, cloner);
73    }
74
75    protected SingleDepotVRPProblemInstance(SingleDepotVRPProblemInstance original, Cloner cloner)
76      : base(original, cloner) {
77    }
[4362]78  }
79}
Note: See TracBrowser for help on using the repository browser.