30.07.2015 Views

Actas JP2011 - Universidad de La Laguna

Actas JP2011 - Universidad de La Laguna

Actas JP2011 - Universidad de La Laguna

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

| m0<strong>Actas</strong> XXII Jornadas <strong>de</strong> Paralelismo (<strong>JP2011</strong>) , <strong>La</strong> <strong>La</strong>guna, Tenerife, 7-9 septiembre 2011Fig. 3.Value function <strong>de</strong>terminationFig. 2.Situation with 4 flows and 2 symmetric combinationsing time we apply the so-called value iteration (VA)algorithm (for <strong>de</strong>tails see [7] and [3]). First a costnflow∑function C(q, l) = q j is <strong>de</strong>fined that capturesj=1the waiting time during the coming time slot forthe current state (q, l). Note that by Little’s lawminimizing the expected number of cars waiting alsominimizes the overall expected waiting time. Next aso-called value vector V n (q, l) that gives a valuationfor each state over the next n time slots, is to becomputed for n = 1, 2, 3, . . .. Clearly the cost over0 periods is zero, hence we start the value iterationalgorithm with n = 0 and V n (q, l) = 0 for all states(q, l). Then one <strong>de</strong>termines iteratively optimum <strong>de</strong>cisionsa such thatV n+1 (q, l) = C(q, l) + min E e|a V n (T (q, l, a, e))awhere T is a transformation function that gives thestate at which to arrive when at the current state,the <strong>de</strong>cision a is taken and arrival event e happens.The whole is sketched in Figure 3. Notice thatthe number of possible events is 2 nflow , as at eachqueue, a car may arrive or not. The probabilitiesare <strong>de</strong>termined from the vector of traffic intensities(λ 1 , . . . , λ nflow ). If l = 0, i.e. all lights are red, the<strong>de</strong>cision a ∈ {1, . . . , ncomb}, i.e. one of the combinationscan be given a green light. In the other cases,there are 2 possibilities; either the light stays as it is,or is put in the all-red state to clear the intersection.Fig. 4.in |max20 30 40 5010Convergence of the span for the F4C2 instance, calculatedby the parallel co<strong>de</strong> on a quad-socket eight-coreIntel X7550 (Beckton).Convergence100 150 200 #iterations 50 0III. Coding Value iterationThe value iteration process requires running the iterationsup to convergence. At each iteration all valuesfor the ns states of V n+1 have to be <strong>de</strong>termined.If l = 0, this requires looking up ncomb × 2 nflow valuesin V n . As we have seen, this is less if one of thecombinations is green. We should look up 2 nflow+1and take the minimum over the two <strong>de</strong>cisions.V n(ns)V n+1(ns)(2,ncomb) {0,…,2 nflow }iFig. 5. Each V n+1 (i) is <strong>de</strong>termined using 2 or ncomb ×Q nflowelements of V n, <strong>de</strong>pending on the state of light.In summary, the iterative process of value iterationfor the TCT generation can be sketched as follows:……The converging part in the process is the differenceV n+1 −V n converging to a constant vector whichrepresents the average waiting time in the system.Practical implementations require the translation ofthe state (q, l) to a state number i and vice versa,such that one works with two arrays with elementsV n+1 (i) and V n (i). The convergence is measured bykeeping hold of the so-called span <strong>de</strong>fined as span =max i (V n+1 (i) − V n (i)) − min i (V n+1 (i) − V n (i)). Thisis illustrated in Figure 4.for(i=0;i < nflows;i++)q[i]=1;while(1){for(i=0;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!