コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: yikolyk/MDP-Jan-2015
 private void connectButton_Click(object sender, RoutedEventArgs e)
 {
     this.realTimeRobot = new Robot();
     this.realTimeRobot.ChangePosition += new Robot.RobotMovingHandler(updateRobotPosition);
     this.realTimeRobot.SendingMessage += new Robot.RobotSendingMessage(displayRobotMessage);
     this.simulator = new Simulator();
     this.simulator.Robot = this.realTimeRobot;
     this.mappingThread = new Thread(this.Connector.run);
     this.mappingThread.Start();
 }
コード例 #2
0
 private void setUpSimulator()
 {
     Robot robot = new Robot();
     robot.X = init_Y;
     robot.Y = init_X;
     robot.Dir = 'D';
     this.map = new Map(mapDescriptor);
     this.simulator = new Simulator(robot, map);
     this.simulator.Robot.ChangePosition += new Robot.RobotMovingHandler(updateRobotPosition);
     this.simulator.Robot.SendingMessage += new Robot.RobotSendingMessage(displayRobotMessage);
     this.timeLimit = UserSetting.TimeLimit;
     this.TimerProgressbar.Value = 100;
     this.coverageLimit = UserSetting.CoverageLimit;
 }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: yikolyk/MDP-Jan-2015
 private void dfsExplore_Click(object sender, RoutedEventArgs e)
 {
     this.displayConsoleMessage("Exploring using DFS...");
     Robot robot = new Robot();
     this.map = new Map(mapDescriptor);
     this.simulator = new Simulator(robot, map);
     this.simulator.Robot.ChangePosition += new Robot.RobotMovingHandler(updateRobotPosition);
     this.simulator.Robot.SendingMessage += new Robot.RobotSendingMessage(displayRobotMessage);
     this.timeLimit = UserSetting.TimeLimit;
     this.coverageLimit = UserSetting.CoverageLimit;
     timer.Start();
     if (exploreThread!=null)
         exploreThread.Abort();
     exploreThread = new Thread(this.simulator.dfsExplore);
     exploreThread.Start();
 }
コード例 #4
0
 private void exploreButton_Click(object sender, RoutedEventArgs e)
 {
     if (radioButtons[1])
     {
         dfsExplore();
         return;
     }
     else if (!radioButtons[0])
     {
         this.displayConsoleMessage("Please Select Exploration Algorithm!");
         return;
     }
     this.displayConsoleMessage("Exploring using wall follower!!!");
     Robot robot = new Robot();
     this.map = new Map(mapDescriptor);
     this.simulator = new Simulator(robot, map);
     this.simulator.Robot.ChangePosition += new Robot.RobotMovingHandler(updateRobotPosition);
     this.simulator.Robot.SendingMessage += new Robot.RobotSendingMessage(displayRobotMessage);
     this.timeLimit = UserSetting.TimeLimit;
     this.coverageLimit = UserSetting.CoverageLimit;
     timer.Start();
     exploreThread = new Thread(this.simulator.wallfollowerExplore);
     exploreThread.Start();
 }