Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Dynamic programming code, find the minimum cost path in 2d array of: 1 2 3 4 entering from 4 (south) and exiting out of

python Dynamic programming code, find the minimum cost path in 2d array of:

1 2

3 4

entering from 4 (south) and exiting out of 1, after entering we can go straight to 2 and then to 1, or we can go to 3 and then to 1. it is possible ot go right but it will cost 5 seconds extra time to exit to 1.

left turn arrow, green light and the ref light, there are probebalities that you may land on one of each lights,

if you are coming from number 4

image text in transcribed

if you enter from east and try to get to 1 and 3,

image text in transcribed

Also , left on the green is allowd, but the probability is %50 of getting a 10 seconds delay by the coming traffic.

Write a program to simulate 10,000 cars traveling through the square and exiting, recording average time to transit the square. Assume it takes exactly one minute to drive the side of the square, adding the time required to wait at each light. Tally average time to transit the square according to each policy, the the decision to turn left at intersection 4 every time, go straight every time, or choose the best option at intersection 4.

There are three strategies:

Always turn left at 4

Always go straight at 4

Go straight at the light if it is green, otherwise turn left (possibly waiting for the turn arrow)

Determine the optimal strategy.

Coming from the south: Left arrow 10 15 15 10 Green light Red light 40 50 30 35 40 30 2 3 4 40 Coming from the south: Left arrow 10 15 15 10 Green light Red light 40 50 30 35 40 30 2 3 4 40

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions

Question

What is meant by framing a case?

Answered: 1 week ago

Question

How can I find a good scholarly article for my paper?

Answered: 1 week ago