Learning Matlab by Simulation of a 4-Rover Game

Course Description

In this course, you will learn about the Matlab editor, and its single step debugging features. The difference between Matlab scripts and functions will be explained.

You will begin the course by watching 4 real robot rovers autonomously chase each other around on a blocked-off section of the floor, while each rover attempts to detect and turn off lever switches on the back of its opponent rovers. In the default LRR game simulation, robot rovers are programmed in the form of circular shapes. Colored sections represent the back and a “beak” serves as the front of a rover.

The master code that runs a game/tournament has sections to:
• Create Initial Positions and Orientations
• React to Contacting a Wall
• React to Colliding with another Rover
• Decide if the Front of one Rover has “hit” the Kill Switch of another Rover

You will modify this default code to improve the simulation. The default version of simulated LRR has 3 rovers running as drones. The 4th rover is under the control of a student’s code for initial position, orientation, speed, reaction to walls or collisions, means of detecting kill switches, and chasing drones it detects. If your code improves on the default code, it will be incorporated.

By suppressing the real-time graphics of simulated LRR, you can run hundreds of different parameter combinations per minute and achieve an “artificial intelligence” solution to optimal performance. One improvement can be having the venue be a circle instead of a square.

Beyond modifying the default code, you will become familiar with an optimization method called Breeding.

By the end of this course, you will:
• Learn how to use indexing with sort to rank-order scores with parameter sets
• Become proficient with the Matlab editor
• Learn the 2D and 3D graphics of Matlab
• Become familiar with 2-layer neural networks and the breeding algorithm

Link to Matlab movie for a LRR game, where Rover 4 (violet rear) is the winner.


Students should have taken Trigonometry in high school prior to enrolling in this course. This course recommends a laptop for course-related programming, games/simulations, etc. Please note that some devices (e.g., Chromebooks) do not allow software downloads onto a desktop and so will not accommodate the specific needs of this course. If you have questions about this requirement please reach out to [email protected]


One Section Available to Choose From:

Online sections of Pre-College courses are offered in one of the following modalities: Asynchronous, Mostly asynchronous, or Blended. Please review full information regarding the experience here.

Dates: June 27, 2022 - July 15, 2022
Duration: 3 Weeks
Meeting Times: M-F 3:30P-6:20P
Status: Closed
Format: On-Campus
Instructor(s): Jerry Daniels
Course Number: 10060