Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/Results/ResultDefinition.cs @ 17594

Last change on this file since 17594 was 17594, checked in by mkommend, 4 years ago

#2521: Added first version of new results. The first algorithm that has been adapted for testing purposes is the hill climber.

File size: 2.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 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;
23using System.Drawing;
24using HEAL.Attic;
25using HeuristicLab.Common;
26using HeuristicLab.Common.Resources;
27using HeuristicLab.Core;
28
29namespace HeuristicLab.Optimization {
30  /// <summary>
31  /// Represents a result which has a name and a data type and holds an IItem.
32  /// </summary>
33  [Item("Result", "A result which has a name and a data type and holds an IItem.")]
34  [StorableType("7EA61D13-F1EB-4B39-A623-B945F92E633A")]
35  public class ResultDefinition : NamedItem, IResultDefinition {
36    public override Image ItemImage => VSImageLibrary.Exception;
37    public override bool CanChangeName => false;
38    public override bool CanChangeDescription => false;
39
40    [Storable]
41    private readonly Type dataType;
42    public Type DataType {
43      get { return dataType; }
44    }
45
46    [StorableConstructor]
47    protected ResultDefinition(StorableConstructorFlag _) : base(_) { }
48    protected ResultDefinition(ResultDefinition original, Cloner cloner) : base(original, cloner) {
49      dataType = original.dataType;
50    }
51    public override IDeepCloneable Clone(Cloner cloner) {
52      return new ResultDefinition(this, cloner);
53    }
54
55    public ResultDefinition(string name, Type dataType) : this(name, string.Empty, dataType) { }
56    public ResultDefinition(string name, string description, Type dataType) : base(name, description) {
57      this.dataType = dataType;
58    }
59  }
60}
Note: See TracBrowser for help on using the repository browser.