Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6197


Ignore:
Timestamp:
05/14/11 18:49:46 (12 years ago)
Author:
cneumuel
Message:

#1215

  • some fixes
Location:
branches/HeuristicLab.MetaOptimization
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs

    r6090 r6197  
    4848    //private static double mutationProbability = 0.10;
    4949
    50     private static int metaAlgorithmPopulationSize = 10;
    51     private static int metaAlgorithmMaxGenerations = 20;
     50    private static int metaAlgorithmPopulationSize = 4;
     51    private static int metaAlgorithmMaxGenerations = 10;
    5252    private static double metaAlgorithmMutationProbability = 0.10;
    53     private static int metaProblemRepetitions = 2;
    54     private static int baseAlgorithmMaxGenerations = 10;
     53    private static int metaProblemRepetitions = 3;
     54    private static int baseAlgorithmMaxGenerations = 20;
    5555    private static int baseAlgorithmPopulationSize = 10;
    56    
     56
    5757    public override void Run() {
    5858      ContentManager.Initialize(new PersistenceContentManager());
     
    6060      //TestTableBuilder();
    6161      //TestShorten();
     62
     63
     64      var x = typeof(float).IsPrimitive;
    6265
    6366      //TestSimilarities(); return;
     
    7982
    8083      //TestSymbolicDataAnalysisGrammar(); return;
     84      //TestObjectGraphObjectsTraversal(); return;
     85      //TestParameterizedItem(); return;
    8186
    8287      //MetaOptimizationProblem metaOptimizationProblem = LoadOptimizationProblem("Meta Optimization Problem (Genetic Programming - Symbolic Regression 3.4 scaled).hl");
     
    9297      //EvolutionStrategy metaLevelAlgorithm = GetMetaES(metaOptimizationProblem);
    9398
    94       //Console.WriteLine("Press enter to start");
    95       //Console.ReadLine();
     99      //Console.WriteLine("Press enter to start"); Console.ReadLine();
    96100      //TestConfiguration(algorithmVc, typeof(GeneticAlgorithm), metaOptimizationProblem.Problems.First());
    97101
    98       //Console.WriteLine("Press enter to start");
    99       //Console.ReadLine();
     102      Console.WriteLine("Press enter to start"); Console.ReadLine();
    100103      TestOptimization(metaLevelAlgorithm);
    101104
     
    103106
    104107      Console.ReadLine();
     108    }
     109
     110    private void TestParameterizedItem() {
     111      var value = new MyParameterizedItem();
     112      Console.WriteLine("P1=1;; " + value.ToString());
     113
     114      var vc = new ParameterizedValueConfiguration(value, typeof(MyParameterizedItem), true);
     115      vc.Optimize = true;
     116      ((IntValue)vc.ParameterConfigurations.Single(x => x.Name == "P1").ActualValue.Value).Value = 22;
     117      Console.WriteLine("P1=22;; " + value.ToString());
     118      vc.ParameterConfigurations.Single(x => x.Name == "P1").ActualValue.Value = new IntValue(33);
     119      Console.WriteLine("P1=33;; " + value.ToString());
     120      vc.Parameterize(value);
     121      Console.WriteLine("P1=33;; " + value.ToString());
     122           
     123      Console.ReadLine();
     124    }
     125
     126    private void TestObjectGraphObjectsTraversal() {
     127      //var obj = new GeneticAlgorithm();
     128      var obj = ContentManager.Load("Genetic Programming - Symbolic Regression 3.4_scaled_paused.hl");
     129      Console.WriteLine("loaded");
     130
     131      for (int i = 0; i < 10; i++) {
     132        var sw = new Stopwatch();
     133        sw.Start();
     134        var objects = obj.GetObjectGraphObjects().ToArray();
     135        sw.Stop();
     136
     137        var typeCount = GetTypeCount(objects).ToArray();
     138        Console.WriteLine("objects: {0}", objects.Count());
     139        Console.WriteLine(sw.Elapsed);
     140      }
     141    }
     142
     143    private IOrderedEnumerable<KeyValuePair<Type, long>> GetTypeCount(object[] objects) {
     144      var dict = new Dictionary<Type, long>();
     145      foreach (var item in objects) {
     146        var t = item.GetType();
     147        if (!dict.ContainsKey(t))
     148          dict.Add(t, 0);
     149        dict[t]++;
     150      }
     151      return dict.OrderByDescending(x => x.Value);
    105152    }
    106153
     
    733780    private static ParameterConfigurationTree SetupGAAlgorithm(Type baseLevelAlgorithmType, MetaOptimizationProblem metaOptimizationProblem) {
    734781      metaOptimizationProblem.AlgorithmType.Value = baseLevelAlgorithmType;
    735      
    736       //metaOptimizationProblem.ProblemType.Value = typeof(SingleObjectiveTestFunctionProblem);
     782
     783      metaOptimizationProblem.ProblemType.Value = typeof(SingleObjectiveTestFunctionProblem);
    737784      //metaOptimizationProblem.Problems.Clear();
    738785      //metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
     
    753800
    754801      // tower problem
    755       metaOptimizationProblem.ImportAlgorithm((IAlgorithm)ContentManager.Load("Genetic Programming - Symbolic Regression 3.4_scaled.hl"));
    756       metaOptimizationProblem.Maximization.Value = true;
     802      //metaOptimizationProblem.ImportAlgorithm((IAlgorithm)ContentManager.Load("Genetic Programming - Symbolic Regression 3.4_scaled.hl"));
     803      //metaOptimizationProblem.Maximization.Value = true;
    757804
    758805      ParameterConfigurationTree algorithmVc = metaOptimizationProblem.ParameterConfigurationTree;
    759806      ((IntValue)algorithmVc.AlgorithmConfiguration.ParameterConfigurations.Single(x => x.Name == "MaximumGenerations").ActualValue.Value).Value = baseAlgorithmMaxGenerations;
    760807      ((IntValue)algorithmVc.AlgorithmConfiguration.ParameterConfigurations.Single(x => x.Name == "PopulationSize").ActualValue.Value).Value = baseAlgorithmPopulationSize;
    761      
     808
    762809      //ConfigurePopulationSize(algorithmVc, 10, 100, 1);
    763       //ConfigureMutationRate(algorithmVc, 0.0, 1.0, 0.01);
    764       //ConfigureMutationOperator(algorithmVc);
     810      ConfigureMutationRate(algorithmVc, 0.0, 1.0, 0.01);
     811      ConfigureMutationOperator(algorithmVc);
    765812      //ConfigureElites(algorithmVc, 0, 10, 1);
    766813      //ConfigureSelectionOperator(algorithmVc, true);
    767814
    768       ConfigureSymbolicExpressionGrammar(algorithmVc);
     815      //ConfigureSymbolicExpressionGrammar(algorithmVc);
    769816
    770817      return algorithmVc;
     
    9921039
    9931040      ContentManager.Save((IStorableContent)metaLevelAlgorithm, resultPath + "-before.hl", true);
    994      
     1041
    9951042      using (var sw = new StreamWriter(outputPath)) {
    9961043        sw.AutoFlush = true;
     
    12621309    }
    12631310  }
     1311
     1312  class MyParameterizedItem : ParameterizedNamedItem {
     1313    public MyParameterizedItem() {
     1314      this.Parameters.Add(new ValueParameter<IntValue>("P1", new IntValue(1)));
     1315      this.Parameters.Add(new ValueParameter<IntValue>("P2", new IntValue(2)));
     1316      this.Parameters.Add(new ValueParameter<IntValue>("P3", new IntValue(3)));
     1317      this.Parameters.Add(new ValueParameter<MyOtherParameterizedItem>("P4", new MyOtherParameterizedItem()));
     1318    }
     1319
     1320    protected MyParameterizedItem(MyParameterizedItem original, Cloner cloner)
     1321      : base(original, cloner) {
     1322    }
     1323    public override IDeepCloneable Clone(Cloner cloner) {
     1324      return new MyParameterizedItem(this, cloner);
     1325    }
     1326
     1327    public override string ToString() {
     1328      return string.Format("P1: {0}, P2: {1}, P3: {2}, P4: {3}", Parameters["P1"].ActualValue, Parameters["P2"].ActualValue, Parameters["P3"].ActualValue, Parameters["P4"].ActualValue);
     1329    }
     1330  }
     1331
     1332  class MyOtherParameterizedItem : ParameterizedNamedItem {
     1333    public MyOtherParameterizedItem() {
     1334      this.Parameters.Add(new ValueParameter<IntValue>("PP1", new IntValue(1)));
     1335      this.Parameters.Add(new ValueParameter<IntValue>("PP2", new IntValue(2)));
     1336      this.Parameters.Add(new ValueParameter<IntValue>("PP3", new IntValue(3)));
     1337    }
     1338
     1339    protected MyOtherParameterizedItem(MyOtherParameterizedItem original, Cloner cloner)
     1340      : base(original, cloner) {
     1341    }
     1342    public override IDeepCloneable Clone(Cloner cloner) {
     1343      return new MyOtherParameterizedItem(this, cloner);
     1344    }
     1345
     1346    public override string ToString() {
     1347      return string.Format("PP1: {0}, PP2: {1}, PP3: {2}", Parameters["PP1"].ActualValue, Parameters["PP2"].ActualValue, Parameters["PP3"].ActualValue);
     1348    }
     1349  }
    12641350}
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers/BestParameterConfigurationAnalyzer.cs

    r6090 r6197  
    102102      RunCollection rc = new RunCollection();
    103103      foreach (ParameterConfigurationTree pt in (maximization ? parameterTrees.OrderByDescending(x => x.Quality) : parameterTrees.OrderBy(x => x.Quality))) {
    104         rc.Add(pt.ToRun(string.Format("Individual {0} ({1})", i, pt.ParameterInfoString)));
     104        rc.Add(pt.ToRun(string.Format("Individual {0} ({1})", i, pt.ParameterInfoString), true));
    105105        i++;
    106106      }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers/PMOBestSolutionHistoryAnalyzer.cs

    r6018 r6197  
    7676      }
    7777      if (bestSolutionHistory.Count == 0 || best.ParameterInfoString != ((StringValue)bestSolutionHistory.Last().Results["Meta.ParameterInfoString"]).Value) {
    78         IRun run = best.ToRun(string.Format("{0}: {1}", currentGeneration, best.ParameterInfoString));
     78        IRun run = best.ToRun(string.Format("{0}: {1}", currentGeneration, best.ParameterInfoString), false);
    7979        run.Results.Add("Meta.Generation", new IntValue(currentGeneration));
    8080        run.Results.Add("Meta.ParameterInfoString", new StringValue(best.ParameterInfoString));
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs

    r6018 r6197  
    184184        this.parameters.Add(p.Key, cloner.Clone(p.Value));
    185185      }
    186       //this.name = original.name;
    187186    }
    188187    public override IDeepCloneable Clone(Cloner cloner) {
     
    291290    }
    292291
    293     public IRun ToRun() {
    294       return ToRun(this.ParameterInfoString);
    295     }
    296 
    297     public IRun ToRun(string name) {
     292    public IRun ToRun(bool clearParameters) {
     293      return ToRun(this.ParameterInfoString, clearParameters);
     294    }
     295
     296    public IRun ToRun(string name, bool clearParameters) {
    298297      IRun run = new Run();
    299298      run.Name = name;
    300299      this.CollectResultValues(run.Results);
    301300      this.CollectParameterValues(run.Parameters);
    302       MetaOptimizationUtil.ClearParameters(run, this.GetOptimizedParameterNames());
     301      if(clearParameters) MetaOptimizationUtil.ClearParameters(run, this.GetOptimizedParameterNames());
    303302      return run;
    304303    }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs

    r6018 r6197  
    211211      this.validTypes = original.validTypes.ToArray();
    212212      this.valueConfigurations = cloner.Clone(original.ValueConfigurations);
    213       this.ActualValue = cloner.Clone(original.ActualValue);
     213      if (this.valueConfigurations != null) RegisterValueConfigurationEvents();
     214      this.actualValue = cloner.Clone(original.actualValue);
     215      if (this.actualValue != null) RegisterActualValueEvents();
    214216      this.optimize = original.optimize;
    215217      this.actualValueConfigurationIndex = original.actualValueConfigurationIndex;
     
    217219      this.itemImage = original.itemImage;
    218220      this.discoverValidValues = original.discoverValidValues;
    219       if (this.valueConfigurations != null) RegisterValueConfigurationEvents();
    220221      this.AutoPopulateValueConfigurations = original.AutoPopulateValueConfigurations;
    221222    }
     
    226227    }
    227228    [StorableHook(HookType.AfterDeserialization)]
    228     private void AfterDeserialization() {
     229    protected virtual void AfterDeserialization() {
    229230      if (this.valueConfigurations != null) RegisterValueConfigurationEvents();
     231      if (this.actualValue != null) RegisterActualValueEvents();
    230232    }
    231233    #endregion
     
    400402
    401403    #region Events
    402     void ActualValue_ToStringChanged(object sender, EventArgs e) {
     404    protected virtual void ActualValue_ToStringChanged(object sender, EventArgs e) {
    403405      OnToStringChanged();
    404406    }
     
    495497      var clonedValue = this.ActualValue.Value != null ? (IItem)this.ActualValue.Value.Clone() : null;
    496498      if (clonedValue != null) AdaptValidValues(parameter, clonedValue);
    497       parameter.Value = clonedValue;
     499      parameter.ActualValue = clonedValue;
    498500    }
    499501
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/SingleValuedParameterConfiguration.cs

    r6018 r6197  
    88  [StorableClass]
    99  public class SingleValuedParameterConfiguration : ParameterConfiguration {
    10 
     10   
    1111    #region Constructors and Cloning
    1212    [StorableConstructor]
     
    2525      this.validValues = new ItemSet<IItem> { valueConfiguration.ActualValue.Value };
    2626      this.validTypes = new Type[] { valueConfiguration.ActualValue.ValueDataType };
    27       this.IsNullable = false;
     27      this.isNullable = false;
    2828      this.itemImage = valueConfiguration.ItemImage;
    2929      this.ValueConfigurations = new CheckedValueConfigurationList { valueConfiguration };
     
    5454
    5555    public override string ToString() {
    56       if (this.valueConfigurations.First() is SymbolValueConfiguration) {
    57         var syVc = (SymbolValueConfiguration)this.valueConfigurations.First();
     56      if (this.valueConfigurations.Single() is SymbolValueConfiguration) {
     57        var syVc = (SymbolValueConfiguration)this.valueConfigurations.Single();
    5858        if (this.Optimize) {
    5959          return syVc.ToString() + " (Optimize)";
    6060        } else {
    61           return syVc.ToString();
     61          return ActualValue.ToString();
    6262        }
    6363      } else {
     
    6666    }
    6767
    68     private void valueConfiguration_ToStringChanged(object sender, EventArgs e) {
     68    protected virtual void valueConfiguration_ToStringChanged(object sender, EventArgs e) {
    6969      OnToStringChanged();
    7070    }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/ConstrainedValue.cs

    r5522 r6197  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     2using HeuristicLab.Common;
    53using HeuristicLab.Core;
    6 using HeuristicLab.Common;
     4using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    75using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    8 using HeuristicLab.Data;
    96
    107namespace HeuristicLab.Problems.MetaOptimization {
     
    5653    private void RegisterEvents() {
    5754      this.value.ToStringChanged += new EventHandler(value_ToStringChanged);
     55      if (this.value is Symbol) {
     56        ((Symbol)this.value).Changed += new EventHandler(ConstrainedValue_Changed);
     57      }
    5858    }
     59
    5960    private void DeregisterEvents() {
    6061      this.value.ToStringChanged -= new EventHandler(value_ToStringChanged);
     62      if (this.value is Symbol) {
     63        ((Symbol)this.value).Changed -= new EventHandler(ConstrainedValue_Changed);
     64      }
    6165    }
    6266
     
    9094    }
    9195
     96    private void ConstrainedValue_Changed(object sender, EventArgs e) {
     97      OnToStringChanged();
     98    }
     99
    92100    public override string ToString() {
     101      if (this.value is Symbol) {
     102        return string.Format("{0}: {1}", this.value, ((Symbol)this.value).InitialFrequency);
     103      }
    93104      return value != null ? value.ToString() : base.ToString();
    94105    }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/SymbolicExpressionGrammar/SymbolValueConfiguration.cs

    r6023 r6197  
    1 using System.Collections.Generic;
     1using System;
     2using System.Collections.Generic;
    23using System.Linq;
    34using HeuristicLab.Common;
     
    1112  [StorableClass]
    1213  public class SymbolValueConfiguration : ParameterizedValueConfiguration {
     14    [Storable]
     15    private IOptimizable parentOptimizable;
     16    public IOptimizable ParentOptimizable {
     17      get { return parentOptimizable; }
     18      set { this.parentOptimizable = value; }
     19    }
    1320
    1421    #region Constructors and Cloning
     
    2128      this.Optimize = false;
    2229      this.Name = symbol.Name;
    23       this.actualValue = new ConstrainedValue(symbol, symbol.GetType(), new ItemSet<IItem> { symbol }, false);
     30      this.ActualValue = new ConstrainedValue(symbol, symbol.GetType(), new ItemSet<IItem> { symbol }, false);
    2431    }
    2532    protected SymbolValueConfiguration(SymbolValueConfiguration original, Cloner cloner)
    2633      : base(original, cloner) {
     34      RegisterInitialFrequencyEvents();
     35      this.parentOptimizable = cloner.Clone(original.parentOptimizable);
    2736    }
    2837    public override IDeepCloneable Clone(Cloner cloner) {
    2938      return new SymbolValueConfiguration(this, cloner);
     39    }
     40    [StorableHook(HookType.AfterDeserialization)]
     41    private void AfterDeserialization() {
     42      RegisterInitialFrequencyEvents();
    3043    }
    3144    #endregion
     
    3346    protected override void PopulateParameterConfigurations(IItem item, bool discoverValidValues) {
    3447      this.ClearParameterConfigurations();
    35 
    3648      var symbol = (Symbol)item;
    3749
     
    4153      var initialFrequencyParameterConfiguration = new ParameterConfiguration("InitialFrequency", typeof(Symbol), new DoubleValue(symbol.InitialFrequency), initialFrequencyValueConfigurations);
    4254      this.parameterConfigurations.Add(initialFrequencyParameterConfiguration);
     55      RegisterInitialFrequencyEvents();
    4356
    4457      var constant = symbol as Constant;
     
    7487
    7588    public virtual void Parameterize(Symbol symbol) {
    76       symbol.InitialFrequency = GetDoubleValue("InitialFrequency");
    77      
     89      var actualValueSymbol = this.ActualValue.Value as Symbol;
     90      symbol.InitialFrequency = parentOptimizable.Optimize ? GetDoubleValue("InitialFrequency") : actualValueSymbol.InitialFrequency;
     91
    7892      var constant = symbol as Constant;
    7993      if (constant != null) {
    80         constant.MinValue = GetDoubleValue("MinValue");
    81         constant.MaxValue = GetDoubleValue("MaxValue");
    82         constant.ManipulatorMu = GetDoubleValue("ManipulatorMu");
    83         constant.ManipulatorSigma = GetDoubleValue("ManipulatorSigma");
    84         constant.MultiplicativeManipulatorSigma = GetDoubleValue("MultiplicativeManipulatorSigma");
     94        var actualValueConstant = this.ActualValue.Value as Constant;
     95        constant.MinValue = parentOptimizable.Optimize ? GetDoubleValue("MinValue") : actualValueConstant.MinValue;
     96        constant.MaxValue = parentOptimizable.Optimize ? GetDoubleValue("MaxValue") : actualValueConstant.MaxValue;
     97        constant.ManipulatorMu = parentOptimizable.Optimize ? GetDoubleValue("ManipulatorMu") : actualValueConstant.ManipulatorMu;
     98        constant.ManipulatorSigma = parentOptimizable.Optimize ? GetDoubleValue("ManipulatorSigma") : actualValueConstant.ManipulatorSigma;
     99        constant.MultiplicativeManipulatorSigma = parentOptimizable.Optimize ? GetDoubleValue("MultiplicativeManipulatorSigma") : actualValueConstant.MultiplicativeManipulatorSigma;
    85100      }
    86      
     101
    87102      var variable = symbol as HeuristicLab.Problems.DataAnalysis.Symbolic.Variable;
    88103      if (variable != null) {
    89         variable.WeightMu = GetDoubleValue("WeightMu");
    90         variable.WeightSigma = GetDoubleValue("WeightSigma");
    91         variable.WeightManipulatorMu = GetDoubleValue("WeightManipulatorMu");
    92         variable.WeightManipulatorSigma = GetDoubleValue("WeightManipulatorSigma");
    93         variable.MultiplicativeWeightManipulatorSigma = GetDoubleValue("MultiplicativeWeightManipulatorSigma");
     104        var actualValueVariable = this.ActualValue.Value as HeuristicLab.Problems.DataAnalysis.Symbolic.Variable;
     105        variable.WeightMu = parentOptimizable.Optimize ? GetDoubleValue("WeightMu") : actualValueVariable.WeightMu;
     106        variable.WeightSigma = parentOptimizable.Optimize ? GetDoubleValue("WeightSigma") : actualValueVariable.WeightSigma;
     107        variable.WeightManipulatorMu = parentOptimizable.Optimize ? GetDoubleValue("WeightManipulatorMu") : actualValueVariable.WeightManipulatorMu;
     108        variable.WeightManipulatorSigma = parentOptimizable.Optimize ? GetDoubleValue("WeightManipulatorSigma") : actualValueVariable.WeightManipulatorSigma;
     109        variable.MultiplicativeWeightManipulatorSigma = parentOptimizable.Optimize ? GetDoubleValue("MultiplicativeWeightManipulatorSigma") : actualValueVariable.MultiplicativeWeightManipulatorSigma;
    94110      }
    95111    }
     
    97113    private double GetDoubleValue(string name) {
    98114      return ((DoubleValue)ParameterConfigurations.Single(x => x.Name == name).ActualValue.Value).Value;
     115    }
     116
     117    private void RegisterInitialFrequencyEvents() {
     118      this.parameterConfigurations.Single(x => x.Name == "InitialFrequency").ToStringChanged += new EventHandler(initialFrequencyParameterConfiguration_ToStringChanged);
     119    }
     120    private void DeregisterInitialFrequencyEvents() {
     121      this.parameterConfigurations.Single(x => x.Name == "InitialFrequency").ToStringChanged -= new EventHandler(initialFrequencyParameterConfiguration_ToStringChanged);
     122    }
     123
     124    protected virtual void initialFrequencyParameterConfiguration_ToStringChanged(object sender, EventArgs e) {
     125      OnToStringChanged();
    99126    }
    100127
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/SymbolicExpressionGrammar/SymbolicExpressionGrammarValueConfiguration.cs

    r6023 r6197  
    2828      var grammar = (ISymbolicExpressionGrammar)item;
    2929      foreach (Symbol symbol in grammar.Symbols) {
    30         var pc = new SingleValuedParameterConfiguration(symbol.Name, new SymbolValueConfiguration(symbol));
     30        var svc = new SymbolValueConfiguration(symbol);
     31        var pc = new SingleValuedParameterConfiguration(symbol.Name, svc);
     32        svc.ParentOptimizable = pc;
    3133        SetOptimizeIfOnlyOneValueConfiguration(pc);
    3234        this.parameterConfigurations.Add(pc);
     
    3638    public virtual void Parameterize(ISymbolicExpressionGrammar grammar) {
    3739      foreach (Symbol symbol in grammar.Symbols) {
    38         ((SymbolValueConfiguration)this.parameterConfigurations.Single(pc => pc.Name == symbol.Name).ValueConfigurations.First()).Parameterize(symbol);
     40        var symbolValueConfiguration = (SymbolValueConfiguration)this.parameterConfigurations.Single(pc => pc.Name == symbol.Name).ValueConfigurations.First();
     41        symbolValueConfiguration.Parameterize(symbol);
    3942      }
    4043    }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmRunsAnalyzer.cs

    r6090 r6197  
    132132          int repetitionIndex = repetitionIndices[i].Value;
    133133
    134           IRun run = algorithms[i].Runs.Single();
     134          IRun run = (IRun)algorithms[i].Runs.Single().Clone();
    135135          MetaOptimizationUtil.ClearResults(run, resultNames);
    136136          MetaOptimizationUtil.ClearParameters(run, parameterNames);
     
    142142          executionTimes[problemIndex][repetitionIndex] = (((TimeSpanValue)run.Results["Execution Time"]).Value);
    143143          evaluatedSolutions[problemIndex][repetitionIndex] = (((IntValue)run.Results["EvaluatedSolutions"]).Value);
    144           runs.Add((IRun)run.Clone());
     144          runs.Add(run);
    145145        }
    146146
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Crossovers/DoubleValue/NormalDoubleValueCrossover.cs

    r6038 r6197  
    3939        offspring.Value = range.ApplyStepSize(offspring.Value);
    4040      } while (!range.IsInRange(offspring.Value));
     41
     42      if (offspring.Value < 0)
     43        throw new Exception("WTF Exception");
     44
    4145      return offspring;
    4246    }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/DoubleValue/NormalDoubleValueManipulator.cs

    r6038 r6197  
    3535      var vector = new RealVector(1);
    3636      double val = value.Value;
    37 
     37     
    3838      do {
    3939        vector[0] = val;
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/IntValue/NormalIntValueManipulator.cs

    r6038 r6197  
    1515      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    1616    }
    17 
     17   
    1818    public NormalIntValueManipulator() { }
    1919    [StorableConstructor]
Note: See TracChangeset for help on using the changeset viewer.