MATLAB Script thatthat Builds a Simulation Domain.
Question
This problem examines the use of interlinked data structures similar to what might be found in simulation or a game. Consider a simulation of vehicles moving over a terrain where the type of terrain affects the speed of the vehicle. There are multiple types of vehicles each with a different maximum speed. There are three types of terrain: Sand, Grass, and Road. The simulation takes place on N x N grid. a) Develop and describe a set of data structures or classes that support the attributes described above. Indicate their interrelationships via a class diagram.
b) Write a script that builds a simulation domain of 20 x 20 with a default terrain of grass. Put a road in from (5,1) to (5,20) and sand at (5,10) after the road has been laid in. Write out the data structures to a file.
c) Write a script that reads the data structures from a file and displays the map in a 2D plot. Grass should be plotted as green, sand yellow, and the road blue.
Summary
This question belongs to MATLAB software and discusses about application of MATLAB in operations management and to write a script that builds a simulation domain and reads the data structures from a file and displays the map in a 2D plot.
