Exemple #1
0
        public Swarm(EFunction function)
        {
            Bee.ClearStaticFields();

            int employedBees = (Parameters.PARTICLE_AMOUNT * Parameters.EMPLOYED_BEE_AMOUNT / 100);

            employedBees = Math.Min(Parameters.INITIAL_FOOD_SOURCES, employedBees);

            int scoutBees = (Parameters.PARTICLE_AMOUNT * Parameters.SCOUT_BEE_AMOUNT / 100);

            scoutBees = Math.Min(Parameters.INITIAL_FOOD_SOURCES, scoutBees);

            int onlookerBees = Parameters.PARTICLE_AMOUNT - employedBees - scoutBees;

            OnlookerParticleList = Bee.CreateSwarm(function, EBee.Onlooker, onlookerBees);
            ScoutParticleList    = Bee.CreateSwarm(function, EBee.Scout, scoutBees);
            EmployedParticleList = Bee.CreateSwarm(function, EBee.Employed, employedBees);

            Bee.CreateRandomFoodSources();
        }