Friday, April 17, 2015

Strategy and Controller Symbiosis

We have split the code our robot will execute into two parts. In the strategy, we have all the methods our robot will use to solve the maze, do the drag race, etc. It will contain rules that will decide what the robot does. They will be prioritized so the robot can do the important ones, for example, keeping from crashing into the wall, before doing others. 

The robot controller is the other part. This is where we physically control the robot. We read the infrared sensors and move. Then the controller class, sends the information to the strategy class. The strategy class can decide what rule to do, based on the information.

As you can see, both sections rely on each other. Without the strategy, the robot would have information but no way to construct it and no instructions. Without the controller, the robot would not be able to go anywhere. For our robot to win, both must work and interact well. 

No comments:

Post a Comment