Ejemplo n.º 1
0
 public void CreateConnectedParticlesParameters()
 {
     this.ConnectedParticlesParameters = new List<List<double>>();
     foreach(int id in this.ConnectedIds)
     {
         IParticle connectedParticle = this.Particles.Find(p => p.Id == id);
         Double[] connecetedParameters = new Double[this.Speeds.Count];
         connectedParticle.PersonalBestSolution.Parameters.CopyTo(connecetedParameters);
         this.ConnectedParticlesParameters.Add(connecetedParameters.ToList());
     }
 }
 public int getMaxConfidence(Double[] arrayOfConfidence)
 {
     double maxValue = arrayOfConfidence.Max();
         int maxIndex = arrayOfConfidence.ToList().IndexOf(maxValue);
         return maxIndex;
 }