Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/28/13 15:38:12 (12 years ago)
Author:
mkommend
Message:

#2020: Integrated changes developed in the CMA-ES branch by abeham in the trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs

    r8720 r9258  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    2522using HeuristicLab.Analysis;
    2623using HeuristicLab.Common;
     
    3229using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3330using HeuristicLab.PluginInfrastructure;
     31using System;
     32using System.Collections.Generic;
     33using System.Linq;
    3434
    3535namespace HeuristicLab.Problems.TestFunctions {
     
    125125    public override IDeepCloneable Clone(Cloner cloner) {
    126126      return new SingleObjectiveTestFunctionProblem(this, cloner);
    127     }
    128 
    129     private bool IsNotFieldReferenced(IOperator x) {
    130       return !(x == strategyVectorCreator
    131         || x == strategyVectorCrossover
    132         || x == strategyVectorManipulator);
    133127    }
    134128
     
    337331    }
    338332    private void ParameterizeOperators() {
    339       foreach (IRealVectorCrossover op in Operators.OfType<IRealVectorCrossover>()) {
     333      foreach (var op in Operators.OfType<IRealVectorCrossover>()) {
    340334        op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    341335        op.ParentsParameter.Hidden = true;
     
    345339        op.BoundsParameter.Hidden = true;
    346340      }
    347       foreach (IRealVectorManipulator op in Operators.OfType<IRealVectorManipulator>()) {
     341      foreach (var op in Operators.OfType<IRealVectorManipulator>()) {
    348342        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    349343        op.RealVectorParameter.Hidden = true;
     
    351345        op.BoundsParameter.Hidden = true;
    352346      }
    353       foreach (IRealVectorMoveOperator op in Operators.OfType<IRealVectorMoveOperator>()) {
    354         op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    355         op.RealVectorParameter.Hidden = true;
    356       }
    357       foreach (IRealVectorMoveGenerator op in Operators.OfType<IRealVectorMoveGenerator>()) {
     347      foreach (var op in Operators.OfType<IRealVectorMoveOperator>()) {
     348        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
     349        op.RealVectorParameter.Hidden = true;
     350      }
     351      foreach (var op in Operators.OfType<IRealVectorMoveGenerator>()) {
    358352        op.BoundsParameter.ActualName = BoundsParameter.Name;
    359353        op.BoundsParameter.Hidden = true;
    360354      }
    361       foreach (ISingleObjectiveTestFunctionAdditiveMoveEvaluator op in Operators.OfType<ISingleObjectiveTestFunctionAdditiveMoveEvaluator>()) {
     355      foreach (var op in Operators.OfType<ISingleObjectiveTestFunctionAdditiveMoveEvaluator>()) {
    362356        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    363357        op.QualityParameter.Hidden = true;
     
    365359        op.RealVectorParameter.Hidden = true;
    366360      }
    367       foreach (IRealVectorParticleCreator op in Operators.OfType<IRealVectorParticleCreator>()) {
     361      foreach (var op in Operators.OfType<IRealVectorParticleCreator>()) {
    368362        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    369363        op.RealVectorParameter.Hidden = true;
     
    373367        op.ProblemSizeParameter.Hidden = true;
    374368      }
    375       foreach (IRealVectorParticleUpdater op in Operators.OfType<IRealVectorParticleUpdater>()) {
     369      foreach (var op in Operators.OfType<IRealVectorParticleUpdater>()) {
    376370        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    377371        op.RealVectorParameter.Hidden = true;
     
    379373        op.BoundsParameter.Hidden = true;
    380374      }
    381       foreach (IRealVectorSwarmUpdater op in Operators.OfType<IRealVectorSwarmUpdater>()) {
     375      foreach (var op in Operators.OfType<IRealVectorSwarmUpdater>()) {
    382376        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    383377        op.RealVectorParameter.Hidden = true;
     
    385379        op.MaximizationParameter.Hidden = true;
    386380      }
    387       foreach (IRealVectorMultiNeighborhoodShakingOperator op in Operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>()) {
    388         op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    389         op.RealVectorParameter.Hidden = true;
    390       }
    391       foreach (ISingleObjectiveImprovementOperator op in Operators.OfType<ISingleObjectiveImprovementOperator>()) {
     381      foreach (var op in Operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>()) {
     382        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
     383        op.RealVectorParameter.Hidden = true;
     384      }
     385      foreach (var op in Operators.OfType<ISingleObjectiveImprovementOperator>()) {
    392386        op.SolutionParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    393387        op.SolutionParameter.Hidden = true;
    394388      }
    395       foreach (ISingleObjectivePathRelinker op in Operators.OfType<ISingleObjectivePathRelinker>()) {
     389      foreach (var op in Operators.OfType<ISingleObjectivePathRelinker>()) {
    396390        op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    397391        op.ParentsParameter.Hidden = true;
    398392      }
    399       foreach (SingleObjectiveTestFunctionSimilarityCalculator op in Operators.OfType<SingleObjectiveTestFunctionSimilarityCalculator>()) {
     393      foreach (var op in Operators.OfType<SingleObjectiveTestFunctionSimilarityCalculator>()) {
    400394        op.SolutionVariableName = SolutionCreator.RealVectorParameter.ActualName;
    401395        op.QualityVariableName = Evaluator.QualityParameter.ActualName;
     
    404398    }
    405399    private void UpdateStrategyVectorBounds() {
    406       DoubleMatrix strategyBounds = (DoubleMatrix)Bounds.Clone();
     400      var strategyBounds = (DoubleMatrix)Bounds.Clone();
    407401      for (int i = 0; i < strategyBounds.Rows; i++) {
    408402        if (strategyBounds[i, 0] < 0) strategyBounds[i, 0] = 0;
Note: See TracChangeset for help on using the changeset viewer.