Modelling and optimal receding-horizon control of maritime container terminals