Skip to main content
. 2018 Jun 23;18(7):2020. doi: 10.3390/s18072020
Algorithm 2 Extraction of travel times vs. load samples.
  • Require: 

    Reunified segment file, Segment-info files

  • Ensure: 

    Statistical learning by segment files

  • 1:

    for segment in Reunified segment file do

  • 2:

        segmentConnected[] vector that stores all edge ids connected

  • 3:

        for s=0 to length(segmentConnected) do

  • 4:

            segment_info Read lines segmentConnected[s] in Segment-info files

  • 5:

            segmentSorted[][] sort_by_tin(segment_info)

  • 6:

            for tin=0 to length(segmentSorted) do

  • 7:

               νn number vehicles per segment in each lane

  • 8:

               for tout=tin to tout>=0 step − 1 do

  • 9:

                   if (segmentSorted[tin][ln]=segmentSorted[tout][ln]) and (segmentSorted[tin][tinν]<=segmentSorted[tout][toutν]) then

  • 10:

                       νn=νn+1 increase the number of vehicles if the condition is met

  • 11:

                   end if

  • 12:

               end for

  • 13:

            end for

  • 14:

            Δt¯ average of the travel times for different degrees of congestion

  • 15:

            ν number of vehicles in the segment before a new vehicle enters the segment

  • 16:

        end for

  • 17:

    end for