1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2019 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 |
|
---|
22 | using System.Collections.Generic;
|
---|
23 | using System.Linq;
|
---|
24 | using HeuristicLab.Common;
|
---|
25 | using HeuristicLab.Core;
|
---|
26 | using HeuristicLab.Data;
|
---|
27 | using HeuristicLab.Optimization;
|
---|
28 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
29 | using HeuristicLab.PluginInfrastructure;
|
---|
30 | using HeuristicLab.Problems.VehicleRouting.Interfaces;
|
---|
31 | using HeuristicLab.Problems.VehicleRouting.Variants;
|
---|
32 |
|
---|
33 | namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
|
---|
34 | [Item("SingleDepotVRPProblemInstance", "Represents a single depot VRP instance.")]
|
---|
35 | [StorableClass]
|
---|
36 | public class SingleDepotVRPProblemInstance : VRPProblemInstance, ISingleDepotProblemInstance {
|
---|
37 | protected override IEnumerable<IOperator> GetOperators() {
|
---|
38 | return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>().Cast<IOperator>();
|
---|
39 | }
|
---|
40 |
|
---|
41 | protected override IEnumerable<IOperator> GetAnalyzers() {
|
---|
42 | return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>()
|
---|
43 | .Where(o => o is IAnalyzer)
|
---|
44 | .Cast<IOperator>();
|
---|
45 | }
|
---|
46 |
|
---|
47 | public override IntValue Cities {
|
---|
48 | get {
|
---|
49 | return new IntValue(Demand.Length - 1);
|
---|
50 | }
|
---|
51 | }
|
---|
52 |
|
---|
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 | }
|
---|
64 |
|
---|
65 | [StorableConstructor]
|
---|
66 | protected SingleDepotVRPProblemInstance(bool deserializing) : base(deserializing) { }
|
---|
67 |
|
---|
68 | public SingleDepotVRPProblemInstance() {
|
---|
69 | }
|
---|
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 | }
|
---|
78 | }
|
---|
79 | } |
---|