Changeset 4187 for trunk/tools/Templates/HeuristicLabAlgorithmTemplate
- Timestamp:
- 08/10/10 23:07:25 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/Templates/HeuristicLabAlgorithmTemplate/DefaultAlgorithm.cs
r4176 r4187 46 46 47 47 #region Parameter Properties 48 private ValueParameter<IntValue> SeedParameter { 49 get { return (ValueParameter<IntValue>)Parameters["Seed"]; } 50 } 51 private ValueParameter<BoolValue> SetSeedRandomlyParameter { 52 get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; } 53 } 54 private ValueParameter<MultiAnalyzer> AnalyzerParameter { 55 get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 56 } 48 $parameterProperties$ 57 49 #endregion 58 50 59 51 #region Properties 60 public IntValue Seed { 61 get { return SeedParameter.Value; } 62 set { SeedParameter.Value = value; } 63 } 64 public BoolValue SetSeedRandomly { 65 get { return SetSeedRandomlyParameter.Value; } 66 set { SetSeedRandomlyParameter.Value = value; } 67 } 68 public MultiAnalyzer Analyzer { 69 get { return AnalyzerParameter.Value; } 70 set { AnalyzerParameter.Value = value; } 52 $properties$ 53 private RandomCreator RandomCreator { 54 get { return (RandomCreator)OperatorGraph.InitialOperator; } 71 55 } 72 56 #endregion … … 76 60 public $safeitemname$() 77 61 : base() { 78 Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); 79 Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); 80 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each iteration.", new MultiAnalyzer())); 62 $parameterInitializers$ 81 63 82 // TODO: Create and assign OperatorGraph.InitialOperator 64 RandomCreator randomCreator = new RandomCreator(); 65 OperatorGraph.InitialOperator = randomCreator; 83 66 84 // TODO: Build operator graph 67 randomCreator.RandomParameter.ActualName = "Random"; 68 randomCreator.SeedParameter.ActualName = SeedParameter.Name; 69 randomCreator.SeedParameter.Value = null; 70 randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name; 71 randomCreator.SetSeedRandomlyParameter.Value = null; 72 randomCreator.Successor = null; // TODO: 73 74 // TODO: Create further operators and build operator graph 85 75 76 UpdateAnalyzers(); 86 77 AttachEventHandlers(); 87 78 } … … 101 92 protected override void OnProblemChanged() { 102 93 // TODO: Initialize and parameterize operators 94 UpdateAnalyzers(); 103 95 base.OnProblemChanged(); 104 96 } … … 114 106 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { 115 107 // TODO: Parameterize operators 108 UpdateAnalyzers(); 116 109 base.Problem_OperatorsChanged(sender, e); 117 110 }
Note: See TracChangeset
for help on using the changeset viewer.