Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs @ 12214

Last change on this file since 12214 was 11185, checked in by pfleck, 10 years ago

#2208 merged trunk and updated version info

File size: 2.7 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2014 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.Collections.Generic;
23using System.Linq;
24using HeuristicLab.Common;
25using HeuristicLab.Core;
26using HeuristicLab.Data;
27using HeuristicLab.Optimization;
28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
29using HeuristicLab.PluginInfrastructure;
30using HeuristicLab.Problems.VehicleRouting.Interfaces;
31using HeuristicLab.Problems.VehicleRouting.Variants;
32
33namespace 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}
Note: See TracBrowser for help on using the repository browser.