Question
Python program:Write a function microcar which accepts two inputs. The two inputs are two lists of strings containing names of CSV files the first list
Python program:Write a function microcar which accepts two inputs. The two inputs are two lists of strings containing names of CSV files the first list contains the names of the files containing the instructions for each microcar and, the second list contains the names of the files containing the actual actions of each care corresponding to the instructions provided to them.
The two csv files will contain lines in the following format: Action, time, speed - where each action will be specified as:
N, t, s = Move North for t seconds with speed s meters per second
E, t, s = Move East for t seconds with speed s meters per second
W, t, s = Move West for t seconds with speed s meters per second
S, t, s = Move South for t seconds with speed s meters per second
The function will return six numpy arrays:
The expected horizontal displacements for each microcar
The expected vertical displacements for each microcar
The actual horizontal displacements for each microcar
The actual vertical displacements for each microcar
The expected distances traveled by each microcar
The actual distances traveled by each microcar
All displacements and distances are to be presented in meters and rounded to 2 decimal places for the final returned lists. Keep the data rounded to at least 10 decimal places for all intermediate computations.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started