Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/10/10 23:07:25 (14 years ago)
Author:
abeham
Message:

#567

  • Worked on Algorithm Template
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/Templates/HeuristicLabAlgorithmTemplate/DefaultAlgorithm.cs

    r4176 r4187  
    4646
    4747    #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$
    5749    #endregion
    5850
    5951    #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; }
    7155    }
    7256    #endregion
     
    7660    public $safeitemname$()
    7761      : 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$
    8163     
    82       // TODO: Create and assign OperatorGraph.InitialOperator
     64      RandomCreator randomCreator = new RandomCreator();
     65      OperatorGraph.InitialOperator = randomCreator;
    8366
    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
    8575     
     76      UpdateAnalyzers();
    8677      AttachEventHandlers();
    8778    }
     
    10192    protected override void OnProblemChanged() {
    10293      // TODO: Initialize and parameterize operators
     94      UpdateAnalyzers();
    10395      base.OnProblemChanged();
    10496    }
     
    114106    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    115107      // TODO: Parameterize operators
     108      UpdateAnalyzers();
    116109      base.Problem_OperatorsChanged(sender, e);
    117110    }
Note: See TracChangeset for help on using the changeset viewer.