  In this paper, an eco--driving Pontryagin maximum principle (PMP) algorithm
is designed for optimal deceleration and gear shifting in trucks based on
switching among a finite set of driving modes. The PMP algorithm is implemented
and assessed in the IPG TruckMaker traffic simulator as an eco--driving
assistance system (EDAS). The developed EDAS strategy reduces fuel consumption
with an optimized velocity profile and, in practice, allows contextual feedback
incorporation from the driver for safety. Furthermore, the optimization over
driving modes is computationally inexpensive, allowing the methodology to be
used online, in real--time. Simulation results show that significant fuel
savings can be achieved proportional to the number of velocity events and the
difference between current velocity and final desired velocity for each event.
