Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

4 Problems on Distance and Non Distance Learning Students | CS 4803, Assignments of Computer Science

Material Type: Assignment; Class: Special Topics; Subject: Computer Science; University: Georgia Institute of Technology-Main Campus; Term: Spring 2007;

Typology: Assignments

Pre 2010

Uploaded on 08/05/2009

koofers-user-cws
koofers-user-cws 🇺🇸

3.5

(3)

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download 4 Problems on Distance and Non Distance Learning Students | CS 4803 and more Assignments Computer Science in PDF only on Docsity! CS 4803/8803MS Programming Assignment 2 Due: midnight, Thursday February 27, 2007 1 Description The goal of this assignment is give you experience at developing process-oriented discrete event simulation applications and simulation engines, and for those of you that have not done so before, experience in programming with threads. Pairs working on this assignment should implement a process-oriented simulation engine and application. Individuals working on their own should simply implement the simulation engine and a suitable test program. These two parts are described below:  Process-oriented simulation engine. Each simulation process should be implemented as a separate thread. You may need other threads to implement other parts of the simulation engine. The API to the engine should include the AdvanceTime(T) primitive that advances simulation time by T units for the simulation process. The engine must also implement the WaitUntil (p, T) primitive where p is a predicate (a Boolean variable), and T is a duration in simulation time. This latter primitive suspends the process until either p becomes true, or the specified simulation time has expired. If T is zero, the process simply waits until p becomes true.  Simulation model. Develop a process-oriented simulation to model a road traffic network. Assume the streets form a regular two-dimensional grid with a traffic signal at each intersection. Assume each street can carry traffic in either direction. Model each intersection as a queue of vehicles waiting to enter the intersection (or traveling through the intersection immediately). Vehicles enter or leave the network from the edge of the grid. Each vehicle should be implemented as a simulation process. You may want to use additional simulation processes, depending on how you formulate the model. Upon arriving at an intersection, assume the vehicle goes straight with probability s, turns right with probability r, and turns left with probability l, where s+l+r=1. When the signal turns green, assume up to k vehicles can pass through the intersection, while remaining vehicles must wait. Assume each signal cycles through periods where it is red, yellow, and green. You will need to make other assumptions (roadway speed, length of roads, etc.) but you are free to define these as you wish. You must implement the vehicles and traffic signal controllers with separate simulation processes (threads). You need not model the detailed movement of vehicles along each road segment (e.g., lane changes, passing, etc.), but rather, only model queueing effects at the intersections. You need to define and collect some statistics that you can use to validate that the simulation is operating correctly. You should compute the average time each vehicle waits at an intersection, as well as its overall transit time through the network. You may reuse any software you developed in the first programming assignment to complete this assignment. Note that you will need access to a machine with the pthreads library installed to complete this assignment. You should have already have access to a Linux machine through your computer
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved