Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/24/10 11:44:05 (15 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on algorithms
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SGA/3.3/SGA.cs

    r2852 r2857  
    106106
    107107    protected override void OnProblemChanged() {
    108       Problem.SolutionCreator.RandomParameter.ActualName = "Random";
     108      if (Problem.SolutionCreator is IStochasticSolutionCreator) ((IStochasticSolutionCreator)Problem.SolutionCreator).RandomParameter.ActualName = "Random";
    109109      populationCreator.SolutionCreatorParameter.Value = Problem.SolutionCreator;
    110110      populationCreator.SolutionEvaluatorParameter.Value = Problem.Evaluator;
     
    115115    }
    116116    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
    117       Problem.SolutionCreator.RandomParameter.ActualName = "Random";
     117      if (Problem.SolutionCreator is IStochasticSolutionCreator) ((IStochasticSolutionCreator)Problem.SolutionCreator).RandomParameter.ActualName = "Random";
    118118      populationCreator.SolutionCreatorParameter.Value = Problem.SolutionCreator;
    119119      base.Problem_SolutionCreatorChanged(sender, e);
Note: See TracChangeset for help on using the changeset viewer.