public Bot(Maze maze, EngineSettings engineSettings, WallGrid walls, BrainFactory brainFactory, EyeFactory eyeFactory)
        {
            _maze = maze;
            _engineSettings = engineSettings;
            _walls = walls;
            _numEyes = engineSettings.BotEyes;
            _energyStep = 1.0;

            var neurons = _numEyes +
                          (engineSettings.ThinkDistance ? 1 : 0) +
                          (engineSettings.ThinkPath ? 5 : 0) +
                          (engineSettings.ThinkVelocity ? 3 : 0);

            Brain = brainFactory.Create(neurons, 2);
            _eyes = new Eye[_numEyes];
            Velocity = new Ray(new CoordD(0.5, 0.5), 0.0, engineSettings.BotSpeed);

            for (var i = 0; i < _numEyes; ++i)
            {
                var theta = i / (double)_numEyes * Consts.HalfTurn - Consts.QuarterTurn;
                _eyes[i] = eyeFactory.Create(Velocity.Origin, 2, 0, theta, 100);
            }

            Init(new CoordD(.5,.5));
        }
 public GeneticAlg(EngineSettings engineSettings, Maze maze, WallGrid walls, BotFactory botFactory)
 {
     _engineSettings = engineSettings;
     _maze = maze;
     _walls = walls;
     _botFactory = botFactory;
     Reset();
 }
 public MazeDrawer(StringFormat fontFormat, Maze maze, WallGrid walls, Settings settings, EngineSettings engineSettings)
 {
     _fontFormat = fontFormat;
     _maze = maze;
     _walls = walls;
     _settings = settings;
     _engineSettings = engineSettings;
 }
        public MazeForm(EyeTesterDrawer eyeTesterDrawer, GeneticAlgorithmDrawer geneticAlgorithmDrawer, EyeTester eyeTester, GeneticAlg geneticAlgorithm, Settings settings, Maze maze)
        {
            _eyeTesterDrawer = eyeTesterDrawer;
            _geneticAlgorithmDrawer = geneticAlgorithmDrawer;
            _eyeTester = eyeTester;
            _geneticAlgorithm = geneticAlgorithm;
            _settings = settings;
            _maze = maze;

            InitializeComponent();
        }
 public EyeTester(int numberOfEyes, double magnitude, Maze maze, EyeFactory eyeFactory, Settings settings, EngineSettings engineSettings)
 {
     Radius = 0.0;
     Visible = false;
     NumEyes = numberOfEyes;
     _maze = maze;
     _settings = settings;
     _engineSettings = engineSettings;
     Eyes = new Eye[NumEyes];
     for (var i = 0; i < NumEyes; ++i)
     {
         Eyes[i] = eyeFactory.Create(Position, 0.0, i / (double)NumEyes * Consts.FullTurn, 0.0, magnitude);
     }
 }
 public void update_eyes(Maze maze)
 {
     foreach (var eye in _eyes)
         maze.Raycast(ref eye.Ray, 0.0);
 }