Changeset 15181 for trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs
- Timestamp:
- 07/10/17 17:26:43 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs
r15091 r15181 30 30 31 31 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 32 [Item("Random Topology Initializer", " Randomly connectes every particle with k other particles.")]32 [Item("Random Topology Initializer", "Each particle is informed by exactly k+1 distinct other particles (including itself).")] 33 33 [StorableClass] 34 34 public sealed class RandomTopologyInitializer : TopologyInitializer, IStochasticOperator { … … 65 65 var numbers = Enumerable.Range(0, swarmSize).ToList(); 66 66 numbers.RemoveAt(i); 67 var selectedNumbers = new List<int>(nrOfConnections); 67 var selectedNumbers = new List<int>(nrOfConnections + 1); 68 selectedNumbers.Add(i); 68 69 for (int j = 0; j < nrOfConnections && numbers.Count > 0; j++) { 69 70 int index = random.Next(numbers.Count);
Note: See TracChangeset
for help on using the changeset viewer.