Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/26/11 15:39:28 (14 years ago)
Author:
abeham
Message:

#1377

  • Added hiding to some more algorithms and problems
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs

    r6042 r6053  
    349349    }
    350350    private void ParameterizeMainLoop() {
    351       MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
    352       MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    353       MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     351      if (Problem != null) {
     352        MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
     353        MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
     354        MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     355      }
    354356      if (MoveEvaluator != null)
    355357        MainLoop.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName;
    356358    }
    357359    private void ParameterizeStochasticOperator(IOperator op) {
    358       if (op is IStochasticOperator)
    359         ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     360      if (op is IStochasticOperator) {
     361        IStochasticOperator stOp = (IStochasticOperator)op;
     362        stOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     363        stOp.RandomParameter.Hidden = true;
     364      }
    360365    }
    361366    private void ParameterizeMoveGenerators() {
    362367      if (Problem != null) {
    363         foreach (IMultiMoveGenerator generator in Problem.Operators.OfType<IMultiMoveGenerator>())
     368        foreach (IMultiMoveGenerator generator in Problem.Operators.OfType<IMultiMoveGenerator>()) {
    364369          generator.SampleSizeParameter.ActualName = SampleSizeParameter.Name;
     370          generator.SampleSizeParameter.Hidden = true;
     371        }
    365372      }
    366373    }
     
    368375      foreach (ISingleObjectiveMoveEvaluator op in Problem.Operators.OfType<ISingleObjectiveMoveEvaluator>()) {
    369376        op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     377        op.QualityParameter.Hidden = true;
    370378      }
    371379    }
     
    373381      foreach (IMoveMaker op in Problem.Operators.OfType<IMoveMaker>()) {
    374382        op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    375         if (MoveEvaluator != null)
     383        op.QualityParameter.Hidden = true;
     384        if (MoveEvaluator != null) {
    376385          op.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName;
     386          op.MoveQualityParameter.Hidden = true;
     387        } else {
     388          op.MoveQualityParameter.Hidden = false;
     389        }
    377390      }
    378391    }
    379392    private void ParameterizeAnalyzers() {
    380393      moveQualityAnalyzer.ResultsParameter.ActualName = "Results";
     394      moveQualityAnalyzer.ResultsParameter.Hidden = true;
    381395      if (Problem != null) {
    382396        moveQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    383         if (MoveEvaluator != null)
     397        moveQualityAnalyzer.MaximizationParameter.Hidden = true;
     398        if (MoveEvaluator != null) {
    384399          moveQualityAnalyzer.QualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName;
     400          moveQualityAnalyzer.QualityParameter.Hidden = true;
     401        } else moveQualityAnalyzer.QualityParameter.Hidden = false;
    385402        moveQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
     403        moveQualityAnalyzer.BestKnownQualityParameter.Hidden = true;
     404      } else {
     405        moveQualityAnalyzer.MaximizationParameter.Hidden = false;
     406        moveQualityAnalyzer.BestKnownQualityParameter.Hidden = false;
    386407      }
    387408    }
     
    390411        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
    391412          op.IterationsParameter.ActualName = "Iterations";
     413          op.IterationsParameter.Hidden = true;
    392414          op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
     415          op.MaximumIterationsParameter.Hidden = true;
    393416        }
    394417      }
Note: See TracChangeset for help on using the changeset viewer.