Example #1
0
 public StableParticle(StableParticleCreationParameters parameters)
 {
     this.Id = Particle.CurrentId;
     this.FillParameters(parameters);
 }
Example #2
0
 protected virtual void FillParameters(StableParticleCreationParameters parameters)
 {
     base._FillParameters(parameters);
     this.Constraint = parameters.Constraint;
 }
Example #3
0
 protected new List<IParticle> CreateParticles(SwarmCreationParameters parameters)
 {
     List<IParticle> particles = new List<IParticle>();
     for (UInt32 index = 0; index < parameters.NumberOfParameters; index++)
     {
         List<Double> newParameterList = new List<double>();
         List<Double> newSpeedsList = new List<double>();
         this.CreateRandomsList(parameters.MaximumParameterValue, parameters.MinimumParameterValue, parameters.NumberOfParameters, ref newSpeedsList, ref newParameterList);
         ISolution newParticleSolution = new ClassicSolution(parameters.SolutionFunction, parameters.AuxData, parameters.MinimumParameterValue, parameters.MaximumParameterValue);
         newParticleSolution.Parameters = newParameterList;
         newParticleSolution.UpdateFitness();
         StableParticleCreationParameters creationParams = new StableParticleCreationParameters();
         creationParams.Speeds = newSpeedsList;
         creationParams.Solution = newParticleSolution;
         creationParams.Constraint = this.Constraint;
         particles.Add(new StableParticle(creationParams));
     }
     return particles;
 }