Question

In this assignment, you will write a simulator to determine maximum, minimum and average queue length....

In this assignment, you will write a simulator to determine maximum, minimum and average queue length. Important: You can implement with the linked list classes described in Chapter 20 or the queueing structures described in Chapter 21.

The user inputs the following information
a. The relative weight of arrivals. This is an integer between 1-100.
b. The number of servers. This is an integer between 1-25.
c. The relative weight of a server. This is an integer between 1-100.
d. Thetotalnumberofevents,i.e.thetotalnumberofeventssimulated.

Here’s how the information in 1) is used. The total number of possible events is arrival weight + (number of servers * server weight). For example: If a) is 50, b is 10, c is 10 then c = 50 + (10*10) = 150.

Let’s call that result “event possibilities”. You will simulate the number of events in d). For each event, you will randomly pick one of the event possibilities. Thus, you will have to generate a random number that is evenly distributed over the number of event possibilities. Once you have picked an event possibility for the event:

If the event possibility is an arrival, you will add an event to your event queue. You will also record the event number (i.e. which event is this in d)) in the information maintained on the event in the queue.

If the event possibility is a server, you will remove the oldest event in the queue (the last one in a FIFO queue). If there are no elements in the queue, the server event essentially becomes a no-op, i.e. there is nothing to remove from the queue.

Once all of the events have been generated in d), if there are any events remaining in the queue, you will drain the queue by invoking your server logic to remove the entry until the queue becomes empty.

For each event simulation, you should report:

The simulation number

The length of the queue as of this event

If this is an arrival, the arrival #

If this is a server event, the server #

At the end of the event simulation, you should report

The number of simulations

The maximum length of the queue

c. The average length of the queue
d. The maximum number of arrivals in a row e. The maximum number of service’s in a row

Please make sure you comment your code thoroughly. My preferred style is to not comment every line of code, but instead have a block comment for every logical section and to use line comments when you want to emphasize something special that line of code does.

The code should be nicely formatted and should use proper variables and variable names. While we’ve sometimes jokingly used wacko variable names in class, please do not do so in your assignment.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
In this assignment, you will write a simulator to determine maximum, minimum and average queue length....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • C++ -- Event processing simulation using a transaction queue Hi! it is queue simulation please read...

    C++ -- Event processing simulation using a transaction queue Hi! it is queue simulation please read the instructions, write codes, and explain the code with comments. Thank you Transactions enter the system and are stored in a queue. Each transaction represents some work that needs to be accomplished. Servers exist which process transactions. Servers take transactions off the queue and process them. you’re building the simulation framework. The idea is that somebody would take your framework, and add the specifics...

  • Hi! it is c++ queue simulation please read the instructions, write codes, and explain the code...

    Hi! it is c++ queue simulation please read the instructions, write codes, and explain the code with comments. Thank you Transactions enter the system and are stored in a queue. Each transaction represents some work that needs to be accomplished. Servers exist which process transactions. Servers take transactions off the queue and process them. you’re building the simulation framework. The idea is that somebody would take your framework, and add the specifics for whatever type of system it was going...

  • Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events...

    Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events will represent the line of customers in the bank. Maintain the arrival events and departure events in an ADT event list, sorted by the time of the event. Use a reference-based implementation for the ADT event list The input is a text file of arrival and transaction times. Each line of the file contains tiie arrival time and required transaction time for a customer....

  • Needs Help with Java programming language For this assignment, you need to write a simulation program...

    Needs Help with Java programming language For this assignment, you need to write a simulation program to determine the average waiting time at a grocery store checkout while varying the number of customers and the number of checkout lanes. Classes needed: SortedLinked List: Implement a generic sorted singly-linked list which contains all of the elements included in the unsorted linked list developed in class, but modifies it in the following way: • delete the addfirst, addlast, and add(index) methods and...

  • Consider a single-server queueing system with arrival and service details as: Interarrival times: 3, 2, 6,...

    Consider a single-server queueing system with arrival and service details as: Interarrival times: 3, 2, 6, 2, 4, 5 Service times: 2, 5, 5, 8, 4, 5 Prepare a table show below for the given data. Stop simulation when the clock reaches 20. Write a Java program, to implement this single-server queueing system, print out the table shown below: You should create a future event list in your Java code, and print out the contents of FE list in each...

  • Part 1: Find the Maximum and Minimum Weights You have weight data for several items. Those...

    Part 1: Find the Maximum and Minimum Weights You have weight data for several items. Those weights are in pounds and ounces, which are both integer values, like table below. item weight item1 1lb 5oz item2 32oz item3 5lb 20oz Write a program that will read in the weight of an item in pounds and ounces one by one. Each time after user inputs a weight, the program asks user to input [Y/N] whether user wants to input more weight...

  • Goal: Write a Python program to implement an airport take-offldeparture simulator Proiect: Consider the following tables...

    Goal: Write a Python program to implement an airport take-offldeparture simulator Proiect: Consider the following tables which contain, for each airline, a queue of flights boarded and ready to take-off from BWI. Airline Flight # Destination Gate # American 127 American 322 American 233 American 742 American 112 American 437 DCA BUF 10 12 13 14 15 CAE LGA Airline Flight # 1 Destination Gate # Delta 221 SFO DET CVG SAN 20 21 Delta 348 Delta 765 Delta 612...

  • Question 1 Unless otherwise stated, assume all times reported refer to averages from exponential distributions and...

    Question 1 Unless otherwise stated, assume all times reported refer to averages from exponential distributions and that we are looking at stable processes. If the average time between arrivals is 10 minutes, what is the arrival rate? a. 6 jobs per hour b. 0.1 jobs per minute c. 0.001666 jobs per second d. All of the above 1 points Question 2 For a system with a single server, if the arrival rate is six jobs per hour and the average...

  • AQueue.java class AQueue implements Queue { private E queueArray[]; // Array holding queue elements private static...

    AQueue.java class AQueue implements Queue { private E queueArray[]; // Array holding queue elements private static final int DEFAULT_SIZE = 10; private int maxSize; // Maximum size of queue private int front; // Index of front element private int rear; // Index of rear element // Constructors @SuppressWarnings("unchecked") // Generic array allocation AQueue(int size) { //BUG #1: maxSize = size maxSize = size+1; // One extra space is allocated rear = 0; front = 1; queueArray = (E[])new Object[maxSize]; //...

  • Overview: In this lab, you will write a program called JobScheduler; it should take a single...

    Overview: In this lab, you will write a program called JobScheduler; it should take a single input file as a command-line argument. Each line in the input file has the following format: <job #> <priority> <arrival time (sec)> <duration (sec)> e.g. a file might contain: 1 3 10 100 5 2 20 50 8 4 5 100 (all values will be positive integers) These jobs might represent computer programs (or threads) that need to be run by the operating system....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT