Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program to simulate vehicles at an intersection using queues

HI I got this coursework question to solve.

This is the question:

Design a program to simulate vehicles at an intersection.

Assume that there is one lane going in each of four directions, with stoplights facing each direction. Vary the arrival time of vehicles randomly in each direction and set up a regular frequency of the light changes. Run your direction and set up a regular frequency of the light changes. Run your simulation for a set period of time to view the "behaviour" of the intersection.

Coursework Requirement:

  1. Should be coded in java
  2. Use of proper data structures

If any one has any clue of how to do it, please help; I have no idea.


1 Answers

Some useful behaviors to monitor will include mean, max, and std. dev. of the number of cars waiting at each light.

like image 127
John with waffle Avatar answered Sep 18 '26 03:09

John with waffle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!