Free cookie consent management tool by TermsFeed Policy Generator

source: branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutePlanningProblem.cs @ 8293

Last change on this file since 8293 was 8285, checked in by spimming, 12 years ago

#1894:

  • updated references and plugin dependencies
  • initial stub version of RoutePlanningProblem implementation
File size: 3.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 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 HeuristicLab.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Data;
25using HeuristicLab.Optimization;
26using HeuristicLab.Parameters;
27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
28
29namespace HeuristicLab.Problems.RoutePlanning {
30  [Item("Route Planning Problem", "Represents a Route Planning Problem.")]
31  [Creatable("Problems")]
32  [StorableClass]
33  public class RoutePlanningProblem : Problem {
34    private const string CoordinatesParameterName = "Coordinates";
35    private const string FromParameterName = "From";
36    private const string ToParameterName = "To";
37    public string Filename { get; set; }
38
39    #region Parameter Properties
40
41    public OptionalValueParameter<DoubleMatrix> CoordinatesParameter {
42      get { return (OptionalValueParameter<DoubleMatrix>)Parameters[CoordinatesParameterName]; }
43    }
44    public ValueParameter<IntValue> FromParameter {
45      get { return (ValueParameter<IntValue>)Parameters[FromParameterName]; }
46    }
47    public ValueParameter<IntValue> ToParameter {
48      get { return (ValueParameter<IntValue>)Parameters[ToParameterName]; }
49    }
50
51    #endregion
52
53    #region Properties
54
55    public DoubleMatrix Coordinates {
56      get { return CoordinatesParameter.Value; }
57      set { CoordinatesParameter.Value = value; }
58    }
59
60    public IntValue From {
61      get { return FromParameter.Value; }
62      set { FromParameter.Value = value; }
63    }
64
65    public IntValue To {
66      get { return ToParameter.Value; }
67      set { ToParameter.Value = value; }
68    }
69
70    #endregion
71
72    #region Constructors
73
74    [StorableConstructor]
75    private RoutePlanningProblem(bool deserializing) : base(deserializing) { }
76
77    private RoutePlanningProblem(RoutePlanningProblem original, Cloner cloner)
78      : base(original, cloner) {
79      RegisterEventHandlers();
80    }
81
82    public override IDeepCloneable Clone(Cloner cloner) {
83      return new RoutePlanningProblem(this, cloner);
84    }
85
86    public RoutePlanningProblem() {
87      Parameters.Add(new OptionalValueParameter<DoubleMatrix>(CoordinatesParameterName, "The x- and y-Coordinates of the cities."));
88      Parameters.Add(new ValueParameter<IntValue>(FromParameterName, "From."));
89      Parameters.Add(new ValueParameter<IntValue>(ToParameterName, "To."));
90
91      RegisterEventHandlers();
92    }
93
94    #endregion
95
96    private void RegisterEventHandlers() { }
97
98  }
99}
Note: See TracBrowser for help on using the repository browser.