Changeset 15277
- Timestamp:
- 07/21/17 11:18:40 (7 years ago)
- Location:
- stable
- Files:
-
- 4 deleted
- 30 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 15071,15076,15091-15093,15096,15102,15114,15181,15201,15214,15223-15224,15228
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/AdaptiveRandomTopologyUpdater.cs
r15181 r15277 86 86 var successor = new OperationCollection(new[] { base.Apply() }); 87 87 var max = MaximizationParameter.ActualValue.Value; 88 if (max && swarmBest.Value >= previousBest.Value89 || !max && swarmBest.Value <= previousBest.Value)88 if (max && swarmBest.Value <= previousBest.Value 89 || !max && swarmBest.Value >= previousBest.Value) 90 90 successor.Insert(0, ExecutionContext.CreateOperation(TopologyInitializerParameter.ActualValue)); 91 91 -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/HeuristicLab.Algorithms.ParticleSwarmOptimization-3.3.csproj
r11920 r15277 113 113 </ItemGroup> 114 114 <ItemGroup> 115 <Compile Include="AdaptiveRandomTopologyUpdater.cs" /> 115 116 <Compile Include="MultiPSOTopologyUpdater.cs" /> 116 117 <Compile Include="ParticleSwarmOptimizationMainLoop.cs" /> 117 118 <Compile Include="Plugin.cs" /> 119 <Compile Include="SPSORandomTopologyInitializer.cs" /> 118 120 <Compile Include="RandomTopologyInitializer.cs" /> 119 121 <Compile Include="VonNeumannTopologyInitializer.cs" /> -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/MultiPSOTopologyUpdater.cs
r14186 r15277 33 33 [Item("Multi PSO Topology Updater", "Splits swarm into NrOfSwarms non-overlapping sub-swarms. Swarms are re-grouped every regroupingPeriod iteration. The operator is implemented as described in Liang, J.J. and Suganthan, P.N 2005. Dynamic multi-swarm particle swarm optimizer. IEEE Swarm Intelligence Symposium, pp. 124-129.")] 34 34 [StorableClass] 35 public sealed class MultiPSOTopologyUpdater : SingleSuccessorOperator, ITopologyUpdater {35 public sealed class MultiPSOTopologyUpdater : SingleSuccessorOperator, ITopologyUpdater, IStochasticOperator { 36 36 37 37 public override bool CanChangeName { -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs
r14186 r15277 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Analysis; … … 35 36 36 37 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 37 [Item("Particle Swarm Optimization (PSO)", "A particle swarm optimization algorithm based on the description in Pedersen, M.E.H. (2010). PhD thesis. University of Southampton.")]38 [Item("Particle Swarm Optimization (PSO)", "A particle swarm optimization algorithm based on Standard PSO (SPSO) as described in Clerc, M. (2012). Standard particle swarm optimisation.")] 38 39 [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 300)] 39 40 [StorableClass] … … 176 177 Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); 177 178 Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); 178 Parameters.Add(new ValueParameter<IntValue>("SwarmSize", "Size of the particle swarm.", new IntValue( 10)));179 Parameters.Add(new ValueParameter<IntValue>("SwarmSize", "Size of the particle swarm.", new IntValue(40))); 179 180 Parameters.Add(new ValueParameter<IntValue>("MaxIterations", "Maximal number of iterations.", new IntValue(1000))); 180 181 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer())); 181 Parameters.Add(new ValueParameter<DoubleValue>("Inertia", "Inertia weight on a particle's movement (omega).", new DoubleValue( 1)));182 Parameters.Add(new ValueParameter<DoubleValue>("PersonalBestAttraction", "Weight for particle's pull towards its personal best soution (phi_p).", new DoubleValue( -0.01)));183 Parameters.Add(new ValueParameter<DoubleValue>("NeighborBestAttraction", "Weight for pull towards the neighborhood best solution or global best solution in case of a totally connected topology (phi_g).", new DoubleValue( 3.7)));182 Parameters.Add(new ValueParameter<DoubleValue>("Inertia", "Inertia weight on a particle's movement (omega).", new DoubleValue(0.721))); 183 Parameters.Add(new ValueParameter<DoubleValue>("PersonalBestAttraction", "Weight for particle's pull towards its personal best soution (phi_p).", new DoubleValue(1.193))); 184 Parameters.Add(new ValueParameter<DoubleValue>("NeighborBestAttraction", "Weight for pull towards the neighborhood best solution or global best solution in case of a totally connected topology (phi_g).", new DoubleValue(1.193))); 184 185 Parameters.Add(new ConstrainedValueParameter<IParticleCreator>("ParticleCreator", "Operator that creates a new particle.")); 185 186 Parameters.Add(new ConstrainedValueParameter<IParticleUpdater>("ParticleUpdater", "Operator that updates a particle.")); … … 188 189 Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("InertiaUpdater", "Updates the omega parameter.")); 189 190 Parameters.Add(new ConstrainedValueParameter<ISwarmUpdater>("SwarmUpdater", "Encoding-specific parameter which is provided by the problem. May provide additional encoding-specific parameters, such as velocity bounds for real valued problems")); 190 ParticleUpdaterParameter.Hidden = true;191 191 192 192 RandomCreator randomCreator = new RandomCreator(); … … 262 262 UpdateAnalyzers(); 263 263 ParameterizeAnalyzers(); 264 UpdateParticleUpdaterParameter(); 264 265 UpdateTopologyParameters(); 265 266 InitializeParticleCreator(); … … 280 281 281 282 private void InitializeParticleCreator() { 283 ParticleCreatorParameter.ValidValues.Clear(); 282 284 if (Problem != null) { 283 285 IParticleCreator oldParticleCreator = ParticleCreator; 284 286 IParticleCreator defaultParticleCreator = Problem.Operators.OfType<IParticleCreator>().FirstOrDefault(); 285 ParticleCreatorParameter.ValidValues.Clear(); 286 foreach (IParticleCreator Creator in Problem.Operators.OfType<IParticleCreator>().OrderBy(x => x.Name)) { 287 ParticleCreatorParameter.ValidValues.Add(Creator); 287 foreach (var creator in Problem.Operators.OfType<IParticleCreator>().OrderBy(x => x.Name)) { 288 ParticleCreatorParameter.ValidValues.Add(creator); 288 289 } 289 290 if (oldParticleCreator != null) { 290 IParticleCreator creator = ParticleCreatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleCreator.GetType());291 var creator = ParticleCreatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleCreator.GetType()); 291 292 if (creator != null) ParticleCreator = creator; 292 293 else oldParticleCreator = null; … … 328 329 updater.IndexParameter.ActualName = "Iterations"; 329 330 updater.ValueParameter.ActualName = "CurrentInertia"; 330 updater.StartValueParameter. Value = new DoubleValue(1);331 updater.EndValueParameter.Value = new DoubleValue( 1E-10);331 updater.StartValueParameter.ActualName = InertiaParameter.Name; 332 updater.EndValueParameter.Value = new DoubleValue(0.70); 332 333 } 333 334 } … … 346 347 347 348 private void UpdateTopologyInitializer() { 348 ITopologyInitializer oldTopologyInitializer = TopologyInitializer;349 var oldTopologyInitializer = TopologyInitializer; 349 350 TopologyInitializerParameter.ValidValues.Clear(); 350 351 foreach (ITopologyInitializer topologyInitializer in ApplicationManager.Manager.GetInstances<ITopologyInitializer>().OrderBy(x => x.Name)) { 351 352 TopologyInitializerParameter.ValidValues.Add(topologyInitializer); 352 353 } 354 353 355 if (oldTopologyInitializer != null && TopologyInitializerParameter.ValidValues.Any(x => x.GetType() == oldTopologyInitializer.GetType())) 354 356 TopologyInitializer = TopologyInitializerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTopologyInitializer.GetType()); … … 357 359 358 360 private void ParameterizeTopologyUpdaters() { 359 foreach (var updater in TopologyUpdaterParameter.ValidValues) { 360 var multiPsoUpdater = updater as MultiPSOTopologyUpdater; 361 if (multiPsoUpdater != null) { 362 multiPsoUpdater.CurrentIterationParameter.ActualName = "Iterations"; 363 } 364 } 365 } 366 367 private void UpdateTopologyParameters() { 368 ITopologyUpdater oldTopologyUpdater = TopologyUpdater; 369 IParticleUpdater oldParticleUpdater = ParticleUpdater; 370 ClearTopologyParameters(); 371 if (Problem != null) { 372 IParticleUpdater defaultParticleUpdater = null; 373 if (TopologyInitializer != null) { 374 foreach (ITopologyUpdater topologyUpdater in ApplicationManager.Manager.GetInstances<ITopologyUpdater>()) 375 TopologyUpdaterParameter.ValidValues.Add(topologyUpdater); 376 defaultParticleUpdater = Problem.Operators.OfType<ILocalParticleUpdater>().FirstOrDefault(); 377 foreach (IParticleUpdater particleUpdater in Problem.Operators.OfType<ILocalParticleUpdater>().OrderBy(x => x.Name)) 378 ParticleUpdaterParameter.ValidValues.Add(particleUpdater); 379 } else { 380 defaultParticleUpdater = Problem.Operators.OfType<IGlobalParticleUpdater>().FirstOrDefault(); 381 foreach (IParticleUpdater particleUpdater in Problem.Operators.OfType<IGlobalParticleUpdater>().OrderBy(x => x.Name)) 382 ParticleUpdaterParameter.ValidValues.Add(particleUpdater); 383 } 384 if (oldTopologyUpdater != null) { 385 ITopologyUpdater newTopologyUpdater = TopologyUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType()); 386 if (newTopologyUpdater != null) TopologyUpdater = newTopologyUpdater; 387 } 361 foreach (var updater in TopologyUpdaterParameter.ValidValues.OfType<MultiPSOTopologyUpdater>()) { 362 updater.CurrentIterationParameter.ActualName = "Iterations"; 363 } 364 } 365 366 private void UpdateParticleUpdaterParameter() { 367 var oldParticleUpdater = ParticleUpdater; 368 ParticleUpdaterParameter.ValidValues.Clear(); 369 if (Problem != null) { 370 var defaultParticleUpdater = Problem.Operators.OfType<IParticleUpdater>().FirstOrDefault(); 371 372 foreach (var particleUpdater in Problem.Operators.OfType<IParticleUpdater>().OrderBy(x => x.Name)) 373 ParticleUpdaterParameter.ValidValues.Add(particleUpdater); 374 388 375 if (oldParticleUpdater != null) { 389 IParticleUpdater newParticleUpdater = ParticleUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType());376 var newParticleUpdater = ParticleUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType()); 390 377 if (newParticleUpdater != null) ParticleUpdater = newParticleUpdater; 391 378 else oldParticleUpdater = null; … … 393 380 if (oldParticleUpdater == null && defaultParticleUpdater != null) 394 381 ParticleUpdater = defaultParticleUpdater; 395 396 ParameterizeTopologyUpdaters(); 397 } 398 } 399 400 private void ClearTopologyParameters() { 382 } 383 } 384 385 private void UpdateTopologyParameters() { 386 ITopologyUpdater oldTopologyUpdater = TopologyUpdater; 401 387 TopologyUpdaterParameter.ValidValues.Clear(); 402 ParticleUpdaterParameter.ValidValues.Clear(); 388 if (Problem != null) { 389 if (TopologyInitializerParameter.Value != null) { 390 foreach (ITopologyUpdater topologyUpdater in ApplicationManager.Manager.GetInstances<ITopologyUpdater>()) 391 TopologyUpdaterParameter.ValidValues.Add(topologyUpdater); 392 393 if (oldTopologyUpdater != null) { 394 ITopologyUpdater newTopologyUpdater = TopologyUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTopologyUpdater.GetType()); 395 if (newTopologyUpdater != null) TopologyUpdater = newTopologyUpdater; 396 } 397 ParameterizeTopologyUpdaters(); 398 } 399 } 403 400 } 404 401 -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimizationMainLoop.cs
r14186 r15277 122 122 Placeholder evaluatorPlaceholder = new Placeholder(); 123 123 Placeholder analyzerPlaceholder = new Placeholder(); 124 Placeholder analyzer2Placeholder = new Placeholder(); 124 125 UniformSubScopesProcessor uniformSubScopeProcessor = new UniformSubScopesProcessor(); 125 126 Placeholder particleUpdaterPlaceholder = new Placeholder(); … … 192 193 conditionalBranch.ConditionParameter.ActualName = "ContinueIteration"; 193 194 conditionalBranch.TrueBranch = analyzerPlaceholder; 195 conditionalBranch.FalseBranch = analyzer2Placeholder; 196 197 analyzer2Placeholder.Name = "(Analyzer)"; 198 analyzer2Placeholder.OperatorParameter.ActualName = AnalyzerParameter.Name; 194 199 #endregion 195 200 } -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs
r14186 r15277 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 30 30 31 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 31 [Item("Random Topology Initializer", "Randomly connectes every particle with k other particles.")]32 [Item("Random Distinct Topology Initializer", "Each particle is informed by exactly k+1 distinct other particles (including itself).")] 32 33 [StorableClass] 33 public sealed class RandomTopologyInitializer : TopologyInitializer {34 public sealed class RandomTopologyInitializer : TopologyInitializer, IStochasticOperator { 34 35 #region Parameters 35 36 public ILookupParameter<IRandom> RandomParameter { … … 40 41 } 41 42 #endregion 42 43 #region Parameter Values 44 private IRandom Random { 45 get { return RandomParameter.ActualValue; } 46 } 47 private int NrOfConnections { 48 get { return NrOfConnectionsParameter.ActualValue.Value; } 49 } 50 #endregion 51 43 52 44 #region Construction & Cloning 53 45 [StorableConstructor] … … 65 57 66 58 public override IOperation Apply() { 67 ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize); 68 for (int i = 0; i < SwarmSize; i++) { 69 var numbers = Enumerable.Range(0, SwarmSize).ToList(); 59 var random = RandomParameter.ActualValue; 60 var swarmSize = SwarmSizeParameter.ActualValue.Value; 61 var nrOfConnections = NrOfConnectionsParameter.ActualValue.Value; 62 63 ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize); 64 for (int i = 0; i < swarmSize; i++) { 65 var numbers = Enumerable.Range(0, swarmSize).ToList(); 70 66 numbers.RemoveAt(i); 71 var selectedNumbers = new List<int>(NrOfConnections); 72 for (int j = 0; j < NrOfConnections && numbers.Count > 0; j++) { 73 int index = Random.Next(numbers.Count); 67 var selectedNumbers = new List<int>(nrOfConnections + 1); 68 selectedNumbers.Add(i); 69 for (int j = 0; j < nrOfConnections && numbers.Count > 0; j++) { 70 int index = random.Next(numbers.Count); 74 71 selectedNumbers.Add(numbers[index]); 75 72 numbers.RemoveAt(index); … … 77 74 neighbors[i] = new IntArray(selectedNumbers.ToArray()); 78 75 } 79 Neighbors = neighbors;76 NeighborsParameter.ActualValue = neighbors; 80 77 return base.Apply(); 81 78 } -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs
r14186 r15277 26 26 27 27 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 28 [Item("Ring Topology Initializer", " Connected every particle with its preceeding and its following particle.")]28 [Item("Ring Topology Initializer", "Each particle is informed by its preceeding and its succeeding particle wrapping around at the beginning and the end of the swarm (in addition each particle also informs itself).")] 29 29 [StorableClass] 30 30 public sealed class RingTopologyInitializer : TopologyInitializer { … … 43 43 44 44 public override IOperation Apply() { 45 ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize); 46 for (int i = 0; i < SwarmSize; i++) { 47 neighbors[i] = new IntArray(new[] { (SwarmSize + i - 1) % SwarmSize, (i + 1) % SwarmSize }); 45 var swarmSize = SwarmSizeParameter.ActualValue.Value; 46 47 ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize); 48 for (int i = 0; i < swarmSize; i++) { 49 neighbors[i] = new IntArray(new[] { (swarmSize + i - 1) % swarmSize, i, (i + 1) % swarmSize }); 48 50 } 49 Neighbors = neighbors;51 NeighborsParameter.ActualValue = neighbors; 50 52 return base.Apply(); 51 53 } -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/SPSORandomTopologyInitializer.cs
r15181 r15277 62 62 63 63 // SPSO: Each particle informs at most K+1 particles (at least itself and K others) 64 var particlesInform = Enumerable.Repeat(k + 1, swarmSize) 65 .Select((v, i) => new HashSet<int>(Enumerable.Range(0, v).Select(x => x == 0 ? i : random.Next(swarmSize)))).ToList(); 64 // it is by design that we draw from the particles with repetition 65 var particlesInform = new List<HashSet<int>>(swarmSize); 66 for (var i = 0; i < swarmSize; i++) { 67 var informs = new HashSet<int>() { i }; 68 for (var j = 0; j < k; j++) { 69 informs.Add(random.Next(swarmSize)); 70 } 71 particlesInform.Add(informs); 72 } 66 73 67 74 var neighbors = new ItemArray<IntArray>(swarmSize); -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/TopologyInitializer.cs
r14186 r15277 40 40 get { return (IScopeTreeLookupParameter<IntArray>)Parameters["Neighbors"]; } 41 41 } 42 43 42 public ILookupParameter<IntValue> SwarmSizeParameter { 44 43 get { return (ILookupParameter<IntValue>)Parameters["SwarmSize"]; } 45 }46 47 #endregion48 49 #region Parameter Values50 protected ItemArray<IntArray> Neighbors {51 get { return NeighborsParameter.ActualValue; }52 set { NeighborsParameter.ActualValue = value; }53 }54 protected int SwarmSize {55 get { return SwarmSizeParameter.ActualValue.Value; }56 44 } 57 45 #endregion -
stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VonNeumannTopologyInitializer.cs
r14186 r15277 26 26 27 27 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 28 [Item("Von Neumann Topology Initializer", "Every particle is connected with the two following and the two previous particles wrapping around at the beginning and the end of the population.")]28 [Item("Von Neumann Topology Initializer", "Every particle is informed by the two following and the two previous particles wrapping around at the beginning and the end of the swarm (in addition each particle also informs itself).")] 29 29 [StorableClass] 30 30 public sealed class VonNeumannTopologyInitializer : TopologyInitializer { … … 44 44 45 45 public override IOperation Apply() { 46 ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize); 47 for (int i = 0; i < SwarmSize; i++) { 46 var swarmSize = SwarmSizeParameter.ActualValue.Value; 47 48 ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize); 49 for (int i = 0; i < swarmSize; i++) { 48 50 neighbors[i] = new IntArray(new[] { 49 (SwarmSize + i-2) % SwarmSize, 50 (SwarmSize + i-1) % SwarmSize, 51 (i+1) % SwarmSize, 52 (i+2) % SwarmSize 51 (swarmSize + i-2) % swarmSize, 52 (swarmSize + i-1) % swarmSize, 53 i, 54 (i+1) % swarmSize, 55 (i+2) % swarmSize 53 56 }); 54 57 } 55 Neighbors = neighbors;58 NeighborsParameter.ActualValue = neighbors; 56 59 return base.Apply(); 57 60 } -
stable/HeuristicLab.Encodings.RealVectorEncoding
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Encodings.RealVectorEncoding merged: 15071,15091,15096,15102,15114,15181,15201,15214
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj
r15217 r15277 116 116 <Compile Include="Creators\NormalDistributedRealVectorCreator.cs" /> 117 117 <Compile Include="Interfaces\IRealVectorMultiNeighborhoodShakingOperator.cs" /> 118 <Compile Include="ParticleOperators\RealVectorNeighborhoodParticleUpdater.cs" /> 118 119 <Compile Include="ParticleOperators\RealVectorParticleCreator.cs" /> 120 <Compile Include="ParticleOperators\RealVectorParticleUpdater.cs" /> 121 <Compile Include="ParticleOperators\RealVectorSwarmUpdater.cs" /> 122 <Compile Include="ParticleOperators\RealVectorTotallyConnectedParticleUpdater.cs" /> 123 <Compile Include="ParticleOperators\SPSO2007VelocityInitializer.cs" /> 124 <Compile Include="ParticleOperators\SPSOVelocityInitializer.cs" /> 125 <Compile Include="ParticleOperators\SPSO2011ParticleUpdater.cs" /> 126 <Compile Include="ParticleOperators\SPSO2007ParticleUpdater.cs" /> 127 <Compile Include="ParticleOperators\SPSOParticleCreator.cs" /> 119 128 <Compile Include="Crossovers\BlendAlphaBetaCrossover.cs" /> 120 129 <Compile Include="Interfaces\IRealVectorManipulator.cs" /> … … 128 137 <Compile Include="Interfaces\IRealVectorSwarmUpdater.cs" /> 129 138 <Compile Include="Manipulators\SelfAdaptiveNormalAllPositionsManipulator.cs" /> 130 <Compile Include="ParticleOperators\RealVectorNeighborhoodParticleUpdater.cs" /> 131 <Compile Include="ParticleOperators\RealVectorParticleUpdater.cs" /> 132 <Compile Include="ParticleOperators\RealVectorSwarmUpdater.cs" /> 133 <Compile Include="ParticleOperators\RealVectorTotallyConnectedParticleUpdater.cs" /> 139 <Compile Include="ParticleOperators\SPSOParticleUpdater.cs" /> 140 <Compile Include="ParticleOperators\SPSO2011VelocityInitializer.cs" /> 141 <Compile Include="ParticleOperators\SPSOSwarmUpdater.cs" /> 134 142 <Compile Include="Plugin.cs" /> 135 143 <Compile Include="RealVectorCreator.cs" /> -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleCreator.cs
r14186 r15277 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding { 27 27 public interface IRealVectorParticleCreator : IParticleCreator, IRealVectorOperator { 28 ILookupParameter<IntValue> ProblemSizeParameter { get; }29 28 ILookupParameter<RealVector> RealVectorParameter { get; } 30 29 ILookupParameter<RealVector> PersonalBestParameter { get; } -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleUpdater.cs
r14186 r15277 27 27 public interface IRealVectorParticleUpdater : IParticleUpdater, IRealVectorOperator { 28 28 ILookupParameter<RealVector> VelocityParameter { get; } 29 ILookupParameter<Double Matrix> CurrentVelocityBoundsParameter { get; }29 ILookupParameter<DoubleValue> CurrentMaxVelocityParameter { get; } 30 30 ILookupParameter<RealVector> RealVectorParameter { get; } 31 31 ILookupParameter<DoubleMatrix> BoundsParameter { get; } -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorNeighborhoodParticleUpdater.cs
r14186 r15277 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 using HeuristicLab.Optimization;25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.PluginInfrastructure; 26 27 27 28 namespace HeuristicLab.Encodings.RealVectorEncoding { 28 29 [Item("Neighborhood Particle Updater", "Updates the particle's position using (among other things) the best neighbor's position. Point = Point + Velocity*Inertia + (PersonalBestPoint-Point)*Phi_P*r_p + (BestNeighborPoint-Point)*Phi_G*r_g.")] 29 30 [StorableClass] 30 public sealed class RealVectorNeighborhoodParticleUpdater : RealVectorParticleUpdater, ILocalParticleUpdater { 31 [NonDiscoverableType] 32 [Obsolete("Use SPSO2011ParticleUpdater")] 33 internal sealed class RealVectorNeighborhoodParticleUpdater : RealVectorParticleUpdater { 31 34 32 35 #region Construction & Cloning -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleCreator.cs
r14186 r15277 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; 25 26 using HeuristicLab.Operators; 27 using HeuristicLab.Optimization; 26 28 using HeuristicLab.Parameters; 27 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.PluginInfrastructure; 28 31 29 32 namespace HeuristicLab.Encodings.RealVectorEncoding { 30 33 [Item("RealVectorParticleCreator", "Creates a particle with position, zero velocity vector and personal best.")] 31 34 [StorableClass] 32 public class RealVectorParticleCreator : AlgorithmOperator, IRealVectorParticleCreator { 35 [NonDiscoverableType] 36 [Obsolete("Use SPSOParticleCreator")] 37 internal class RealVectorParticleCreator : AlgorithmOperator, IRealVectorParticleCreator { 33 38 34 39 #region Parameters … … 47 52 public ILookupParameter<RealVector> VelocityParameter { 48 53 get { return (ILookupParameter<RealVector>)Parameters["Velocity"]; } 54 } 55 public ILookupParameter<ISolutionCreator> SolutionCreatorParameter { 56 get { return (ILookupParameter<ISolutionCreator>)Parameters["SolutionCreator"]; } 49 57 } 50 58 #endregion … … 70 78 Parameters.Add(new LookupParameter<RealVector>("PersonalBest", "Particle's personal best solution.")); 71 79 Parameters.Add(new LookupParameter<RealVector>("Velocity", "Particle's current velocity.")); 80 Parameters.Add(new LookupParameter<ISolutionCreator>("SolutionCreator", "The operator that creates the initial position.")); 72 81 73 82 UniformRandomRealVectorCreator realVectorCreater = new UniformRandomRealVectorCreator(); … … 94 103 return base.Apply(); 95 104 } 96 97 105 106 [StorableHook(HookType.AfterDeserialization)] 107 private void AfterDeserialization() { 108 if (!Parameters.ContainsKey("SolutionCreator")) 109 Parameters.Add(new LookupParameter<ISolutionCreator>("SolutionCreator", "The operator that creates the initial position.")); 110 } 98 111 } 99 112 } -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleUpdater.cs
r14186 r15277 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.PluginInfrastructure; 29 30 30 31 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 32 33 [Item("RealVectorParticleUpdater", "Updates a certain particle taking the current position and velocity into account, as well as the best point and the best point in a local neighborhood.")] 33 34 [StorableClass] 34 public abstract class RealVectorParticleUpdater : SingleSuccessorOperator, IRealVectorParticleUpdater { 35 [NonDiscoverableType] 36 [Obsolete("Use SPSO2011ParticleUpdater")] 37 internal abstract class RealVectorParticleUpdater : SingleSuccessorOperator, IRealVectorParticleUpdater { 35 38 36 39 public override bool CanChangeName { … … 62 65 public ILookupParameter<DoubleMatrix> CurrentVelocityBoundsParameter { 63 66 get { return (ILookupParameter<DoubleMatrix>)Parameters["CurrentVelocityBounds"]; } 67 } 68 public ILookupParameter<DoubleValue> CurrentMaxVelocityParameter { 69 get { return (ILookupParameter<DoubleValue>)Parameters["CurrentMaxVelocity"]; } 64 70 } 65 71 public ILookupParameter<DoubleValue> InertiaParameter { … … 126 132 Parameters.Add(new LookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds for each dimension of the position vector for the current problem.")); 127 133 Parameters.Add(new LookupParameter<DoubleMatrix>("CurrentVelocityBounds", "Upper and lower bounds for the particle's velocity vector.")); 134 Parameters.Add(new LookupParameter<DoubleValue>("CurrentMaxVelocity", "Maximum for the particle's velocity vector.")); 128 135 Parameters.Add(new LookupParameter<DoubleValue>("CurrentInertia", "The weight for the particle's velocity vector.")); 129 136 Parameters.Add(new LookupParameter<DoubleValue>("PersonalBestAttraction", "The weight for the particle's personal best position.")); … … 131 138 } 132 139 #endregion 140 141 [StorableHook(HookType.AfterDeserialization)] 142 private void AfterDeserialization() { 143 if (!Parameters.ContainsKey("CurrentMaxVelocity")) 144 Parameters.Add(new LookupParameter<DoubleValue>("CurrentMaxVelocity", "Maximum for the particle's velocity vector.")); 145 } 133 146 134 147 protected void MoveParticle(RealVector velocity, RealVector position) { -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorSwarmUpdater.cs
r14186 r15277 35 35 [Item("RealVectorSwarmUpdater", "Updates personal best point and quality as well as global best point and quality.")] 36 36 [StorableClass] 37 public sealed class RealVectorSwarmUpdater : SingleSuccessorOperator, IRealVectorSwarmUpdater, ISingleObjectiveOperator { 37 [NonDiscoverableType] 38 [Obsolete("Use SPSOSwarmUpdater")] 39 internal sealed class RealVectorSwarmUpdater : SingleSuccessorOperator, IRealVectorSwarmUpdater, ISingleObjectiveOperator { 38 40 39 41 [Storable] -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorTotallyConnectedParticleUpdater.cs
r14186 r15277 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 using HeuristicLab.Optimization;25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.PluginInfrastructure; 26 27 27 28 namespace HeuristicLab.Encodings.RealVectorEncoding { 28 29 [Item("Totally Connected Particle Updater", "Updates the particle's position using (among other things) the global best position. Use together with the empty topology initialzer. Point = Point + Velocity*Inertia + (PersonalBestPoint-Point)*Phi_P*r_p + (BestPoint-Point)*Phi_G*r_g")] 29 30 [StorableClass] 30 public sealed class RealVectorTotallyConnectedParticleUpdater : RealVectorParticleUpdater, IGlobalParticleUpdater { 31 [NonDiscoverableType] 32 [Obsolete("Use SPSO2011ParticleUpdater")] 33 internal sealed class RealVectorTotallyConnectedParticleUpdater : RealVectorParticleUpdater { 31 34 32 35 #region Construction & Cloning -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/SPSO2007ParticleUpdater.cs
r15096 r15277 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Parameters; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 … … 29 30 [Item("SPSO 2007 Particle Updater", "Updates the particle's position according to the formulae described in SPSO 2007.")] 30 31 [StorableClass] 31 public sealed class SPSO2007ParticleUpdater : RealVectorParticleUpdater {32 public sealed class SPSO2007ParticleUpdater : SPSOParticleUpdater { 32 33 33 34 #region Construction & Cloning … … 41 42 #endregion 42 43 43 public static void UpdateVelocity(IRandom random, RealVector velocity, double maxVelocity, RealVector position, double inertia, RealVector personalBest, double personalBestAttraction, RealVector neighborBest, double neighborBestAttraction) {44 public static void UpdateVelocity(IRandom random, RealVector velocity, RealVector position, RealVector personalBest, RealVector neighborBest, double inertia = 0.721, double personalBestAttraction = 1.193, double neighborBestAttraction = 1.193, double maxVelocity = double.MaxValue) { 44 45 for (int i = 0; i < velocity.Length; i++) { 45 double r_p = random.NextDouble() * 1.193;46 double r_g = random.NextDouble() * 1.193;46 double r_p = random.NextDouble(); 47 double r_g = random.NextDouble(); 47 48 velocity[i] = 48 49 velocity[i] * inertia + … … 69 70 if (position[i] < min) { 70 71 position[i] = min; 71 velocity[i] = 0; 72 velocity[i] = 0; // SPSO 2007 72 73 } 73 74 if (position[i] > max) { 74 75 position[i] = max; 75 velocity[i] = 0; 76 velocity[i] = 0; // SPSO 2007 76 77 } 77 78 } … … 90 91 var neighborBest = NeighborBestParameter.ActualValue; 91 92 var neighborBestAttraction = NeighborBestAttractionParameter.ActualValue.Value; 92 93 UpdateVelocity(random, velocity, maxVelocity, position, inertia, personalBest, personalBestAttraction, neighborBest, neighborBestAttraction);93 94 UpdateVelocity(random, velocity, position, personalBest, neighborBest, inertia, personalBestAttraction, neighborBestAttraction, maxVelocity); 94 95 UpdatePosition(bounds, velocity, position); 95 96 -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/SPSO2011ParticleUpdater.cs
r15096 r15277 25 25 using HeuristicLab.Data; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Random; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { 29 30 [Item("SPSO 2011 Particle Updater", "Updates the particle's position according to the formulae described in SPSO 2011.")] 30 31 [StorableClass] 31 public sealed class SPSO2011ParticleUpdater : RealVectorParticleUpdater { 32 32 public sealed class SPSO2011ParticleUpdater : SPSOParticleUpdater { 33 33 #region Construction & Cloning 34 34 [StorableConstructor] … … 41 41 #endregion 42 42 43 public static void UpdateVelocity(IRandom random, RealVector velocity, double maxVelocity, RealVector position, double inertia, RealVector personalBest, double personalBestAttraction, RealVector neighborBest, double neighborBestAttraction) {43 public static void UpdateVelocity(IRandom random, RealVector velocity, RealVector position, RealVector personalBest, RealVector neighborBest, double inertia = 0.721, double personalBestAttraction = 1.193, double neighborBestAttraction = 1.193, double maxVelocity = double.MaxValue) { 44 44 var gravity = new double[velocity.Length]; 45 var direct = new RealVector(velocity.Length);45 var direction = new RealVector(velocity.Length); 46 46 var radius = 0.0; 47 47 48 var nd = new NormalDistributedRandom(random, 0, 1); 49 48 50 for (int i = 0; i < velocity.Length; i++) { 49 var g_id = 1.193 * ((personalBest[i] + neighborBest[i] - 2 * position[i]) / 3.0); 51 var g_id = (personalBestAttraction * personalBest[i] 52 + neighborBestAttraction * neighborBest[i] 53 - position[i] * (neighborBestAttraction + personalBestAttraction)) / 3.0; 54 // center of the hyper-sphere 50 55 gravity[i] = g_id + position[i]; 51 direct[i] = (random.NextDouble() - 0.5) * 2; 56 // a random direction vector uniform over the surface of hyper-sphere, see http://mathworld.wolfram.com/HyperspherePointPicking.html 57 direction[i] = nd.NextDouble(); 52 58 radius += g_id * g_id; 53 59 } 54 60 61 // randomly choose a radius within the hyper-sphere 55 62 radius = random.NextDouble() * Math.Sqrt(radius); 56 63 57 var unitscale = Math.Sqrt(direct.DotProduct(direct)); 64 // unitscale is used to rescale the random direction vector to unit length, resp. length of the radius 65 var unitscale = Math.Sqrt(direction.DotProduct(direction)); 58 66 if (unitscale > 0) { 59 67 for (var i = 0; i < velocity.Length; i++) { 60 velocity[i] = velocity[i] * inertia + gravity[i] + direct[i] * radius / unitscale - position[i]; 68 var sampledPos = gravity[i] + direction[i] * radius / unitscale; 69 velocity[i] = velocity[i] * inertia + sampledPos - position[i]; 61 70 } 62 71 } … … 101 110 var neighborBest = NeighborBestParameter.ActualValue; 102 111 var neighborBestAttraction = NeighborBestAttractionParameter.ActualValue.Value; 103 104 UpdateVelocity(random, velocity, maxVelocity, position, inertia, personalBest, personalBestAttraction, neighborBest, neighborBestAttraction);112 113 UpdateVelocity(random, velocity, position, personalBest, neighborBest, inertia, personalBestAttraction, neighborBestAttraction, maxVelocity); 105 114 UpdatePosition(bounds, velocity, position); 106 115 -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/SPSOParticleUpdater.cs
r15102 r15277 71 71 get { return (ILookupParameter<DoubleValue>)Parameters["NeighborBestAttraction"]; } 72 72 } 73 74 public IValueLookupParameter<DoubleValue> MaxBeyondBestParameter {75 get { return (IValueLookupParameter<DoubleValue>)Parameters["MaxBeyondBest"]; }76 }77 73 #endregion 78 74 … … 93 89 Parameters.Add(new LookupParameter<DoubleValue>("PersonalBestAttraction", "The weight for the particle's personal best position.")); 94 90 Parameters.Add(new LookupParameter<DoubleValue>("NeighborBestAttraction", "The weight for the global best position.")); 95 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxBeyondBest", "A factor of how much the velocity update may maximally aim beyond the personal and neighbor best.", new DoubleValue(1.193)));96 91 } 97 92 #endregion -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/SPSOSwarmUpdater.cs
r15102 r15277 34 34 35 35 namespace HeuristicLab.Encodings.RealVectorEncoding { 36 [Item("Swarm Updater (SPSO)", "Updates personal best point and quality as well as globalbest point and quality.")]36 [Item("Swarm Updater (SPSO)", "Updates personal best point and quality as well as neighbor best point and quality.")] 37 37 [StorableClass] 38 38 public sealed class SPSOSwarmUpdater : SingleSuccessorOperator, IRealVectorSwarmUpdater, ISingleObjectiveOperator { … … 126 126 Parameters.Add(new ScopeTreeLookupParameter<IntArray>("Neighbors", "The list of neighbors for each particle.")); 127 127 Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false.")); 128 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxVelocity", " Speed limit for each particle.", new DoubleValue(1000000)));128 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxVelocity", "The maximum velocity for each particle and initial velocity if scaling is used.", new DoubleValue(double.MaxValue))); 129 129 Parameters.Add(new LookupParameter<DoubleValue>("CurrentMaxVelocity", "Current value of the speed limit.")); 130 130 Parameters.Add(new LookupParameter<ResultCollection>("Results", "Results")); … … 132 132 #region Max Velocity Updating 133 133 Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("MaxVelocityScalingOperator", "Modifies the value")); 134 Parameters.Add(new ValueLookupParameter<DoubleValue>("FinalMaxVelocity", "The value of maximum velocity if PSO has reached maximum iterations.", new DoubleValue(1E-10)));134 Parameters.Add(new ValueLookupParameter<DoubleValue>("FinalMaxVelocity", "The value of maximum velocity if scaling is used and PSO has reached maximum iterations.", new DoubleValue(1E-10))); 135 135 Parameters.Add(new LookupParameter<IntValue>("MaxVelocityIndex", "The current index.", "Iterations")); 136 136 Parameters.Add(new ValueLookupParameter<IntValue>("MaxVelocityStartIndex", "The start index at which to start modifying 'Value'.", new IntValue(0))); … … 195 195 var neighborBest = new ItemArray<RealVector>(neighbors.Length); 196 196 var neighborBestQuality = new ItemArray<DoubleValue>(neighbors.Length); 197 double overallBest = double.NaN; 198 RealVector overallBestVector = null; 197 199 for (int n = 0; n < neighbors.Length; n++) { 198 var pairs = particles.Where(x => x.Item1 == n ||neighbors[n].Contains(x.Item1));199 var bestNeighbor = (maximization ? pairs.MaxItems(p => p.Item3)200 : pairs.MinItems(p => p.Item3)).First();200 var neighborhood = particles.Where(x => neighbors[n].Contains(x.Item1)); 201 var bestNeighbor = (maximization ? neighborhood.MaxItems(p => p.Item3) 202 : neighborhood.MinItems(p => p.Item3)).First(); 201 203 neighborBest[n] = bestNeighbor.Item2; 202 204 neighborBestQuality[n] = new DoubleValue(bestNeighbor.Item3); 205 if (double.IsNaN(overallBest) || maximization && bestNeighbor.Item3 > overallBest 206 || !maximization && bestNeighbor.Item3 < overallBest) { 207 overallBest = bestNeighbor.Item3; 208 overallBestVector = bestNeighbor.Item2; 209 } 203 210 } 204 211 NeighborBestParameter.ActualValue = neighborBest; 205 212 NeighborBestQualityParameter.ActualValue = neighborBestQuality; 213 SwarmBestQualityParameter.ActualValue = new DoubleValue(overallBest); 214 BestRealVectorParameter.ActualValue = overallBestVector; 206 215 } else { 207 216 // Neighbor best = Global best 208 217 var best = maximization ? particles.MaxItems(x => x.Item3).First() : particles.MinItems(x => x.Item3).First(); 209 NeighborBestParameter.ActualValue = new ItemArray<RealVector>(particles.Select(x => best.Item2)); 210 NeighborBestQualityParameter.ActualValue = new ItemArray<DoubleValue>(particles.Select(x => new DoubleValue(best.Item3))); 218 NeighborBestParameter.ActualValue = new ItemArray<RealVector>(Enumerable.Repeat(best.Item2, particles.Count)); 219 NeighborBestQualityParameter.ActualValue = new ItemArray<DoubleValue>(Enumerable.Repeat(new DoubleValue(best.Item3), particles.Count)); 220 SwarmBestQualityParameter.ActualValue = new DoubleValue(best.Item3); 221 BestRealVectorParameter.ActualValue = best.Item2; 211 222 } 212 223 } … … 224 235 !maximization && p.Item3 < personalBestQuality[p.Item1].Value) { 225 236 personalBestQuality[p.Item1].Value = p.Item3; 226 personalBest[p.Item1] = (RealVector)p.Item2.Clone();237 personalBest[p.Item1] = new RealVector(p.Item2); 227 238 } 228 239 } -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs
r14186 r15277 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 44 45 array[i] = elements[i]; 45 46 } 47 public RealVector(RealVector other) : this(other.array) { } 46 48 47 49 public override IDeepCloneable Clone(Cloner cloner) { … … 77 79 } 78 80 81 public double DotProduct(RealVector other) { 82 if (other.Length != Length) throw new ArgumentException("Vectors are of unequal length."); 83 var dotProd = 0.0; 84 for (var i = 0; i < Length; i++) 85 dotProd += this[i] * other[i]; 86 return dotProd; 87 } 79 88 } 80 89 } -
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEncoding.cs
r14186 r15277 280 280 particleCreator.RealVectorParameter.ActualName = Name; 281 281 particleCreator.BoundsParameter.ActualName = BoundsParameter.Name; 282 particleCreator.ProblemSizeParameter.ActualName = LengthParameter.Name;283 282 } 284 283 } -
stable/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimization merged: 15091
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r15109 r15277 191 191 <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" /> 192 192 <Compile Include="Algorithms\HeuristicOptimizationEngineAlgorithm.cs" /> 193 <Compile Include="Interfaces\IGlobalParticleUpdater.cs" />194 193 <Compile Include="Interfaces\ILocalImprovementOperator.cs" /> 195 <Compile Include="Interfaces\ILocalParticleUpdater.cs" />196 194 <Compile Include="Algorithms\HeuristicOptimizationAlgorithm.cs" /> 197 195 <Compile Include="Interfaces\IMultiNeighborhoodShakingOperator.cs" /> -
stable/HeuristicLab.Optimization/3.3/Interfaces/IParticleCreator.cs
r14186 r15277 27 27 /// </summary> 28 28 public interface IParticleCreator : ISolutionCreator { 29 ILookupParameter<ISolutionCreator> SolutionCreatorParameter { get; } 29 30 } 30 31 } -
stable/HeuristicLab.Optimizer
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimizer merged: 15093,15096,15102,15114,15181,15214,15223
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj
r15257 r15277 129 129 <EmbeddedResource Include="Documents\SGP_SymbReg.hl" /> 130 130 <EmbeddedResource Include="Documents\VNS_TSP.hl" /> 131 <EmbeddedResource Include="Documents\PSO_Schwefel.hl" />132 131 <EmbeddedResource Include="Documents\SS_VRP.hl" /> 133 132 <EmbeddedResource Include="Documents\RAPGA_JSSP.hl" /> … … 153 152 <EmbeddedResource Include="Documents\SGP_Robocode.hl" /> 154 153 <EmbeddedResource Include="Documents\OSGP_SymReg.hl" /> 154 <EmbeddedResource Include="Documents\PSO_Rastrigin.hl" /> 155 155 <None Include="Plugin.cs.frame" /> 156 156 <Compile Include="ChangeNestingLevelDialog.cs"> -
stable/HeuristicLab.Optimizer/3.3/StartPage.cs
r15257 r15277 134 134 private void FillGroupLookup() { 135 135 var standardProblems = new List<string> { "ALPSGA_TSP", "ES_Griewank", "OSES_Griewank", "GA_Grouping", "GA_TSP", "GA_VRP", "GE_ArtificialAnt", 136 "IslandGA_TSP", "LS_Knapsack", "PSO_ Schwefel", "RAPGA_JSSP",136 "IslandGA_TSP", "LS_Knapsack", "PSO_Rastrigin", "RAPGA_JSSP", 137 137 "SA_Rastrigin", "SGP_SantaFe", "GP_Multiplexer", "SGP_Robocode", "SS_VRP", "TS_TSP", "TS_VRP", "VNS_OP", "VNS_TSP", "GA_BPP" 138 138 }; -
stable/HeuristicLab.Problems.TestFunctions
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.TestFunctions merged: 15091
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
r15217 r15277 359 359 op.BoundsParameter.ActualName = BoundsParameter.Name; 360 360 op.BoundsParameter.Hidden = true; 361 op.ProblemSizeParameter.ActualName = ProblemSizeParameter.Name;362 op.ProblemSizeParameter.Hidden = true;363 361 } 364 362 foreach (var op in Operators.OfType<IRealVectorParticleUpdater>()) { -
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests merged: 15076,15092,15096,15181,15214,15223-15224,15228
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests/HeuristicLab-3.3/Samples/PsoRastriginSampleTest.cs
r15224 r15277 31 31 namespace HeuristicLab.Tests { 32 32 [TestClass] 33 public class Pso SchwefelSampleTest {33 public class PsoRastriginSampleTest { 34 34 private const string SampleFileName = "PSO_Rastrigin"; 35 35 … … 51 51 if (Environment.Is64BitProcess) { 52 52 Assert.AreEqual(0, SamplesUtils.GetDoubleResult(pso, "BestQuality")); 53 Assert.AreEqual(3.9649516110677525, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality") );54 Assert.AreEqual(25.566430359483757, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality") );53 Assert.AreEqual(3.9649516110677525, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"), 1e-08); 54 Assert.AreEqual(25.566430359483757, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"), 1e-08); 55 55 Assert.AreEqual(200, SamplesUtils.GetIntResult(pso, "Iterations")); 56 56 } else { 57 57 Assert.AreEqual(0, SamplesUtils.GetDoubleResult(pso, "BestQuality")); 58 Assert.AreEqual(3.3957460831564048, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality") );59 Assert.AreEqual(34.412788077766145, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality") );58 Assert.AreEqual(3.3957460831564048, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"), 1e-08); 59 Assert.AreEqual(34.412788077766145, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"), 1e-08); 60 60 Assert.AreEqual(200, SamplesUtils.GetIntResult(pso, "Iterations")); 61 61 } -
stable/HeuristicLab.Tests/HeuristicLab.Tests.csproj
r15257 r15277 475 475 <Compile Include="HeuristicLab-3.3\Samples\GPMultiplexerSampleTest.cs" /> 476 476 <Compile Include="HeuristicLab-3.3\Samples\LocalSearchKnapsackSampleTest.cs" /> 477 <Compile Include="HeuristicLab-3.3\Samples\Pso SchwefelSampleTest.cs" />477 <Compile Include="HeuristicLab-3.3\Samples\PsoRastriginSampleTest.cs" /> 478 478 <Compile Include="HeuristicLab-3.3\Samples\RAPGASchedulingSampleTest.cs" /> 479 479 <Compile Include="HeuristicLab-3.3\Samples\SamplesUtils.cs" />
Note: See TracChangeset
for help on using the changeset viewer.