Presentation is loading. Please wait.

Presentation is loading. Please wait.

Route aware subsystem Group C Laurence Cabenda Rudy van Wandelen Niels Reyngoud.

Similar presentations


Presentation on theme: "Route aware subsystem Group C Laurence Cabenda Rudy van Wandelen Niels Reyngoud."— Presentation transcript:

1 Route aware subsystem Group C Laurence Cabenda Rudy van Wandelen Niels Reyngoud

2 General Idea

3 Given(1) Some type POS := (REAL, REAL, REAL) –Position in the geography Some type TRAVELTIME := TIME –The relative travel time between two positions Some type TIME := { (INT, INT, INT) }  {NEVER,NOUPDATE} –Absolute value of time Some type BS := INT –Bus Stop identifier

4 Given(2) Some type LINEID := INT –The line number of a bus (e.g. line 12) Some type DIRECTION := INT –A bus can drive in two directions Some type BUSID := INT –The ID of a bus Some function standlocation: BS -> POS to find the location of a bus stand given its identifier Some function busstand : POS -> BS to find the BSID of a certain location

5 Given(3) A type EST:={0..n-1}  (BS, TIME) –Estimated (absolute) arrival times A type SCHEDULE:={0..n-1}  (LINEID, BUSID, EST) –Used for the old estimated arrival times – this is used for comparison old_for_id: (BUSID, LINEID, SCHEDULE)  EST –Returns the old EST for a specific bus on a specific line. calculate_new_est : (BUSID, LINEID, TIME, LOCATION, DIRECTION) -> EST –Estimate the new arrival times for bus stands. The result only contains the busstands which the bus will still pass in its direction.

6 Given(4)  : (EST, EST)  BOOL –Check whether two estimates are about the same –  (oldbsid, oldtime)  old, (newbsid, newtime)  new: ( (oldbsid = newbsid) -> | newtime – oldtime| <  ) –Why compare times at all next bus stands? Comparing the times at just one stand would constraint implementation: you might want to use different extrapolating functions for estimating arrival times

7 Initializing the schedule Initially, old_est, the set of old estimates (of type SCHEDULE) is set to the standard bus schedule. Initially, the standard schedule (of type {0..n-1}  (LINEID, BUSID, TIME) is stored at the bus stands. old_time = NEVER (in this variable the time of the last received message is stored)

8 Input A quadruple containing: –busid: BUSID –location: POS –lineid: LINEID –direction: DIRECTION –time: TIME

9 Output A tuple containing: –busid:BUSID –lineid:LINEID –outputestimate:EST outputestimate is a list of all busstandID’s in a certain direction with a time. The time for the busstands which were passed is NEVER, the time for busstands which don’t need an update is NOUPDATE

10 Output (1) A new estimate is only calculated when the received message is not older than the latest received message –Avoid processing of messages which “got lost” in the system time <= old_time  outputestimate = empty sequence

11 Output (2) new_est = calculate_new_est(busid, lineid, time, location, direction). When a bus passed one or more stands…  standloc  standlocs : (location  standloc)   (bs, time)  outputestimate : bs = busstand (standloc) -> time = NEVER ( standlocs = map standlocation (map fst (old_for_id(busid, lineid, old_est) ))

12 Output (3) Check if the new estimate is different from the old: –(new_est  old_for_id(busid, lineid, old_est) )   (bs,time)  outputestimate : (bs  map fst (new_est) -> time = NOUPDATE) –Otherwise  Only for the busstands that are in new_est, these busstands have the same time value in outputestimate.These are the new estimates for the stands that the bus will still pass.

13 Output (4) When no messages come in anymore from a certain bus… –“current time” >= (old_time +  )   (bs, time)  outputestimate -> time = NEVER –The bus system has crashed or was turned off.

14 Updates Finally, old_est(lineid, busid) = new_est Store the time at which this message was received: old_time = time


Download ppt "Route aware subsystem Group C Laurence Cabenda Rudy van Wandelen Niels Reyngoud."

Similar presentations


Ads by Google