38
APAS: AgentNet Predictive Arrival Service

Predictive Arrival

Embed Size (px)

DESCRIPTION

Predictive arrival solution for last-mile package deliveries. Implemented at Ensenda, Inc.

Citation preview

APAS: AgentNet

Predictive Arrival Service

What is APAS?

2

Software service which generates end-user package

arrival times based on numerous events (actual and predicted) that occur during a

delivery

Introduction

•  Provides predictive arrival times for package deliveries.

•  Accuracy based on telemetry data from numerous resources (carriers, live traffic streams, GPS devices).

•  Supports a number of heuristic rules to ensure quality and end-user acceptable predictions.

•  Provides an external interface to drop in third-party predictive services.

•  Allows carriers to contribute at run-time to APAS in heuristics and actual ETA times. For example, providing length of time to unload a package.

3

Contributions •  Research papers – examples:

•  “Hybrid Predictive Control Strategy for a public Transport System with Uncertain Demand”.

•  “Integration of Predictive Routing Information with dynamic Traffic Signal Control”.

•  “Agent-Based Approaches to Transportation Logistics”. •  “The Use of Integrated Historical and Predictive Data to

Support Flight Planning by Airline Dispatchers”. •  Studies/Research Organizations

•  Committee on New Transportation Systems and Technology. •  Transportation Research Board •  Transit Cooperative Research Program •  Texas Transportation Institute

•  Open Source and APIs •  OpenGTS – open GPS management system •  GeoBase – Application Programming Interface

•  Existing vendors •  FltAdvisor – predictive arrival for airline flights •  INRIX – traffic information •  GeoBase

4

5

Types of Telemetry

Stop 1 Stop 3 Stop 2

GPS Activities

Delivery Activities (e.g. DELIVERED STOP 3)

Distance/Travel Time (PCMiler, Haversine Formula)

Route

Route Generation

Package Activities (Scanning)

Stop 0

Telemetry Use

• Telemetry helps: – Determine the current state and

progress of the delivery vehicle. – Determine the impact of an

event on a predicted value. For example, how does an event such as a traffic accident effect the travel time between two stops.

6

Predicted Arrival Times

• Each generated predicted arrival time is accompanied by a confidence level:

• Level 1: Highest confidence. Value based on GPS, accurate distance/travel data, access to GPS-decoding facility, and traffic information. We don’t currently generate level 1 prediction values.

• Level 2: Value based on GPS and access to GPS-decoding facility.

• Level 3: Value based solely on estimates. • Level 4: Value based on heuristics

(market site, travel, distance, etc.). 7

What is a Prediction?

8

Arrival Time =

∑ dwell + (distance / speed ) + delay i = m

n-1

i i i i

n

Arrival Time at stop n is the sum of the dwell time, travel time, and delay

for each stop between the current stop m and stop n.

Stop m + 1 Stop n - 1 Stop m + 2 Stop m Stop n …

Better Predictions

• A good prediction depends on getting the best prediction values for: – Dwell Time: how long a driver remains at

a stop for delivering a package (unloading).

– Delay Time: amount of time the driver may be delayed (for example, lunch).

– Distance: distance between two stops. – Speed: speed of the vehicle.

9

Better Predictions

• Additional telemetry data points including cross-boundaries (route overlaps).

• Better application of heuristics. For example, multiple sets of heuristics based on region, population density (city), carrier, vehicle type, product type, weather.

• Better application of algorithms derived from research into predictive arrival.

10

Analysis Filter Service • Transportation studies on predictive

arrival times indicate specific end-user reactions to arrival values.

• Studies indicate you cannot merely display every generated arrival time.

• The Analysis Filter Service employs heuristics described in the transportation studies.

• The Analysis Filter Service uses the prediction confidence levels generated by the Prediction Engine.

11

Analysis Filter Service - Example

12

Tracking Screen Request ETA

Predictive Engine

Analysis Filter

Predict Arrival

Prediction: 12/4 at 10:00

Level 4 But it’s scheduled for 12/1 at 2:00

ETA 12/1 at 2:00

GPS • GPS is used for :

–  Current location of a delivery vehicle. Distance from stop indicated on tracking web page.

–  If the vehicle is in the geozone (vicinity) of a route stop. Useful for route stops that do not represent a vendor delivery (3rd party).

•  GPS cannot tell us: –  If we have visited a route stop. –  If we are between two adjacent route

stops since we don’t know the route. –  Speed of the vehicle. –  Traffic congestion.

13

14

GPS Issues

GPS 1

Where Am I in the route given the GPS values?

GPS 3

GPS 2

15

GPS: 3rd Party Deliveries

Stop 1 Stop 3 Stop 2

GeoZone (virtual boundary)

GPS Activities

Current Stop (location within GeoZone)

Stop 0

• Designed to support the processing of large volumes of telemetry data.

• For fast response, predictions are calculated at telemetry time, not at request time.

• Designed to incorporate any number of additional telemetry streams such as traffic information sources, traffic alerts, and third-party data streams.

16

Architecture

Architecture: The Carrier Route

17

•  Central internal data structure for ETA. •  Sent by the carrier to AgentNet. •  Stored at AgentNet. •  Supports multiple delivery requests. •  Contains deliveries for one carrier. •  Contains deliveries for one driver. •  Stores the predictive (ETA) values. •  Stores all heuristics (e.g. market site estimates, speed, distance).

Delivery request A Destination

Delivery request B Destination

Dwell Time Speed to Next Stop Delay to Next Stop

Travel Time to Next Stop Predicted Arrival

Predicted Departure

Stop 0

Stop 1

Stop 2

Stop 3

CarrierRoute Last Stop

Speed Heuristic Distance Heuristic

Travel Time Heuristic Last GPS Latitude

Last GPS Longitude

Origin (Cross Dock)

Distance from vehicle Scheduled delivery

time

18

Architecture: Process

1.  Collect And Apply Telemetry (including prediction generation)

Stop 0

Stop 1

Stop 2

CarrierRoute

2. Provide Predictions

Route construction and maintenance

Route reference

19

Architecture

Predictive Analysis Filter

Telemetry (Data Flow)

Manager

Predictive Engine

Tracking Screen / End Recipient

1.  Receives request for ETA. 2.  Requests Prediction from Prediction Engine 3.  Analyze results to determine appropriate response. 4.  Sends response to end recipient.

Carrier Telemetry

Generate Predictions

Request Prediction

Agentnet

ETA Service (interface to

external callers)

predict ( tracking number)

• The Telemetry Data Flow Manager is responsible for:

• Collecting Telemetry • Constructing the appropriate data flows for

supported telemetry types (routes, activities, GPS, heuristics)

• Executing constructed data flows • Requesting prediction generation for any

affected routes • Posting notifications for end-recipient

subscribers

20

ARCHITECTURE: Telemetry Data Flow Manager

21

ARCHITECTURE: Telemetry Processing via Data Flows

Telemetry DataFlow Manager

Telemetry Data

GPS Market-

Site Estimate

Heuristics

Construct data flow

22

ARCHITECTURE: Delivery Request

Carrier Route (single stop)

Stop 0

Stop 1

Source (Leg Origin)

Predictive DataFlow Manager

Merchant Telemetry (Delivery Request)

Destination (Leg Destination)

Delivery Telemetry

MarketSite Telemetry

Distance Telemetry

Heuristics Telemetry

23

ARCHITECTURE: Carrier Route Carrier Route

Stop 0

Stop 1

Stop 2

Stop 3

Predictive Data Manager

Carrier Telemetry (Carrier Route)

Carrier Route

Stop 0

Stop 1

Carrier Route

Stop 0

Stop 1

Construct Route (discard associated

delivery routes)

Delivery Telemetry

Distance Telemetry

MarketSite Telemetry

Predictive Heuristics

24

Receive Request (best/worst)

Shipped From DC(best/worst)

Arrived at LDP (best/worst)

Picked Up (best/worst)

Carrier Route

Market Estimate (best/worst)

ReceiveRequest + ShippedFromDC + ArrivedLDP + PickedUpLDP = Market Estimate

Heuristic (in hours)

in transit

• Estimations from historical data for: – Typical vehicle speed – Typical distance between stops – Typical travel time between stops – Typical stop dwell time (e.g. time to unload

packages)

25

Predictive Heuristics

Predictive Arrival Service (ETA)

26

INTERNALS

•  Individual JAR. No longer part of the “com.agentnet.service” name family.

•  Considered at the same level as the “Services” layer in the AgentNet Architecture.

•  Does not access any class in the Service layer (duplicates a few service classes to accomplish this).

•  Name family for the Predictive Service is “com.agentnet.predictive”.

•  For every interface class, there is a corresponding implementation class with the name “Standard<interface class name>”. Allows to easily “load” a layer of associated classes.

•  External interface which is available to outside vendors is “org. smarttransportnetwork.epas”.

•  All Agent-based services will use the family name “org.smarttransportnetwork”.

27

Internals: AgentNet Predictive Service

•  Predictive codeline is divided into five paths: –  Statistics (package com.agentnet.epas.statistics).

Provides management and processing of statistical information relating to routes, route-based deliveries, and predictive events.

–  Data (package com.agentnet.epas.data). Provides management and processing of data associated with predictive arrival (e.g. telemetry, geozones, geopoints).

–  GIS (package com.agentnet.epas.gis). Provides abstraction layer for existing geospatial information systems such as Google and PCMiler.

–  Runtime (package com.agentnet.epas.runtime). Provides runtime processing of the predictive service including filtering and the prediction engine.

–  External interfaces (package org.natltransportgrid.epas). Interfaces available to the outside world.

28

Internals: General Code Structure

29

Internals: Data Code Structure com.agentnet.epas.data

Telemetry (handlers)

Manager

PredictiveCarrierRoute

PredictiveCarrierRouteStop

StandardTelemetryDataFlowManager LocationTelemetry

Domain

StandardETADataManager

StandardRouteStopManager MarketSiteTelemetry

DistanceTelemetry

GPSLocationTelemetry

GeoPoint GeoZone

30

Friday, January 4, 2013 Agentnet Company Confidential Internals: Runtime Code Structure

com.agentnet.epas.runtime

engine filter

StandardETAAnalysisFilter StandardPredictiveEngine

service

StandardETAService

call sequence

31

Internals: Statistics Code Structure

com.agentnet.epas.statistics

RouteStatistics PredictiveRouteStatistics PredictiveEventStatistics

32

Internals: External Geospatial Information Systems (e.g. PCMiler)

com.agentnet.epas.gis

PCMiler GeoBase … Google

33

Internals: External Interfaces Code Structure

org.natltransportgrid.epas

service

ETAService predict(trackingNumber)

Data (not used)

ETADataManager

www.natltransportgrid.org

34

Internals: Telemetry Handling Process Flow

ETA Data Manager

Integration Operation Handlers

Telemetry Data Flow Manager

TelematicsListener

TelematicsQueue

Telemetry Data (XML conversations)

IntegQueue

collectTelemetry(<telemetry>)

NotificationListener

NotificationQueue

Future Direct Flows

35

Internals: Prediction Requests

ETAService

Any internal/ external module

Analysis Filter

predict(trackingNumber)

predict(trackingNumber)

Predictive Engine predict(trackingNumber)

ETAResult

•  Stores heuristics. Accessed by heuristics telemetry handler. For example: [when] city=‘SAN FRANCISCO’ and carrier=‘CMS’ and packageType=‘CABINET’ [then] dwell = 100

•  Stores Filter Rules. Accessed by ETA Analysis Filter to apply filter rules to predictions. For example: [when] etaFrom > etaPreviousFrom [then] etaFrom = etaPreviousFrom

•  Stores notification rules. Used by notification listener to invoke end-user subscription rules. [when] distanceFromStop < 30 [then] sendEmail()

•  Agentnet uses Drools 5.0. All rules are managed via the Drools Guvnor product.

36

Drools: JBoss Rules Engine

37

Internals: Route Database Tables

RouteSearchIndex Used for searching. Locates a route for a particular delivery leg.

TrackingID Agentnet Tracking Number

DeliveryID ObjectID of corresponding delivery object containing leg.

RouteID ObjectID of route containing the delivery leg.

LastPredictedArrivalFrom

LastPredictedArrivalTo

LastPredictedDepartureFrom

LastPredictedDepartureTo

PredictionConfidenceLevel

Route Stores the route XML string which holds all

predictive information

RouteXML CarrierRoute XML String

38

Internals: Route Event Database Tables

RouteEvent Used for searching. Locates a route for a particular delivery leg.

ObjectID Agentnet Tracking Number

AgentnetTrackingNumber ObjectID of corresponding delivery object containing leg.

RouteID ObjectID of route containing the delivery leg.

CreationDate

StopAgentnetIdentifier

StopSequence

Reason

EventType

PredictedArrivalFrom

PredictedArrivalTo

PredictedDepartureFrom

PredictedDepartureTo

Dwell

Speed

Distance

Delay

DistanceFromStop

ActualArrival

Actual Departure

Stores prediction history. Used to determine the accuracy of

EPAS and as the contributor to the eventual feedback loop. One row for each prediction change.

Essentially, one row for each telemetry event.