Python代写 | Thonny代写 | Real-time Optimization

本次Python代写要求使用Python3版本进行编程,IDE要求使用Thonny代写,对给定的CSV进行IO处理,读取CSV里面的数据,并对数据进行统计和分析等。

QUESTION 1

  • Overview:  There is one problem which has two major parts. You need to submit your solution as per guidelines. Your solution should be generic and will be tested with different data in the same format.
  • Problem:  Real-time Optimization, Scheduling and Logistics (ROSL) research group (http://www.ecm.uwa.edu.au/research/real-time-optimisation-scheduling-logistics) in Department of Computer Science and Software Engineering (CSSE) bought Remote-controlled Zen Wheel microcars for its research (http://zenwheels.com/). Researchers developed a testbed for testing different algorithms for autonomous vehicle and the project was chosen as finalist in WAITTA awards (http://inciteawards.org.au/finalists/) in the category of Research and Innovation Project of the year – Postgraduate Tertiary Student. You can watch the 60 seconds pitch at: https://www.youtube.com/watch?v=ow3AwdkZjmE&feature=youtu.be and read about the detail on IEEE website. You can also visit room G04 in CSSE building to have a look at the project. While working on the project, researchers developed an interface which can execute pre-determined programs. However, it is found that movement of microcars is not perfect and will sometimes perform an incorrect action. Researchers when testing their latest development maintain a copy of the intended program but also track what movements have actually been made externally. Each car can perform the following actions:
    • Move North
    • Move West
    • Move East
    • Move South
  • Researchers have performed a series of trials where multiple microcars have been tested in sequence and have bundled all the data into two csv files per microcar. One contains the instructions given to each microcar and other contains the actions performed by each microcar.Your task, given both files is to find:
    • The final displacement of each microcar from the origin (in both horizontal and vertical axes).
    • The total distance traveled by each microcar.
  • Note:you need to import only those library modules which are discussed in the lectures.

Part 1:

  • Write a function microcar which accepts two inputs. The two inputs are two lists of strings containing names of CSV files (including locations if files are not in the same folder where file containing the function is stored): the first list contains the names of the files (including locations if required) containing the instructions for each microcar and, the second list contains the names of the files (including locations if required) 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.  Additionally the data will adhere to the following constraints:
    • There will never be a ‘missing’ instruction. The number of expected and actual instructions will always match.
    • Both files will contain valid instructions only.

Part 2:

  • In addition to the function described above, write a second function plotmicrocar which will accept the same arguments and perform the same calculations as before but will additionally create the following plots:
    • A bar-plot comparing the expected and actual distance covered by each microcar.
    • A scatter-plot of the expected final horizontal and vertical displacements for each microcar.
    • A scatter-plot of the actual final horizontal and vertical displacements for each microcar.
  • We expect these plots to be generated as sub-plots and match the example templates. You need to ensure that scatter plots are square in size and have same dimensions for easy of understanding of the results. In addition, the dimensions should be larger enough such that microcar displacements should not be at the corner of the plots. Don’t forget the guidelines of plots explained to you during the lectures.  Note: when writing plotmicrocar function, don’t re-write your code and make a function call to your original microcar function to generate your data.

Examples and Sample Data:You can get a sense of what we expect by looking at the following sample data files for 2 microcars:

  • csv
  • csv
  • csv
  • csv

You can download the files from LMS from the same location of assignment sheet (click here). Your command to call the second function containing lists of these files may look like plotmicrocar( [ ‘exp1.csv’ , ‘exp2.csv’ ] ,  [ ‘act1.csv’ , ‘act2.csv’ ] ) The sample plot is presented for guidance. Remember the data presented in the chart is sample only and is not correct or related to the sample data files.