Changeset 9121
- Timestamp:
- 01/07/13 20:21:07 (12 years ago)
- Location:
- branches/CMAES
- Files:
-
- 10 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/CMAES/CMAES.sln
r9115 r9121 7 7 EndProject 8 8 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Optimization-3.3", "HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj", "{14AB8D24-25BC-400C-A846-4627AA945192}" 9 EndProject 10 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.TestFunctions-3.3", "HeuristicLab.Problems.TestFunctions\3.3\HeuristicLab.Problems.TestFunctions-3.3.csproj", "{88B9B0E3-344E-4196-82A3-0F9732506FE8}" 9 11 EndProject 10 12 Global … … 54 56 {14AB8D24-25BC-400C-A846-4627AA945192}.Release|x86.ActiveCfg = Release|x86 55 57 {14AB8D24-25BC-400C-A846-4627AA945192}.Release|x86.Build.0 = Release|x86 58 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Debug|x64.ActiveCfg = Debug|x64 61 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Debug|x64.Build.0 = Debug|x64 62 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Debug|x86.ActiveCfg = Debug|x86 63 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Debug|x86.Build.0 = Debug|x86 64 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Release|Any CPU.Build.0 = Release|Any CPU 66 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Release|x64.ActiveCfg = Release|x64 67 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Release|x64.Build.0 = Release|x64 68 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Release|x86.ActiveCfg = Release|x86 69 {88B9B0E3-344E-4196-82A3-0F9732506FE8}.Release|x86.Build.0 = Release|x86 56 70 EndGlobalSection 57 71 GlobalSection(SolutionProperties) = preSolution 58 72 HideSolutionNode = FALSE 59 73 EndGlobalSection 74 GlobalSection(Performance) = preSolution 75 HasPerformanceSessions = true 76 EndGlobalSection 60 77 EndGlobal -
branches/CMAES/HeuristicLab.Encodings.RealVectorEncoding/3.3/CMAESOperators/CMAInitializer.cs
r9118 r9121 48 48 } 49 49 50 public IValueLookupParameter<DoubleArray> MaxSigmaParameter { 51 get { return (IValueLookupParameter<DoubleArray>)Parameters["MaxSigma"]; } 52 } 53 54 public IValueLookupParameter<DoubleArray> MinSigmaParameter { 55 get { return (IValueLookupParameter<DoubleArray>)Parameters["MinSigma"]; } 50 public IValueLookupParameter<DoubleMatrix> SigmaBoundsParameter { 51 get { return (IValueLookupParameter<DoubleMatrix>)Parameters["SigmaBounds"]; } 56 52 } 57 53 … … 88 84 Parameters.Add(new ValueLookupParameter<IntValue>("Dimension", "The problem dimension (N).")); 89 85 Parameters.Add(new ValueLookupParameter<DoubleArray>("InitialSigma", "The initial value for Sigma (need to be > 0), can be single dimensioned or an array that should be equal to the size of the vector.", new DoubleArray(new[] { 0.5 }))); 90 Parameters.Add(new ValueLookupParameter<DoubleArray>("MaxSigma", "The maximum sigma value can be omitted, given as one value for all dimensions or a value for each dimension.")); 91 Parameters.Add(new ValueLookupParameter<DoubleArray>("MinSigma", "The minimum sigma value can be omitted, given as one value for all dimensions or a value for each dimension.")); 86 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("SigmaBounds", "The bounds for sigma value can be omitted, given as one value for all dimensions or a value for each dimension. First column specifies minimum, second column maximum value.")); 92 87 Parameters.Add(new LookupParameter<IntValue>("Iterations", "The current iteration that is being processed.")); 93 88 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of iterations to be processed.")); 94 Parameters.Add(new ValueLookupParameter<IntValue>("InitialIterations", "The number of iterations that should be performed using the diagonal covariance matrix only." ));89 Parameters.Add(new ValueLookupParameter<IntValue>("InitialIterations", "The number of iterations that should be performed using the diagonal covariance matrix only.", new IntValue(0))); 95 90 Parameters.Add(new LookupParameter<IntValue>("PopulationSize", "The population size (lambda).")); 96 91 Parameters.Add(new LookupParameter<IntValue>("Mu", "The number of offspring considered for updating of the strategy parameters.")); … … 132 127 133 128 // ensure maximal and minimal standard deviations 134 var minSigma = MinSigmaParameter.ActualValue;135 if ( minSigma != null && minSigma.Length> 0) {129 var sigmaBounds = SigmaBoundsParameter.ActualValue; 130 if (sigmaBounds != null && sigmaBounds.Rows > 0) { 136 131 for (int i = 0; i < N; i++) { 137 var d = minSigma[(int)Math.Min(i, minSigma.Length - 1)];132 var d = sigmaBounds[(int)Math.Min(i, sigmaBounds.Rows - 1), 0]; 138 133 if (d > sigma * minSqrtdiagC) sigma = d / minSqrtdiagC; 139 134 } 140 }141 var maxSigma = MaxSigmaParameter.ActualValue;142 if (maxSigma != null && maxSigma.Length > 0) {143 135 for (int i = 0; i < N; i++) { 144 var d = maxSigma[(int)Math.Min(i, maxSigma.Length - 1)];136 var d = sigmaBounds[(int)Math.Min(i, sigmaBounds.Rows - 1), 1]; 145 137 if (d > sigma * maxSqrtdiagC) sigma = d / maxSqrtdiagC; 146 138 } … … 181 173 sp.BDz = new DoubleArray(BDz); 182 174 sp.Sigma = new DoubleValue(sigma); 183 if (maxSigma != null) sp.MaxSigma = (DoubleArray)maxSigma.Clone(); 184 if (minSigma != null) sp.MinSigma = (DoubleArray)minSigma.Clone(); 175 if (sigmaBounds != null) sp.SigmaBounds = (DoubleMatrix)sigmaBounds.Clone(); 185 176 sp.InitialIterations = new IntValue(initialIterations.Value); 186 177 -
branches/CMAES/HeuristicLab.Encodings.RealVectorEncoding/3.3/CMAESOperators/CMAMutator.cs
r9118 r9121 105 105 } else { 106 106 bool inRange; 107 var B = sp.B; 107 108 tries = 0; 108 109 do { … … 116 117 var sum = 0.0; 117 118 for (int j = 0; j < arx.Length; j++) 118 sum += sp.B[i, j] * artmp[j];119 sum += B[i, j] * artmp[j]; 119 120 arx[i] = copy[i] + sp.Sigma.Value * sum; // m + sig * Normal(0,C) 120 121 if (bounds[i % bounds.Rows, 0] > arx[i] || arx[i] > bounds[i % bounds.Rows, 1]) -
branches/CMAES/HeuristicLab.Encodings.RealVectorEncoding/3.3/CMAESOperators/CMAParameters.cs
r9118 r9121 56 56 57 57 [Storable] 58 private DoubleArray minSigma; 59 public DoubleArray MinSigma { 60 get { return minSigma; } 61 set { 62 if (minSigma == value) return; 63 minSigma = value; 64 OnPropertyChanged("MinSigma"); 65 } 66 } 67 68 [Storable] 69 private DoubleArray maxSigma; 70 public DoubleArray MaxSigma { 71 get { return maxSigma; } 72 set { 73 if (maxSigma == value) return; 74 maxSigma = value; 75 OnPropertyChanged("MaxSigma"); 58 private DoubleMatrix sigmaBounds; 59 public DoubleMatrix SigmaBounds { 60 get { return sigmaBounds; } 61 set { 62 if (sigmaBounds == value) return; 63 sigmaBounds = value; 64 OnPropertyChanged("SigmaBounds"); 76 65 } 77 66 } … … 129 118 cs = value; 130 119 OnPropertyChanged("CS"); 131 }132 }133 134 [Storable]135 private DoubleValue c1;136 public DoubleValue C1 {137 get { return c1; }138 set {139 if (c1 == value) return;140 c1 = value;141 OnPropertyChanged("C1");142 }143 }144 145 [Storable]146 private DoubleValue cmu;147 public DoubleValue CMU {148 get { return cmu; }149 set {150 if (cmu == value) return;151 cmu = value;152 OnPropertyChanged("CMU");153 120 } 154 121 } … … 292 259 this.axisRatio = cloner.Clone(original.axisRatio); 293 260 this.b = cloner.Clone(original.b); 261 this.bDz = cloner.Clone(original.bDz); 294 262 this.c = cloner.Clone(original.c); 295 this.c1 = cloner.Clone(original.c1);296 this.cc = cloner.Clone(original.cc);297 263 this.cCov = cloner.Clone(original.cCov); 298 264 this.cCovSep = cloner.Clone(original.cCovSep); 265 this.cc = cloner.Clone(original.cc); 299 266 this.chiN = cloner.Clone(original.chiN); 300 this.cmu = cloner.Clone(original.cmu);301 267 this.cs = cloner.Clone(original.cs); 302 268 this.d = cloner.Clone(original.d); 269 this.damps = cloner.Clone(original.damps); 303 270 this.initialIterations = cloner.Clone(original.initialIterations); 304 this.bDz = cloner.Clone(original.bDz);305 this.maxSigma = cloner.Clone(original.maxSigma);306 this.minSigma = cloner.Clone(original.minSigma);307 271 this.mu = cloner.Clone(original.mu); 308 272 this.muCov = cloner.Clone(original.muCov); … … 311 275 this.ps = cloner.Clone(original.ps); 312 276 this.sigma = cloner.Clone(original.sigma); 277 this.sigmaBounds = cloner.Clone(original.sigmaBounds); 313 278 this.weights = cloner.Clone(original.weights); 314 279 } -
branches/CMAES/HeuristicLab.Encodings.RealVectorEncoding/3.3/CMAESOperators/CMAUpdater.cs
r9118 r9121 157 157 158 158 // ensure maximal and minimal standard deviations 159 if (sp. MinSigma != null && sp.MinSigma.Length> 0) {160 for (int i = 0; i < N; i++) { 161 var d = sp. MinSigma[Math.Min(i, sp.MinSigma.Length - 1)];159 if (sp.SigmaBounds != null && sp.SigmaBounds.Rows > 0) { 160 for (int i = 0; i < N; i++) { 161 var d = sp.SigmaBounds[Math.Min(i, sp.SigmaBounds.Rows - 1), 0]; 162 162 if (d > sp.Sigma.Value * minSqrtdiagC) sp.Sigma.Value = d / minSqrtdiagC; 163 163 } 164 } 165 if (sp.MaxSigma != null && sp.MaxSigma.Length > 0) { 166 for (int i = 0; i < N; i++) { 167 var d = sp.MaxSigma[Math.Min(i, sp.MaxSigma.Length - 1)]; 164 for (int i = 0; i < N; i++) { 165 var d = sp.SigmaBounds[Math.Min(i, sp.SigmaBounds.Rows - 1), 1]; 168 166 if (d > sp.Sigma.Value * maxSqrtdiagC) sp.Sigma.Value = d / maxSqrtdiagC; 169 167 } -
branches/CMAES/HeuristicLab.Optimization/3.3/Interfaces/ICMAESInitializer.cs
r9115 r9121 30 30 Type CMAType { get; } 31 31 32 ILookupParameter<IntValue> PopulationSizeParameter { get; } 32 33 ILookupParameter<IntValue> MuParameter { get; } 34 IValueLookupParameter<DoubleArray> InitialSigmaParameter { get; } 33 35 } 34 36 } -
branches/CMAES/HeuristicLab.Problems.TestFunctions/3.3/HeuristicLab.Problems.TestFunctions-3.3.csproj
r8720 r9121 41 41 <DebugType>full</DebugType> 42 42 <Optimize>false</Optimize> 43 <OutputPath> $(SolutionDir)\bin\</OutputPath>43 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 44 44 <DefineConstants>DEBUG;TRACE</DefineConstants> 45 45 <ErrorReport>prompt</ErrorReport> … … 50 50 <DebugType>pdbonly</DebugType> 51 51 <Optimize>true</Optimize> 52 <OutputPath> $(SolutionDir)\bin\</OutputPath>52 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 53 53 <DefineConstants>TRACE</DefineConstants> 54 54 <ErrorReport>prompt</ErrorReport> … … 58 58 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 59 59 <DebugSymbols>true</DebugSymbols> 60 <OutputPath> $(SolutionDir)\bin\</OutputPath>60 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 61 61 <DefineConstants>DEBUG;TRACE</DefineConstants> 62 62 <DebugType>full</DebugType> … … 66 66 </PropertyGroup> 67 67 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 68 <OutputPath> $(SolutionDir)\bin\</OutputPath>68 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 69 69 <DefineConstants>TRACE</DefineConstants> 70 70 <Optimize>true</Optimize> … … 76 76 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 77 77 <DebugSymbols>true</DebugSymbols> 78 <OutputPath> $(SolutionDir)\bin\</OutputPath>78 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 79 79 <DefineConstants>DEBUG;TRACE</DefineConstants> 80 80 <DebugType>full</DebugType> … … 84 84 </PropertyGroup> 85 85 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 86 <OutputPath> $(SolutionDir)\bin\</OutputPath>86 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 87 87 <DefineConstants>TRACE</DefineConstants> 88 88 <Optimize>true</Optimize> … … 93 93 </PropertyGroup> 94 94 <ItemGroup> 95 <Reference Include="HeuristicLab.Analysis-3.3"> 96 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath> 97 <Private>False</Private> 98 </Reference> 99 <Reference Include="HeuristicLab.Collections-3.3"> 100 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath> 101 <Private>False</Private> 102 </Reference> 103 <Reference Include="HeuristicLab.Common-3.3"> 104 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 105 <Private>False</Private> 106 </Reference> 107 <Reference Include="HeuristicLab.Common.Resources-3.3"> 108 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 109 <Private>False</Private> 110 </Reference> 111 <Reference Include="HeuristicLab.Core-3.3"> 112 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 113 <Private>False</Private> 114 </Reference> 115 <Reference Include="HeuristicLab.Data-3.3"> 116 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 117 <Private>False</Private> 118 </Reference> 119 <Reference Include="HeuristicLab.Operators-3.3"> 120 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath> 121 <Private>False</Private> 122 </Reference> 123 <Reference Include="HeuristicLab.Optimization.Operators-3.3"> 124 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath> 125 <Private>False</Private> 126 </Reference> 127 <Reference Include="HeuristicLab.Parameters-3.3"> 128 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath> 129 <Private>False</Private> 130 </Reference> 131 <Reference Include="HeuristicLab.Persistence-3.3"> 132 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 133 <Private>False</Private> 134 </Reference> 135 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 136 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 137 <Private>False</Private> 138 </Reference> 95 139 <Reference Include="System" /> 96 140 <Reference Include="System.Core"> … … 162 206 </ItemGroup> 163 207 <ItemGroup> 164 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">165 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>166 <Name>HeuristicLab.Analysis-3.3</Name>167 </ProjectReference>168 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">169 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>170 <Name>HeuristicLab.Collections-3.3</Name>171 <Private>False</Private>172 </ProjectReference>173 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">174 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>175 <Name>HeuristicLab.Common.Resources-3.3</Name>176 <Private>False</Private>177 </ProjectReference>178 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">179 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>180 <Name>HeuristicLab.Common-3.3</Name>181 <Private>False</Private>182 </ProjectReference>183 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">184 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>185 <Name>HeuristicLab.Core-3.3</Name>186 <Private>False</Private>187 </ProjectReference>188 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">189 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>190 <Name>HeuristicLab.Data-3.3</Name>191 <Private>False</Private>192 </ProjectReference>193 208 <ProjectReference Include="..\..\HeuristicLab.Encodings.RealVectorEncoding\3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj"> 194 209 <Project>{BB6D334A-4BB6-4674-9883-31A6EBB32CAB}</Project> 195 210 <Name>HeuristicLab.Encodings.RealVectorEncoding-3.3</Name> 196 211 <Private>False</Private> 197 </ProjectReference>198 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">199 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>200 <Name>HeuristicLab.Operators-3.3</Name>201 <Private>False</Private>202 </ProjectReference>203 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">204 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>205 <Name>HeuristicLab.Optimization.Operators-3.3</Name>206 212 </ProjectReference> 207 213 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 208 214 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 209 215 <Name>HeuristicLab.Optimization-3.3</Name> 210 <Private>False</Private>211 </ProjectReference>212 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">213 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>214 <Name>HeuristicLab.Parameters-3.3</Name>215 <Private>False</Private>216 </ProjectReference>217 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">218 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>219 <Name>HeuristicLab.Persistence-3.3</Name>220 <Private>False</Private>221 </ProjectReference>222 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">223 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>224 <Name>HeuristicLab.PluginInfrastructure-3.3</Name>225 216 <Private>False</Private> 226 217 </ProjectReference> -
branches/CMAES/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
r8720 r9121 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 22 using HeuristicLab.Analysis; 26 23 using HeuristicLab.Common; … … 32 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 30 using HeuristicLab.PluginInfrastructure; 31 using System; 32 using System.Collections.Generic; 33 using System.Linq; 34 34 35 35 namespace HeuristicLab.Problems.TestFunctions { … … 330 330 try { 331 331 BestKnownSolutionParameter.Value = Evaluator.GetBestKnownSolution(ProblemSize.Value); 332 } 333 catch (ArgumentException e) { 332 } catch (ArgumentException e) { 334 333 ErrorHandling.ShowErrorDialog(e); 335 334 ProblemSize.Value = Evaluator.MinimumProblemSize; … … 337 336 } 338 337 private void ParameterizeOperators() { 339 foreach ( IRealVectorCrossover op in Operators.OfType<IRealVectorCrossover>()) {338 foreach (var op in Operators.OfType<IRealVectorCrossover>()) { 340 339 op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 341 340 op.ParentsParameter.Hidden = true; … … 345 344 op.BoundsParameter.Hidden = true; 346 345 } 347 foreach ( IRealVectorManipulator op in Operators.OfType<IRealVectorManipulator>()) {346 foreach (var op in Operators.OfType<IRealVectorManipulator>()) { 348 347 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 349 348 op.RealVectorParameter.Hidden = true; … … 351 350 op.BoundsParameter.Hidden = true; 352 351 } 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>()) {352 foreach (var op in Operators.OfType<IRealVectorMoveOperator>()) { 353 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 354 op.RealVectorParameter.Hidden = true; 355 } 356 foreach (var op in Operators.OfType<IRealVectorMoveGenerator>()) { 358 357 op.BoundsParameter.ActualName = BoundsParameter.Name; 359 358 op.BoundsParameter.Hidden = true; 360 359 } 361 foreach ( ISingleObjectiveTestFunctionAdditiveMoveEvaluator op in Operators.OfType<ISingleObjectiveTestFunctionAdditiveMoveEvaluator>()) {360 foreach (var op in Operators.OfType<ISingleObjectiveTestFunctionAdditiveMoveEvaluator>()) { 362 361 op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 363 362 op.QualityParameter.Hidden = true; … … 365 364 op.RealVectorParameter.Hidden = true; 366 365 } 367 foreach ( IRealVectorParticleCreator op in Operators.OfType<IRealVectorParticleCreator>()) {366 foreach (var op in Operators.OfType<IRealVectorParticleCreator>()) { 368 367 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 369 368 op.RealVectorParameter.Hidden = true; … … 373 372 op.ProblemSizeParameter.Hidden = true; 374 373 } 375 foreach ( IRealVectorParticleUpdater op in Operators.OfType<IRealVectorParticleUpdater>()) {374 foreach (var op in Operators.OfType<IRealVectorParticleUpdater>()) { 376 375 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 377 376 op.RealVectorParameter.Hidden = true; … … 379 378 op.BoundsParameter.Hidden = true; 380 379 } 381 foreach ( IRealVectorSwarmUpdater op in Operators.OfType<IRealVectorSwarmUpdater>()) {380 foreach (var op in Operators.OfType<IRealVectorSwarmUpdater>()) { 382 381 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 383 382 op.RealVectorParameter.Hidden = true; … … 385 384 op.MaximizationParameter.Hidden = true; 386 385 } 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>()) {386 foreach (var op in Operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>()) { 387 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 388 op.RealVectorParameter.Hidden = true; 389 } 390 foreach (var op in Operators.OfType<ISingleObjectiveImprovementOperator>()) { 392 391 op.SolutionParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 393 392 op.SolutionParameter.Hidden = true; 394 393 } 395 foreach ( ISingleObjectivePathRelinker op in Operators.OfType<ISingleObjectivePathRelinker>()) {394 foreach (var op in Operators.OfType<ISingleObjectivePathRelinker>()) { 396 395 op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 397 396 op.ParentsParameter.Hidden = true; 398 397 } 399 foreach ( SingleObjectiveTestFunctionSimilarityCalculator op in Operators.OfType<SingleObjectiveTestFunctionSimilarityCalculator>()) {398 foreach (var op in Operators.OfType<SingleObjectiveTestFunctionSimilarityCalculator>()) { 400 399 op.SolutionVariableName = SolutionCreator.RealVectorParameter.ActualName; 401 400 op.QualityVariableName = Evaluator.QualityParameter.ActualName; 402 401 op.Bounds = Bounds; 403 402 } 403 foreach (var op in Operators.OfType<CMAInitializer>()) { 404 op.DimensionParameter.ActualName = ProblemSizeParameter.Name; 405 } 406 foreach (var op in Operators.OfType<CMAMutator>()) { 407 op.BoundsParameter.ActualName = BoundsParameter.Name; 408 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 409 } 410 foreach (var op in Operators.OfType<CMARecombinator>()) { 411 op.MeanParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 412 op.OffspringParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 413 } 414 foreach (var op in Operators.OfType<CMAUpdater>()) { 415 op.MeansParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 416 op.OffspringParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 417 } 404 418 } 405 419 private void UpdateStrategyVectorBounds() { 406 DoubleMatrixstrategyBounds = (DoubleMatrix)Bounds.Clone();420 var strategyBounds = (DoubleMatrix)Bounds.Clone(); 407 421 for (int i = 0; i < strategyBounds.Rows; i++) { 408 422 if (strategyBounds[i, 0] < 0) strategyBounds[i, 0] = 0;
Note: See TracChangeset
for help on using the changeset viewer.