Esempio n. 1
0
 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);
        }
Esempio n. 3
0
 public Trémaux(SimEnvironment env, Binder binder)
     : base(env, binder)
 {
 }
Esempio n. 4
0
 public RandomMouse(SimEnvironment env, Binder binder)
     : base(env, binder)
 {
 }
Esempio n. 5
0
 public WallFollower(SimEnvironment env, Binder binder)
     : base(env, binder)
 {
 }
Esempio n. 6
0
 public Pledge(SimEnvironment env, Binder binder)
     : base(env, binder)
 {
 }