A Two-Layer Approach for Predictive Optimal Cruise Control