City bicycle rental scheme

A large-scale bicycle rental scheme that has around 18,000 bicycles and 1,200 bicycle stations can be used to demonstrate the use case of Decision Server Insights, and in particular aggregation.

A city bicycle rental scheme with an estimated average daily usage of 110,000 provides a good use case for Decision Server Insights. Each station is equipped with an automatic rental terminal, a map of other nearby stations and stands for dozens of bicycles. The rental terminals also give information about neighboring stations, including location, number of available bicycles, and open stands. If a user arrives with a rented bicycle at a station without open spots, the terminal grants another 15 minutes of free rental time. A fleet of 23 bicycle-transporting vehicles is used daily to redistribute bicycles between empty and full stations.

There is a certain amount of logic the application must process. The premise of the scheme is that customers pick up an available bike from a bike station, and drop it off at some other bike station. The customers are charged according to certain pricing rules.

To use the system, customers must take out a subscription, which allows the subscriber an unlimited number of rentals. Subscriptions can be purchased per day, per week, per month, or per year. With a subscription, bike rental is free for the first half hour of every individual trip; an unlimited number of such free trips can be made per day.

The business logic of the application is summarized by the following rules:

The solution has a number of agents and aggregations to process the arrival of events:

Bike Station Rule Agent
An agent that is bound to the Bike Station entity receives Bike Station Utilization Update events. The entity stores the chronology. The chronology is updated as a result of the rules that are fired on arrival of the various events. Rules emit a Bike Rented events when they detect a bike at a station is removed from a slot, and a Bike Returned event when a bike is added. Data such as how long has the number of filled slots been over 90% is also stored, but is periodically reset at midnight.
Aggregate of Bikes Returned and Bikes Rented events
Calculates the total number of bikes rented (returned) so far today, across all bike stations.
Aggregate of Landmark entities
Calculates the total number of bikes available "near" each landmark at the current time. It takes advantage of static association of landmark with nearby bike stations, and uses the chronology in each bike station.
Landmark Rule Agent
Generates Near Landmark Update events when a rule receives a Bike Station Utilization Update Event. It determines whether the station is within the neighborhood of a certain landmark and emits a Near Landmark Update event, which includes data from the input event and also information about the landmark.
Aggregate of Near Landmark Update events
Calculates the percentage of time over the last N hours which bike stations near a landmark exceed 90% capacity.
Aggregate of Bike Station entities
Triggered every 3 minutes to determine which stands within 5 minutes walking distance of a landmark are full for at least the last 15 minutes.
Full Bike Station Rule Agent
Reads the result of the Bike Station aggregate and triggers an alert if there are full or empty stands.
  • When the capacity of a station > N during the last 20 minutes emit a station too full warning.
  • When the capacity of a station < N during the last 20 minutes emit a station too empty warning.
Predictive Scoring Agent
Calls an SPSS® predictive model to determine the closest station with the highest probability of having bikes available to rent. The model takes a list of stations, a day of the week and a time of day. It predicts the number of bikes available at each of the stations.