public static List <Bee> CreateSwarm(EFunction functionType, EBee beeType, int numberOfBees) { List <Bee> swarm = new List <Bee>(); if (beeType == EBee.Employed) { for (int i = 0; i < numberOfBees; i++) { swarm.Add(new Bee(functionType, EBee.Employed)); } } else if (beeType == EBee.Scout) { for (int i = 0; i < numberOfBees; i++) { swarm.Add(new Bee(functionType, EBee.Scout)); } } else if (beeType == EBee.Onlooker) { for (int i = 0; i < numberOfBees; i++) { swarm.Add(new Bee(functionType, EBee.Onlooker)); } } return(swarm); }
public Bee(EFunction functionType, EBee beeType) { Position = new double[Parameters.DIMENSION_AMOUNT]; this.beeType = beeType; if (function == null) { FoodSourceList = new List <FoodSource>(); Bee.functionType = functionType; function = AbstractFunction.InstanceFunction(functionType); } }