social_learning.World.World C# (CSharp) Method

World() public method

public World ( IEnumerable agents, int height, int width, IEnumerable species, IEnumerable predators, PlantLayoutStrategies layout = PlantLayoutStrategies.Uniform, int agentHorizon = DEFAULT_AGENT_HORIZON ) : System
agents IEnumerable
height int
width int
species IEnumerable
predators IEnumerable
layout PlantLayoutStrategies
agentHorizon int
return System
        public World(IEnumerable<ForagingAgent> agents, int height, int width, 
             IEnumerable<PlantSpecies> species, IEnumerable<Predator> predators,
             PlantLayoutStrategies layout = PlantLayoutStrategies.Uniform, int agentHorizon = DEFAULT_AGENT_HORIZON)
        {
            Agents = agents;
            PlantTypes = species;
            Height = height;
            Width = width;
            AgentHorizon = agentHorizon;
            Predators = predators;

            // Randomly populate the world with plants
            Plants = new List<Plant>();
            foreach (var s in species)
                for (int i = 0; i < s.Count; i++)
                    Plants.Add(new Plant(s));
        }