MCB419 logo  




Homework

MCB 419 Homework 5

The first part of the assignment is to complete the exam1 programming exercise as described here:
Exam1 NetLogo Specifications
Completing this part will be worth 80% of your hw05 grade.
There is no template. You need to write your own code from scratch.

Once that piece is working properly, the second part of the assignment is to add UFO's that act as 'predators' rather than 'prey' for the rocket. Specifically:

  1. add 5 UFOs with speed controlled by a slider, similar to the rocket slider
  2. the UFOs should use a finite state machine (FSM) to 'hover' for 100 ticks and then 'chase' the rocket for 100 ticks. This is coded for you in the following template: hw05_ufo.nlogo.
  3. When a rocket and ufo collide, the rocket should lose 3 points and the ufo should be moved to a new random location in the black region
  4. Add a switch called 'draw-trails?' and a button called 'clear trails' that control whether or not the rocket leaves a trail on the screen.
After integrating the UFO's with your exam1 simulation, the screen should be similar to the one shown below. Successfully integrating the UFO interactions is worth 10% of the grade.

Finally, the third part of the assignment is to make the rocket 'smarter' so that, in addition to doing taxis towards stars, it also avoids being caught by the UFOs. This part of the assignment is open-ended and counts for up to 10% of the grade. The smarter your implementation the more points you can earn. Some ideas:

  • you might add a pair of UFO sensors, in addition to the light sensors, so the rocket can avoid UFOs
  • you might use a finite-state-machine (FSM) approach to control the rocket's behavior
  • you might have the rocket 'hide' in the brown region where the UFOs can't reach it
  • you can change the criteria for ending the game (fixed time, fixed points, etc.)
  • you can make the task more difficult by increasing the ufo-speed relative to the rocket-speed; start easy and then make the task progressively harder
  • you can include comments or explanations about your implementation on the INFO tab

Mail your completed netlogo file to mcb419@gmail.com with 'hw05' in the subject line.


Sample solution files:
hw05_sample_solution.nlogo



Mark E. Nelson, University of Illinois at Urbana-Champaign, 2005-2012.