Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/tools/Templates/HeuristicLabProblemTemplate/DefaultProblem.cs @ 12018

Last change on this file since 12018 was 5912, checked in by abeham, 14 years ago

#567

  • updated problem and algorithm
  • reverted plugin wizard
File size: 3.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-$year$ 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.Collections.Generic;
24using System.Drawing;
25using System.IO;
26using System.Linq;
27using HeuristicLab.Common;
28using HeuristicLab.Core;
29using HeuristicLab.Data;
30using HeuristicLab.Optimization;
31using HeuristicLab.Parameters;
32using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
33using HeuristicLab.PluginInfrastructure;
34
35namespace $rootnamespace$ {
36  [Item("$problemName$", "$problemDescription$")]
37  [Creatable("Problems")]
38  [StorableClass]
39  public sealed class $safeitemname$ : $problemTypeImplementation$ {
40    public override Image ItemImage {
41      get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; }
42    }
43
44    #region Parameter Properties
45    $parameterProperties$
46    #endregion
47
48    #region Properties
49    $properties$
50    #endregion
51
52    [StorableConstructor]
53    private $safeitemname$(bool deserializing) : base(deserializing) { }
54    private $safeitemname$($safeitemname$ original, Cloner cloner)
55      : base(original, cloner) {
56      // TODO: Clone your private fields here
57      AttachEventHandlers();
58    }
59    public $safeitemname$()
60      : base() {
61      // TODO: Create a new instance of evaluator and solution creator
62     
63      $parameterInitializers$
64
65      ParameterizeSolutionCreator();
66      ParameterizeEvaluator();
67
68      InitializeOperators();
69      AttachEventHandlers();
70    }
71
72    public override IDeepCloneable Clone(Cloner cloner) {
73      return new $safeitemname$(this, cloner);
74    }
75
76    #region Events
77    // TODO: Add your event handlers here
78    #endregion
79
80    #region Helpers
81    [StorableHook(HookType.AfterDeserialization)]
82    private void AfterDeserializationHook() {
83      AttachEventHandlers();
84    }
85
86    private void AttachEventHandlers() {
87      // TODO: Add event handlers to the parameters here
88    }
89
90    private void InitializeOperators() {
91      // TODO: Add custom problem analyzer to the list
92      // TODO: Add operators from the representation either by direct instantiation, or by using ApplicationManager.Manger.GetInstances<T>().Cast<IOperator>()
93    }
94    private void ParameterizeSolutionCreator() {
95      // TODO: Set the parameters of the solution creator
96    }
97    private void ParameterizeEvaluator() {
98      // TODO: Set the parameters of the evaluator
99    }
100    #endregion
101  }
102}
Note: See TracBrowser for help on using the repository browser.