protected EscaperBase(SimEnvironment env, Binder binder)
 {
     _env = env;
     _binder = binder;
     _name = GetType().Name;
     // Speed is set to its default value.
     Speed = double.Parse(AppSettings.DefaultEscaperSpeed);
 }
        private void BtnStartStopSim_Click(object sender, RoutedEventArgs e)
        {
            var binder = new Binder(this);
            var env = Sim.NewEnvironment();

            // A quick method to register the escaper inside the maze and the simulation.
            Action<EscaperBase> registerEscaper = es => {
                MazeCanvas.DrawEscaper(es);
                var pem = es.TryToEscape(MazeCanvas._currentMaze);
                env.Process(pem);
            };

            registerEscaper(new RandomMouse(env, binder));

            // We run simulation in another thread, to allow UI to be responsive.
            Task.Factory.StartNew(t => env.Run((double) t), DefaultSimulationTime);
        }
Beispiel #3
0
 public Trémaux(SimEnvironment env, Binder binder)
     : base(env, binder)
 {
 }
 public RandomMouse(SimEnvironment env, Binder binder)
     : base(env, binder)
 {
 }
 public WallFollower(SimEnvironment env, Binder binder)
     : base(env, binder)
 {
 }
Beispiel #6
0
 public Pledge(SimEnvironment env, Binder binder)
     : base(env, binder)
 {
 }