This assignment is to be done individually.
The following is offered with apologies to the vast majority of students who do their work honestly and take their university learning seriously:
Your instructor takes academic integrity seriously and has no tolerance for plagiarism or any other form of academic misconduct. Failure to respect these guidelines will result in you receiving a grade of zero on this assignment.
Acceptable collaboration between students, provided it is acknowledged explicitly in your report and code, might include:
Unacceptable collaboration and violations of academic integrity include, but are not limited to:
If you are uncertain about any of these guidelines, please discuss with your instructor as soon as possible.
Consider the one-dimensional world shown in the picture below.
An intelligent toy racing car is designed to drive autonomously along a straight 20 m path. The car's motor can draw power at two levels. The first level consumes j units of power and overcomes the friction of the path, allowing the car to maintain its current speed. The second level consumes 2j units of power and accelerates the car at 2 m/s2. If no power is applied, friction causes the car to decelerate by -2 m/s2 until it comes to rest. The car's maximum speed is 4 m/s. Any effort invested to overcome this maximum will be lost to heat.
All values of time, distance, and speed are discretized to units of 1 s, 1 m, and 1 m/s.
The transition model follows the laws of motion you learned in high school:
State any assumptions you make. The design might not be unique for certain cases. The scenarios are as follows:
Bonus: The state space is sparse. Minimize it by eliminating states that will never be visited.
Your program should accept a command line option of -p for the use of policy iteration and -v for the use of value iteration, one of the letters a, b, or c to specify the desired scenario from question 1, and possibly an additional parameter, if needed for the particular scenario. Following UNIX convention, the command line syntax is:
racecar {-p | -v} awhere, for scenario (b), P is a real number between 0 and 1, indicating the probability that the motor responds correctly, and for scenario (c), j is a positive integer, denoting the number of energy units consumed at the first power level of the car.
As output, your program should display:
In your report, include the final utilities and policies as tables in an appendix. The state space is large, so you should dedicate a full page to each scenario.
For scenario (b), solve for P = 0 (the control circuit is not faulty), P = 0.4, and P = 0.8 (highly faulty control circuit).
For scenario (c), solve for both j = 3 and j = 7.
You may program your assignment in any computer language of your preference, provided it can be compiled and run on the Trottier Engineering Linux machines (TR5130GU-<x>.ece.mcgill.ca where x ∈ [1,16]). To login, use your McGill UEA (first.last@mail.mcgill.ca) and your regular MCF password.
The hardcopy should explain the design decisions you made and address the items noted above. Remember that your report is the main method of communicating what you have accomplished to the reader. Therefore, make sure that it is well organized and well written; you will lose marks for spelling errors and poor grammar. The report should be a maximum of three pages in length, exclusive of any appendices as relevant. You are welcome to include illustrations as useful to elucidate the text. These are not considered as part of the three-page limit. No printout of program code is required.
In addition to the hardcopy submission, you must submit, through myCourses/WebCT (yes, we are using myCourses, but only for this purpose), an electronic version of your assignment in zip or UNIX tar format, which includes:
If you are not handing in a hardcopy of your report until after the Study Week, then make sure also to include a PDF of your report with the electronic submission. In either case, do not include with your submission any other items, such as object code (*.o) files or your executable program. or marks will be deducted.
The hardcopy and electronic versions may be submitted at different times prior to the assigned deadline. Assignments will not be considered complete until both components have been received.
| Component | Weight |
| Questions 1 | 15 pts (5 for each scenario) |
| Questions 2 | 15 pts (2.5 for each scenario) |
| Questions 3 | 4 pts |
| program documentation | 6 pts |
Last updated on 22 February 2011
by Mohannad Elhamod and Jeremy Cooperstock