public MeshParticleSwarmTopology(ParticleSwarmFitnessStrategy fitnessStrategy, SwarmParticleGenerator particleGenerator, int cellSize = 10, int gridWidth = 600, int gridHeight = 600)
 {
     Particles = new SwarmParticleMesh(cellSize, gridWidth, gridHeight);
     FitnessStrategy = fitnessStrategy;
     PositionUpdater = new LocalBestSwarmPositionUpdater(fitnessStrategy);
     ParticleGenerator = particleGenerator;
 }
 public RingParticleSwarmTopology(ParticleSwarmFitnessStrategy fitnessStrategy, SwarmParticleGenerator particleGenerator, int neighbourhoodSize)
 {
     NeighbourhoodSize = neighbourhoodSize;
     FitnessStrategy = fitnessStrategy;
     PositionUpdater = new LocalBestSwarmPositionUpdater(fitnessStrategy, NeighbourhoodSize);
     ParticleGenerator = particleGenerator;
 }
        protected override void Initialise()
        {
            AddOptimaAsPlaceableObjects(Panel.GetOptima());

            ParticleSwarmFitnessStrategy fitnessStrategy = new ParticleSwarmPNormFitnessStrategy(2, Panel.GetOptima(), Panel.AreWeightsIgnored());
            SwarmParticleGenerator particleGenerator = new SwarmParticleGenerator(ParticleSettings, Panel.GetXMin(), Panel.GetXMax(), Panel.GetyMin(), Panel.GetYMax());

            switch (Panel.GetSelectedTopology())
            {
                case Topology.Global:
                    ParticleSwarmTopology = new GlobalParticleSwarmTopology(fitnessStrategy, particleGenerator);
                    break;
                case Topology.Ring:
                    ParticleSwarmTopology = new RingParticleSwarmTopology(fitnessStrategy, particleGenerator, Panel.GetNeighbourhoodSize());
                   break;
                case Topology.Mesh:
                    ParticleSwarmTopology = new MeshParticleSwarmTopology(fitnessStrategy, particleGenerator, Panel.GetNeighbourhoodSize(), Context.GetIdHolder().Width, Context.GetIdHolder().Height);
                    break;
                default:
                    break;
            }

            ParticleSwarmTopology.Initialise(ParticleSettings.GetInitialNumberOfParticles());
        }
 public GlobalParticleSwarmTopology(ParticleSwarmFitnessStrategy fitnessStrategy, SwarmParticleGenerator particleGenerator)
 {
     FitnessStrategy = fitnessStrategy;
     PositionUpdater = new GlobalBestSwarmPositionUpdater(fitnessStrategy);
     ParticleGenerator = particleGenerator;
 }