示例#1
0
        public static SpaceTemplate Generate(SpaceTemplateGeneratorProperties properties)
        {
            Random random = new Random(properties.Seed);

            bool[,] obstacles = GenerateObstacles(random, properties.Width, properties.Height, properties.NumberOfObstacles, properties.ObstacleMinSize, properties.ObstacleMaxSize);
            bool[,] agents    = GenerateAgents(random, obstacles, properties.NumberOfAgents);
            return(new SpaceTemplate(obstacles, agents));
        }
示例#2
0
 public static bool[,] GenerateObstacles(SpaceTemplateGeneratorProperties properties)
 {
     return(GenerateObstacles(
                new Random(properties.Seed),
                properties.Width,
                properties.Height,
                properties.NumberOfObstacles,
                properties.ObstacleMinSize,
                properties.ObstacleMaxSize
                ));
 }
示例#3
0
 public static bool[,] GenerateAgents(SpaceTemplateGeneratorProperties properties, bool[,] obstaclesMap)
 {
     return(GenerateAgents(new Random(properties.Seed), obstaclesMap, properties.NumberOfAgents));
 }
示例#4
0
 public static void GenerateAgents(SpaceTemplateGeneratorProperties properties, SpaceTemplate environmentBitmap)
 {
     GenerateAgents(new Random(properties.Seed), environmentBitmap.Obstacles, environmentBitmap.AgentMap, properties.NumberOfAgents);
     environmentBitmap.Update();
 }