Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Using Matlab please) Futuristic Restaurant uses automated robots to deliver foods to the customers' tables. You are meant to do a simulation of the food

image text in transcribed (Using Matlab please)image text in transcribed

Futuristic Restaurant uses automated robots to deliver foods to the customers' tables. You are meant to do a simulation of the food delivery in the restaurant.

The robots are battery operated and can travel for a specified maximum distance, before they need to return to their parking station and recharge for a specified time. Robots are dispatched from the kitchen where all the food and recharge stations are located. Do a simulation of the delivery of the foods/plates to the tables for the given time period. There will be limited amount of robots in the restaurant.

You should plan the use of robots, keeping in mind that you would like to minimize any delays in delivery. Based on your approach, calculate the total distance travelled by all the robots, as well as the average delay in the delivery time. The delay here relates to the elapsed time before there is a robot available to deliver the order. Estimate the minimum number of robots that you would need to reduce the delay to zero.

Initially robots will be located in the kitchen. This is where robots will collect the food and also their parking location and they need to return here after the delivery is over. This is also their charging station, in the case that they need to recharge. The location is within the restaurant and is not at a place where tables are present.

Food orders should be randomly generated by your code. While generating orders, zero, one or multiple tables can order food at the same time. You should utilize the available robots to dispatch and deliver the food orders. If there are not enough robots to deliver all available orders, robots in the map might need to deliver their current orders and get charge at kitchen to start delivering again.

Delivery locations are tables. Table locations and shapes will be supplied in the configuration file. All robots will know and should use the given locations and shapes of the tables to calculate the path they should take to reach the destination table. Delivery at a table can only be from one side - north, south, east or west, and the side for each table will be given in the configuration file.

Robots can move in any of four directions - north, east, south or west. Each robot should know the location and next move of every other robot working in the field. By using next move information, robots should be able to avoid collision with other robots. One space in the field can only be occupied by one robot, meaning that distance between any two robots can't be smaller than 1 unit.

Each robot can move 1 unit at a time meaning that speeds of all the robots is equal to 1 unit per frame. Simulation should be updated on a per frame rate, each move of all robots should be updated in one frame, synchronized.

Task One: Reading the Input and Generating the Map

You will be given a configuration file which gives the restaurant details. The initial configuration is to be read from this file, which has the following information in the specified order, line by line:

The length and width of the area (lx,wy) over which the items are to be delivered. You may assume that the bottom left corner of the area has coordinates (0,0).

The coordinates, size and shape of the kitchen (x,y,lx,wy,shape). x,y are the coordinates of the center of the kitchen, lx and ly are the length and width of the kitchen and shape is 0 if the kitchen is rectangle, 1 if the kitchen is circle. If the kitchen is circle, lx and wy will be equal to the diameter of the circle. For engn2219, the shape will always be a rectangle, so you can assume that the value of the shape will be 0.

Number of tables in the restaurant

The coordinates, size, shape, delivery side and food ordering probability of each table, one per line, denoted by (x,y,lx,wy,shape,side,probability). x,y are the coordinates of the center of the table, lx the length and wy the width of the table. Shape is a flag that shows if the table is a rectangle or a circle. It will be 0 for rectangles and 1 for circles. If the table is a circle, then lx and wy will be equal to the diameter of the circle. Side is a number which can be 0,1,2 or 3 meaning N,E,S,W side of the table to deliver foods. Probability will be an integer between 0 to 100, to represent the possibility of food ordering for that table. For example if it is 10, probability is 10%. For details, check Task-2.

Maximum number of robots that can be used at the same time.

(n,delta) where n is the total number of orders to be generated. Your randomized food order generator should generate the given number of orders. Delta is the time difference between each order generation call. If delta is equal to 5, it means you will be calling random order generation at frames 1,6,11 and so on until total number of orders generated reaches n. For details on random order generation, check Task-2.

(dist,charge) where dist is the total distance a robot can go with its charge. Charge is the number of frames robot needs to stay in the kitchen to get charged. For example 50,5: robot can go 50 units with its charge and it should stay in the kitchen at least for 5 frames, before it can get charged to deliver next food.

You should ask the user for the filename of the configuration file. You should read this file and extract the required parameters from the file. Include error checking, so that you report an error if you don't get a sufficient number of input parameters, or you are given incorrect input (e.g., negative numbers, where it should be positive). If there are errors, report the errors and exit.

After successfully reading the configuration file, a representation of the area should be plotted. Filled rectangles/circles can be used for tables. For each table, you should also add numbers on top of their plots. For coloring of the tables and numbers, pick a suitable combination to make it understandable. Numbers can start from 1 and go until the total number of tables. The kitchen is to be indicated by drawing an empty circle/rectangle. Color of the kitchen should be different from tables. Robots can enter and exit from any point on the boundary of the kitchen.

During the animation robots will be shown with empty circles. Within the circles, each robot should have a unique character displayed: a,b,c,d,e and so on. If a robot is carrying food, circle should be red, it should change to green once the delivery is completed.

Note that the configuration file is not fixed and the submitted codes will be tested against random configuration files. Your code should be able to work on any given configuration file. A sample configuration file is provided. A simple representation can be seen here:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions