Inspiration

About 13% of the world's food is lost between harvest and the shop shelf, and a lot of that loss happens on the road. A refrigerated truck that gets stuck behind a snowstorm and a flash flood or a wildfire closure are just two examples. The cargo sits in the warm for hours and the shelf life burns down. Hunger is often called a supply problem, but a large part of it is a transport problem: food that exists but doesn't arrive in time to be eaten.

Navigation apps optimize for the fastest drive but we wanted one that optimizes for the cargo.

What it does

Block is an Android app for food truck drivers and distribution companies. The driver/company types a starting point and a destination. The app returns every candidate route ranked by how much of the food's shelf life will be left on arrival instead of just by arrival time.

  • Routes are drawn on the map in colour, with the best one in green.
  • Each route card shows the predicted trip time with weather delay, shelf life remaining, peak cargo temperature, distance, a 0-100 risk score, the chance of a major slowdown, and a plain-English reason ("Best option: 96.5% shelf life left on arrival; about 15 min of weather delay; crosses a Winter Storm Warning").
  • A live hazard layer shades active heat, fire, storm and flood alerts on the map, with filters for each type.
  • Drivers sign in with Firebase Authentication.

How we built it

App: native Android in Java (XML layouts, Material 3), Google Maps SDK, Firebase Auth. The phone does no scoring. It sends two addresses to our backend and draws what comes back.

Backend: Spring Boot (Java 17). For each request it:

  1. asks the Google Routes API for alternative routes,
  2. samples points about every 24 km along each route and works out the arrival time at each one,
  3. pulls the National Weather Service forecast for each point at that arrival time,
  4. scores each route with our models,
  5. checks each route against live NWS alerts and ranks the results.

Shelf-life model: Cargo temperature is a linear model trained on a public strawberry cold-chain dataset (6 refrigerated truck shipments, 21,226 fifteen-minute blocks). Shelf life as a function of temperature comes from a published storage study. The shelf-life budget is spent step by step:

$$ S_{remaining} = 100\% - \sum_{i} \frac{\Delta t_i}{24 \cdot L!\left(T_i\right)} \times 100\% $$

where $\Delta t_i$ is the length of step $i$ in hours, $T_i$ is the predicted cargo temperature, and $L(T)$ is the shelf life in days at that temperature. At typical reefer temperatures this uses about 12% of shelf life per day, so a delay has a direct, measurable cost.

Weather delay. Each weather condition slows traffic by a speed reduction $r$ taken from FHWA road-weather figures, so the time factor is

$$ f = \frac{1}{1 - r} $$

For example, rain at $r = 0.08$ gives $f \approx 1.087$, so a 410-minute rain trip

Built With

Share this project:

Updates

Submission history