- Timestamp:
- 05/14/11 18:49:46 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs
r6090 r6197 48 48 //private static double mutationProbability = 0.10; 49 49 50 private static int metaAlgorithmPopulationSize = 10;51 private static int metaAlgorithmMaxGenerations = 20;50 private static int metaAlgorithmPopulationSize = 4; 51 private static int metaAlgorithmMaxGenerations = 10; 52 52 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; 55 55 private static int baseAlgorithmPopulationSize = 10; 56 56 57 57 public override void Run() { 58 58 ContentManager.Initialize(new PersistenceContentManager()); … … 60 60 //TestTableBuilder(); 61 61 //TestShorten(); 62 63 64 var x = typeof(float).IsPrimitive; 62 65 63 66 //TestSimilarities(); return; … … 79 82 80 83 //TestSymbolicDataAnalysisGrammar(); return; 84 //TestObjectGraphObjectsTraversal(); return; 85 //TestParameterizedItem(); return; 81 86 82 87 //MetaOptimizationProblem metaOptimizationProblem = LoadOptimizationProblem("Meta Optimization Problem (Genetic Programming - Symbolic Regression 3.4 scaled).hl"); … … 92 97 //EvolutionStrategy metaLevelAlgorithm = GetMetaES(metaOptimizationProblem); 93 98 94 //Console.WriteLine("Press enter to start"); 95 //Console.ReadLine(); 99 //Console.WriteLine("Press enter to start"); Console.ReadLine(); 96 100 //TestConfiguration(algorithmVc, typeof(GeneticAlgorithm), metaOptimizationProblem.Problems.First()); 97 101 98 //Console.WriteLine("Press enter to start"); 99 //Console.ReadLine(); 102 Console.WriteLine("Press enter to start"); Console.ReadLine(); 100 103 TestOptimization(metaLevelAlgorithm); 101 104 … … 103 106 104 107 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); 105 152 } 106 153 … … 733 780 private static ParameterConfigurationTree SetupGAAlgorithm(Type baseLevelAlgorithmType, MetaOptimizationProblem metaOptimizationProblem) { 734 781 metaOptimizationProblem.AlgorithmType.Value = baseLevelAlgorithmType; 735 736 //metaOptimizationProblem.ProblemType.Value = typeof(SingleObjectiveTestFunctionProblem);782 783 metaOptimizationProblem.ProblemType.Value = typeof(SingleObjectiveTestFunctionProblem); 737 784 //metaOptimizationProblem.Problems.Clear(); 738 785 //metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() { … … 753 800 754 801 // 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; 757 804 758 805 ParameterConfigurationTree algorithmVc = metaOptimizationProblem.ParameterConfigurationTree; 759 806 ((IntValue)algorithmVc.AlgorithmConfiguration.ParameterConfigurations.Single(x => x.Name == "MaximumGenerations").ActualValue.Value).Value = baseAlgorithmMaxGenerations; 760 807 ((IntValue)algorithmVc.AlgorithmConfiguration.ParameterConfigurations.Single(x => x.Name == "PopulationSize").ActualValue.Value).Value = baseAlgorithmPopulationSize; 761 808 762 809 //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); 765 812 //ConfigureElites(algorithmVc, 0, 10, 1); 766 813 //ConfigureSelectionOperator(algorithmVc, true); 767 814 768 ConfigureSymbolicExpressionGrammar(algorithmVc);815 //ConfigureSymbolicExpressionGrammar(algorithmVc); 769 816 770 817 return algorithmVc; … … 992 1039 993 1040 ContentManager.Save((IStorableContent)metaLevelAlgorithm, resultPath + "-before.hl", true); 994 1041 995 1042 using (var sw = new StreamWriter(outputPath)) { 996 1043 sw.AutoFlush = true; … … 1262 1309 } 1263 1310 } 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 } 1264 1350 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers/BestParameterConfigurationAnalyzer.cs
r6090 r6197 102 102 RunCollection rc = new RunCollection(); 103 103 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)); 105 105 i++; 106 106 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers/PMOBestSolutionHistoryAnalyzer.cs
r6018 r6197 76 76 } 77 77 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); 79 79 run.Results.Add("Meta.Generation", new IntValue(currentGeneration)); 80 80 run.Results.Add("Meta.ParameterInfoString", new StringValue(best.ParameterInfoString)); -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs
r6018 r6197 184 184 this.parameters.Add(p.Key, cloner.Clone(p.Value)); 185 185 } 186 //this.name = original.name;187 186 } 188 187 public override IDeepCloneable Clone(Cloner cloner) { … … 291 290 } 292 291 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) { 298 297 IRun run = new Run(); 299 298 run.Name = name; 300 299 this.CollectResultValues(run.Results); 301 300 this.CollectParameterValues(run.Parameters); 302 MetaOptimizationUtil.ClearParameters(run, this.GetOptimizedParameterNames());301 if(clearParameters) MetaOptimizationUtil.ClearParameters(run, this.GetOptimizedParameterNames()); 303 302 return run; 304 303 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs
r6018 r6197 211 211 this.validTypes = original.validTypes.ToArray(); 212 212 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(); 214 216 this.optimize = original.optimize; 215 217 this.actualValueConfigurationIndex = original.actualValueConfigurationIndex; … … 217 219 this.itemImage = original.itemImage; 218 220 this.discoverValidValues = original.discoverValidValues; 219 if (this.valueConfigurations != null) RegisterValueConfigurationEvents();220 221 this.AutoPopulateValueConfigurations = original.AutoPopulateValueConfigurations; 221 222 } … … 226 227 } 227 228 [StorableHook(HookType.AfterDeserialization)] 228 pr ivatevoid AfterDeserialization() {229 protected virtual void AfterDeserialization() { 229 230 if (this.valueConfigurations != null) RegisterValueConfigurationEvents(); 231 if (this.actualValue != null) RegisterActualValueEvents(); 230 232 } 231 233 #endregion … … 400 402 401 403 #region Events 402 void ActualValue_ToStringChanged(object sender, EventArgs e) {404 protected virtual void ActualValue_ToStringChanged(object sender, EventArgs e) { 403 405 OnToStringChanged(); 404 406 } … … 495 497 var clonedValue = this.ActualValue.Value != null ? (IItem)this.ActualValue.Value.Clone() : null; 496 498 if (clonedValue != null) AdaptValidValues(parameter, clonedValue); 497 parameter. Value = clonedValue;499 parameter.ActualValue = clonedValue; 498 500 } 499 501 -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/SingleValuedParameterConfiguration.cs
r6018 r6197 8 8 [StorableClass] 9 9 public class SingleValuedParameterConfiguration : ParameterConfiguration { 10 10 11 11 #region Constructors and Cloning 12 12 [StorableConstructor] … … 25 25 this.validValues = new ItemSet<IItem> { valueConfiguration.ActualValue.Value }; 26 26 this.validTypes = new Type[] { valueConfiguration.ActualValue.ValueDataType }; 27 this. IsNullable = false;27 this.isNullable = false; 28 28 this.itemImage = valueConfiguration.ItemImage; 29 29 this.ValueConfigurations = new CheckedValueConfigurationList { valueConfiguration }; … … 54 54 55 55 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(); 58 58 if (this.Optimize) { 59 59 return syVc.ToString() + " (Optimize)"; 60 60 } else { 61 return syVc.ToString();61 return ActualValue.ToString(); 62 62 } 63 63 } else { … … 66 66 } 67 67 68 pr ivatevoid valueConfiguration_ToStringChanged(object sender, EventArgs e) {68 protected virtual void valueConfiguration_ToStringChanged(object sender, EventArgs e) { 69 69 OnToStringChanged(); 70 70 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/ConstrainedValue.cs
r5522 r6197 1 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 2 using HeuristicLab.Common; 5 3 using HeuristicLab.Core; 6 using HeuristicLab. Common;4 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 7 5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 using HeuristicLab.Data;9 6 10 7 namespace HeuristicLab.Problems.MetaOptimization { … … 56 53 private void RegisterEvents() { 57 54 this.value.ToStringChanged += new EventHandler(value_ToStringChanged); 55 if (this.value is Symbol) { 56 ((Symbol)this.value).Changed += new EventHandler(ConstrainedValue_Changed); 57 } 58 58 } 59 59 60 private void DeregisterEvents() { 60 61 this.value.ToStringChanged -= new EventHandler(value_ToStringChanged); 62 if (this.value is Symbol) { 63 ((Symbol)this.value).Changed -= new EventHandler(ConstrainedValue_Changed); 64 } 61 65 } 62 66 … … 90 94 } 91 95 96 private void ConstrainedValue_Changed(object sender, EventArgs e) { 97 OnToStringChanged(); 98 } 99 92 100 public override string ToString() { 101 if (this.value is Symbol) { 102 return string.Format("{0}: {1}", this.value, ((Symbol)this.value).InitialFrequency); 103 } 93 104 return value != null ? value.ToString() : base.ToString(); 94 105 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/SymbolicExpressionGrammar/SymbolValueConfiguration.cs
r6023 r6197 1 using System.Collections.Generic; 1 using System; 2 using System.Collections.Generic; 2 3 using System.Linq; 3 4 using HeuristicLab.Common; … … 11 12 [StorableClass] 12 13 public class SymbolValueConfiguration : ParameterizedValueConfiguration { 14 [Storable] 15 private IOptimizable parentOptimizable; 16 public IOptimizable ParentOptimizable { 17 get { return parentOptimizable; } 18 set { this.parentOptimizable = value; } 19 } 13 20 14 21 #region Constructors and Cloning … … 21 28 this.Optimize = false; 22 29 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); 24 31 } 25 32 protected SymbolValueConfiguration(SymbolValueConfiguration original, Cloner cloner) 26 33 : base(original, cloner) { 34 RegisterInitialFrequencyEvents(); 35 this.parentOptimizable = cloner.Clone(original.parentOptimizable); 27 36 } 28 37 public override IDeepCloneable Clone(Cloner cloner) { 29 38 return new SymbolValueConfiguration(this, cloner); 39 } 40 [StorableHook(HookType.AfterDeserialization)] 41 private void AfterDeserialization() { 42 RegisterInitialFrequencyEvents(); 30 43 } 31 44 #endregion … … 33 46 protected override void PopulateParameterConfigurations(IItem item, bool discoverValidValues) { 34 47 this.ClearParameterConfigurations(); 35 36 48 var symbol = (Symbol)item; 37 49 … … 41 53 var initialFrequencyParameterConfiguration = new ParameterConfiguration("InitialFrequency", typeof(Symbol), new DoubleValue(symbol.InitialFrequency), initialFrequencyValueConfigurations); 42 54 this.parameterConfigurations.Add(initialFrequencyParameterConfiguration); 55 RegisterInitialFrequencyEvents(); 43 56 44 57 var constant = symbol as Constant; … … 74 87 75 88 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 78 92 var constant = symbol as Constant; 79 93 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; 85 100 } 86 101 87 102 var variable = symbol as HeuristicLab.Problems.DataAnalysis.Symbolic.Variable; 88 103 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; 94 110 } 95 111 } … … 97 113 private double GetDoubleValue(string name) { 98 114 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(); 99 126 } 100 127 -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/SymbolicExpressionGrammar/SymbolicExpressionGrammarValueConfiguration.cs
r6023 r6197 28 28 var grammar = (ISymbolicExpressionGrammar)item; 29 29 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; 31 33 SetOptimizeIfOnlyOneValueConfiguration(pc); 32 34 this.parameterConfigurations.Add(pc); … … 36 38 public virtual void Parameterize(ISymbolicExpressionGrammar grammar) { 37 39 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); 39 42 } 40 43 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmRunsAnalyzer.cs
r6090 r6197 132 132 int repetitionIndex = repetitionIndices[i].Value; 133 133 134 IRun run = algorithms[i].Runs.Single();134 IRun run = (IRun)algorithms[i].Runs.Single().Clone(); 135 135 MetaOptimizationUtil.ClearResults(run, resultNames); 136 136 MetaOptimizationUtil.ClearParameters(run, parameterNames); … … 142 142 executionTimes[problemIndex][repetitionIndex] = (((TimeSpanValue)run.Results["Execution Time"]).Value); 143 143 evaluatedSolutions[problemIndex][repetitionIndex] = (((IntValue)run.Results["EvaluatedSolutions"]).Value); 144 runs.Add( (IRun)run.Clone());144 runs.Add(run); 145 145 } 146 146 -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Crossovers/DoubleValue/NormalDoubleValueCrossover.cs
r6038 r6197 39 39 offspring.Value = range.ApplyStepSize(offspring.Value); 40 40 } while (!range.IsInRange(offspring.Value)); 41 42 if (offspring.Value < 0) 43 throw new Exception("WTF Exception"); 44 41 45 return offspring; 42 46 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/DoubleValue/NormalDoubleValueManipulator.cs
r6038 r6197 35 35 var vector = new RealVector(1); 36 36 double val = value.Value; 37 37 38 38 do { 39 39 vector[0] = val; -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/IntValue/NormalIntValueManipulator.cs
r6038 r6197 15 15 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 16 16 } 17 17 18 18 public NormalIntValueManipulator() { } 19 19 [StorableConstructor]
Note: See TracChangeset
for help on using the changeset viewer.