- Timestamp:
- 04/17/11 11:03:48 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3
- Files:
-
- 17 added
- 12 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/Crossovers/ParameterConfigurationCrossover.cs
r5653 r6017 1 using HeuristicLab.Common; 1 using System; 2 using HeuristicLab.Common; 2 3 using HeuristicLab.Core; 3 4 using HeuristicLab.Data; 4 5 using HeuristicLab.Encodings.IntegerVectorEncoding; 5 using HeuristicLab.Encodings.RealVectorEncoding;6 6 using HeuristicLab.Operators; 7 using HeuristicLab.Optimization;8 7 using HeuristicLab.Parameters; 9 8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 10 using System;11 9 12 10 namespace HeuristicLab.Problems.MetaOptimization { … … 96 94 } 97 95 98 p rivate static void Cross(IRandom random, IOptimizable configuartion, IOptimizable other, IIntValueCrossover intValueCrossover, IDoubleValueCrossover doubleValueCrossover) {99 var vc = configu artion as RangeValueConfiguration;100 var pc = configu artion as IParameterConfiguration;96 public static void Cross(IRandom random, IOptimizable configuration, IOptimizable other, IIntValueCrossover intValueCrossover, IDoubleValueCrossover doubleValueCrossover) { 97 var vc = configuration as RangeValueConfiguration; 98 var pc = configuration as IParameterConfiguration; 101 99 if (vc != null) { 102 100 var value = vc.ActualValue.Value; -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/Manipulators/ParameterConfigurationManipulator.cs
r5653 r6017 51 51 } 52 52 53 p rotectedstatic void Mutate(IRandom random, IOptimizable configuration, IIntValueManipulator intValueManipulator, IDoubleValueManipulator doubleValueManipulator) {53 public static void Mutate(IRandom random, IOptimizable configuration, IIntValueManipulator intValueManipulator, IDoubleValueManipulator doubleValueManipulator) { 54 54 var vc = configuration as RangeValueConfiguration; 55 55 var pc = configuration as IParameterConfiguration; -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs
r5927 r6017 138 138 protected IItemSet<IItem> validValues; 139 139 140 [Storable] 141 private bool autoPopulateValueConfigurations = true; 142 public bool AutoPopulateValueConfigurations { 143 get { return autoPopulateValueConfigurations; } 144 set { autoPopulateValueConfigurations = value; } 145 } 146 147 140 148 #region Constructors and Cloning 141 149 public ParameterConfiguration(string parameterName, IValueParameter valueParameter, bool discoverValidValues) { 150 this.AutoPopulateValueConfigurations = true; 142 151 this.ParameterName = parameterName; 143 152 this.parameterDataType = valueParameter.GetType(); … … 162 171 } 163 172 public ParameterConfiguration(string parameterName, Type type, IItem actualValue, IEnumerable<IValueConfiguration> valueConfigurations) { 173 this.AutoPopulateValueConfigurations = false; 164 174 this.ParameterName = parameterName; 165 175 this.parameterDataType = type; … … 174 184 } 175 185 public ParameterConfiguration(string parameterName, Type type, IItem actualValue) { 186 this.AutoPopulateValueConfigurations = true; 176 187 this.ParameterName = parameterName; 177 188 this.parameterDataType = type; … … 206 217 this.discoverValidValues = original.discoverValidValues; 207 218 if (this.valueConfigurations != null) RegisterValueConfigurationEvents(); 219 this.AutoPopulateValueConfigurations = original.AutoPopulateValueConfigurations; 208 220 } 209 221 … … 238 250 239 251 protected virtual void PopulateValueConfigurations() { 252 if (!this.AutoPopulateValueConfigurations) 253 return; 254 240 255 foreach (Type t in this.validTypes) { 241 256 if (t == typeof(NullValue)) { … … 266 281 267 282 protected virtual void ClearValueConfigurations() { 283 if (!this.AutoPopulateValueConfigurations) 284 return; 285 268 286 this.ValueConfigurations.Clear(); 269 287 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmEvaluator.cs
r5655 r6017 1 1 using System; 2 2 using System.Diagnostics; 3 using System.Linq; 3 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Core; 5 6 using HeuristicLab.Data; 7 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 6 8 using HeuristicLab.Operators; 7 9 using HeuristicLab.Optimization; 8 10 using HeuristicLab.Parameters; 9 11 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression; 10 13 11 14 namespace HeuristicLab.Problems.MetaOptimization { … … 54 57 IAlgorithm algorithm = AlgorithmParameter.ActualValue; 55 58 59 #region Debug Code for SymbolicRegressionGrammar 60 var srp = (SymbolicRegressionSingleObjectiveProblem)algorithm.Problem; 61 //Console.WriteLine("Evaluating Grammar: " + PrintGrammar(srp.SymbolicExpressionTreeGrammar)); 62 #endregion 63 56 64 var sw = new Stopwatch(); 57 65 sw.Start(); 58 66 algorithm.StartSync(); 59 67 sw.Stop(); 60 Console.WriteLine("{0},{1}: {2} ", ProblemIndexParameter.ActualValue.Value, RepetitionIndexParameter.ActualValue.Value, sw.Elapsed);68 Console.WriteLine("{0},{1}: {2} (Grammar: {3})", ProblemIndexParameter.ActualValue.Value, RepetitionIndexParameter.ActualValue.Value, sw.Elapsed, PrintGrammar(srp.SymbolicExpressionTreeGrammar)); 61 69 62 70 RunsParameter.Value = new ItemList<IRun>(algorithm.Runs); … … 72 80 parameterConfiguration.Randomize(random); 73 81 } 82 83 // for debug purposes, remove later 84 private static string PrintGrammar(ISymbolicExpressionGrammar grammar) { 85 return string.Join(string.Empty, grammar.Symbols.Select(x => x.InitialFrequency).ToArray()); 86 //foreach (var symbol in grammar.Symbols) { 87 // Console.WriteLine("{0} ({1})", symbol.ToString(), symbol.InitialFrequency); 88 //} 89 } 74 90 } 75 91 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/HeuristicLab.Problems.MetaOptimization-3.3.csproj
r5927 r6017 126 126 <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath> 127 127 </Reference> 128 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4"> 129 <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath> 130 </Reference> 128 131 <Reference Include="HeuristicLab.Problems.TestFunctions-3.3"> 129 132 <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.TestFunctions-3.3.dll</HintPath> … … 154 157 <Compile Include="Encoding\AlgorithmProblemItem.cs" /> 155 158 <Compile Include="Encoding\ParameterConfigurations\SingleValuedParameterConfiguration.cs" /> 156 <Compile Include="Encoding\Symbolic Regression\SymbolValueConfiguration.cs" />157 <Compile Include="Encoding\Symbolic Regression\SymbolicExpressionGrammarValueConfiguration.cs" />159 <Compile Include="Encoding\SymbolicExpressionGrammar\SymbolValueConfiguration.cs" /> 160 <Compile Include="Encoding\SymbolicExpressionGrammar\SymbolicExpressionGrammarValueConfiguration.cs" /> 158 161 <Compile Include="Encoding\ValueConfigurations\RangeValueConfiguration.cs" /> 159 162 <Compile Include="Encoding\ValueConfigurations\ParameterizedValueConfiguration.cs" /> … … 163 166 <Compile Include="Evaluators\PMOEvaluator.cs" /> 164 167 <Compile Include="MetaOptimizationUtil.cs" /> 165 <Compile Include="Operators\Crossovers\ MultiIntValueCrossover.cs" />168 <Compile Include="Operators\Crossovers\IntValue\MultiIntValueCrossover.cs" /> 166 169 <Compile Include="TypeValue.cs" /> 167 170 <None Include="Properties\AssemblyInfo.cs.frame" /> … … 189 192 <Compile Include="Interfaces\IParameterConfigurationCrossover.cs" /> 190 193 <Compile Include="Interfaces\ICheckedValueConfigurationCollection.cs" /> 191 <Compile Include="Operators\Crossovers\ AverageDoubleValueCrossover.cs" />192 <Compile Include="Operators\Crossovers\ AverageIntValueCrossover.cs" />193 <Compile Include="Operators\Crossovers\ NormalIntValueCrossover.cs" />194 <Compile Include="Operators\Crossovers\ NormalDoubleValueCrossover.cs" />195 <Compile Include="Operators\Crossovers\D iscreteDoubleValueCrossover.cs" />196 <Compile Include="Operators\Crossovers\ DiscreteIntValueCrossover.cs" />194 <Compile Include="Operators\Crossovers\DoubleValue\AverageDoubleValueCrossover.cs" /> 195 <Compile Include="Operators\Crossovers\IntValue\AverageIntValueCrossover.cs" /> 196 <Compile Include="Operators\Crossovers\IntValue\NormalIntValueCrossover.cs" /> 197 <Compile Include="Operators\Crossovers\DoubleValue\NormalDoubleValueCrossover.cs" /> 198 <Compile Include="Operators\Crossovers\DoubleValue\DiscreteDoubleValueCrossover.cs" /> 199 <Compile Include="Operators\Crossovers\IntValue\DiscreteIntValueCrossover.cs" /> 197 200 <Compile Include="Operators\Interfaces\IDoubleValueCrossover.cs" /> 198 201 <Compile Include="Operators\Interfaces\IDoubleValueManipulator.cs" /> … … 213 216 <Compile Include="Operators\Interfaces\IIntValueCrossover.cs" /> 214 217 <Compile Include="Operators\Interfaces\IValueManipulator.cs" /> 215 <Compile Include="Operators\Manipulators\ NormalIntValueManipulator.cs" />216 <Compile Include="Operators\Manipulators\ UniformIntValueManipulator.cs" />217 <Compile Include="Operators\Manipulators\ UniformDoubleValueManipulator.cs" />218 <Compile Include="Operators\Manipulators\ NormalDoubleValueManipulator.cs" />218 <Compile Include="Operators\Manipulators\IntValue\NormalIntValueManipulator.cs" /> 219 <Compile Include="Operators\Manipulators\IntValue\UniformIntValueManipulator.cs" /> 220 <Compile Include="Operators\Manipulators\DoubleValue\UniformDoubleValueManipulator.cs" /> 221 <Compile Include="Operators\Manipulators\DoubleValue\NormalDoubleValueManipulator.cs" /> 219 222 <Compile Include="Properties\AssemblyInfo.cs" /> 220 223 <Compile Include="MetaOptimizationProblem.cs" /> … … 225 228 <None Include="UpdateLocalInstallation.cmd" /> 226 229 </ItemGroup> 227 <ItemGroup /> 230 <ItemGroup> 231 <Folder Include="Operators\Crossovers\SymbolicExpressionGrammar\" /> 232 </ItemGroup> 228 233 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 229 234 <PropertyGroup> -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/MetaOptimizationProblem.cs
r5927 r6017 309 309 } 310 310 ParameterConfigurationTreeParameter.ActualValue = new ParameterConfigurationTree(algorithm, Problems.First()); 311 312 311 } 313 312 }
Note: See TracChangeset
for help on using the changeset viewer.