EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
Java代做
您的位置: 主页 > 编程案例 > Java代做 >
代做Java:Data Structures4代写 Programming Assignment代写 project代写 - Java代做
发布时间:2021-07-25 21:23:48浏览次数:
CMPS 12BData Structures4代写 n this project you will implement a Queue ADT in Java based on a linked list data structure. You will use yourQueue ADT to simulateIntroduction to Data Structures Programming Assignment 4 Data Structures4代写In this project you will implement a Queue ADT in Java based on a linked list data structure. You will use your Queue ADT to simulate a set of jobs performed by a set of processors, where there are more jobs than processors, and therefore some jobs may have to wait in a queue. Think of shoppers at a grocery store waiting in line at check-out stands. In this metaphor, a job is a basket of goods to be purchased and a processor is a clerk at a check-out stand ringing up the purchase. Abstractly, a job is an encapsulation of three quantities: arrival time, duration, and finish time. The arrival time is the time at which a job becomes available for processing.Data Structures4代写This is analogous to the time at which a shopper reaches the check-out stand area.If there is a free Processor, that job s work may begin. If not, it must wait in a processor queue. The duration of a job is the amount of processor time it will consume once it reaches a processor. This quantity is analogous to the amount of goods in the shopper’s basket. Both arrival time and duration are intrinsic to the job and are known ahead of time, whereas the finish time is only known when the job reaches the head of a processor queue.Data Structures4代写The finish time can then be calculated as finish_time = start_time + duration. Before a job is underway its finish time will be considered undefined. Once a given job’s finish time is known, we can calculate the amount of time spent waiting in line, not counting processing time. Thus wait_time = finish_time – arrival_time – duration.  In this simulation, time is considered a discrete quantity, starting at 0 and assuming only non-negative integer values. Note time 0 is reserved for initialization, and all job arrival times will be greater than or equal to 1.The goal of the simulation will be as follows:given a batch of m jobs, each with specific arrival times and durations, determine (1) the total wait time (i.e. the total time spent by all m jobs waiting in queues), (2) the maximum wait time (i.e. the longest wait any of the m jobs endured) and (3) the average wait time over all m jobs. Furthermore, determine these quantities for n processors, where n ranges from 1 to m-1.Data Structures4代写Observe that there is no point in considering m or more processors, since then the wait time for each job is necessarily 0. (If there are as many or more checkers than shoppers, no one ever has to wait.) The n processors in this simulation will be represented by an array of n processor queues. The job (if any) at the front of a processor queue is considered to be underway, while the jobs (if any) behind the front job are waiting.When a job arrives it is assigned to a processor queue of minimum length. (Shoppers naturally go to the shortest line.) If there is more than one minimum length processor queue, the job will be assigned to the one whose array index is smallest. (Shoppers go to the closest among several shortest lines.) It is recommended that your simulation maintain one or more additional queues for storage of those jobs that have not yet arrived, and for those jobs that have been completed.Data Structures4代写Your main program for this project will be contained in a file called Simulation.java.The Simulation class will contain the main() method where program execution begins. The Simulation class is not to be considered a stand-alone ADT however. It is the client of two ADTs, one of which (Job) will be provided on the webpage, and the other (Queue) will be created by you.Your program will take one command line argument giving the name of an input file, and will write to two output files whose names are the name of the input file followed by the suffixes .rpt and .trc respectively. The .rpt (report) file will contain the results total wait, maximum wait, and average wait, for n processors where n ranges from 1 to m-1. The .trc (trace) file will contain a detailed trace of the state of the simulation at those points in time when either an arrival or finish event occur. Your Makefile for this project will create an executable jar file called Simulation. Thus your program will be run by doing% Simulation input_fileand the result will be the creation of two files in your current working directory called input_file.rpt and input_file.trc. During the initial design and construction phases of your project it may be helpful to send the contents of the trace file to stdout for diagnostic purposes. A file called SimulationStub.java is included inthe examples section of the course website. It contains a few lines of code and some high level pseudo-code that you may use as a starting point. A Makefile is also provided on the website which you may alter as you see fit.Input and Output File Formats Data Structures4代写The first line of an input file will contain one integer giving the number m of jobs to be run. The next m lines will each contain two integers separated by a space. These integers will give the arrival time and duration of a job. The jobs will appear in the input file ordered by arrival times, with the earliest job first. Here is a sample input file called ex1 representing a batch of 3 jobs:32 23 45 6As usual, you may assume that your project will be tested only on correctly formatted input, i.e. there is no need to consider what to do if the jobs are not ordered by arrival times, or if the file does not contain at least m+1 lines, etc. The report file corresponding to the above input file follows.Data Structures4代写Report file: ex1.rpt3 Jobs:(2, 2, *) (3, 4, *) (5, 6, *)***********************************************************1 processor: totalWait=4, maxWait=3,averageWait=1.332 processors: totalWait=0, maxWait=0,averageWait=0.00In the corresponding trace file below, the processor queues are labeled 1 through n. The label 0 is reserved for a storage queue, which initially contains the jobs sorted by arrival time. Each job is represented as a triple: (arrival, duration, finish). An undefined finish time is represented as *. As jobs are finished, they are placed at the back of the storage queue. If more than one job finishes at the same time, they are placed in the storage queue in order of their appearance in the queue array, i.e. minimum index first. When the simulation is complete, the storage queue will contain all jobs sorted by finish times. Once the simulation is complete for a given number of processors, the finish times are reset to undefined,and the same jobs are simulated again with one more processor.Trace file: ex1.trc3 Jobs:(2, 2, *) (3, 4, *) (5, 6, *)*****************************1 processor:***************************** time=0

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。