Develop financial projections for alternative solutions

Assignment Help Other Subject
Reference no: EM13326963

In a city there is an intersection where two (single lane) one-way streets cross each other. Write a C or C++ program that simulates the situation at this intersection and measures how long each queue gets during a 2 hour period. Adjust the phasing of the traffic lights to minimise the two queues that form at the intersection.

A sample program is available as a starting point for the assignment. It is able to receive two command line arguments, phase for Q1 and phase for Q2 (the equivalent of adjusting the phasing of the traffic lights for each intersection). During testing you can change the command line arguments approach, but for the final submission make sure that your code is working with it (open a cmd window and test it).

The intersections will be represented by two queues. The two queues need to be implemented using a dynamic data-structure, as the number of cars in each queue are unknown before the runtime.

Notes:

1. The program must contain two queues, each one based on a linked-list.

2. Write a new method (or function) to return the number of items (length) of the queue.

3. Each car is represented by an ID number - hence you need two queues of integers.

4. You need an integer counter (clock) to count the seconds from 0 to 7200 (2 hours), which is already implemented in the example.

5. This is an event driven program - the main program is a loop that increments the clock each time it executes.

6. Every 18 seconds a car joins queue 1 and every 22 seconds a car joins queue 2. This is fixed and should not be changed (in the example, represented by variables Q1arrive and Q2arrive).

7. Every 10 seconds a car leaves a queue and crosses the intersection (depending on which queue has the green light). This is also fixed, and is represented by variable leave_rate.

8. Phasing is the number of seconds that the light is green. Start your program with a phasing of 40 seconds for queue 1 and a phasing of 30 seconds for queue 2. For "technical reasons", phasing can never be set to less than 30 seconds. Again, in the example the variables are Q1phase and Q2phase.

9. Adjust the phasing to minimise the length of the queues. The current length of the queues are printed out for every second of the runtime. During the runtime, a queue of less than 5 cars is ideal but a queue of less than 9 cars is already acceptable. Try different phasing until you get acceptable queue sizes for both Q1 and Q2 (that's when arguments from command lines are useful).

10. After trying different phasing, write down as a comment on the top of the source code what was the best combination (phasing queue 1 = __ , phasing queue 2 = __).

Reference no: EM13326963

Questions Cloud

The market for a product is expected to increase : The market for a product is expected to increase at an annual rate of 8%. First year sales are estimated at $60,000, the horizon is 15 years, and the interest rate is 10%. What is the present value?
Why is market competition important is there a positive or : Why is market competition important? Is there a positive or negative impact on the economy when strong competitive pressures drive firms out of business? Why or why not?
What are the new lengths of the side of the plate : A square copper plate has a circular hole in its center. Each side of the plate is 23.52 cm, and the radius of the circular hole is 7.827 cm
Promote the destruction of cells with unrepaired dna : the normal function of p53 is to A) promote growth of tumor B) signal immune system cells that tumor cells are present C) promote the destruction of cells with unrepaired DNA replication errors
Develop financial projections for alternative solutions : The intersections will be represented by two queues. The two queues need to be implemented using a dynamic data-structure, as the number of cars in each queue are unknown before the runtime.
Explain the difference between accounting and economic proft : Explain the difference between accounting and economic profits.
How high above the ground level would the nail be : If a nail were driven into a tree at a height of five feet from ground level, and thereafter the tree grew an average of two feet in height per year, approximately how high above the ground level would the nail be ten years later
Determine the work done by the net force on the block : A block of mass 2.50 kg is pushed 3.00 m along a frictionless horizontal table by a constant 18.0 N force directed 25.0° below the horizontal. Determine the work done by the net force on the block
Find the speed of the block at the equilibrium point : A block with mass of 4.52 kg is attached to a horizontal spring with spring constant k = 3.59 102 N/m, Find the speed of the block at the equilibrium point

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd