...
Get all input, segment, and route data for our current segment
Using that data, determine the values of our variable data (this is the optimizing step)
Option 1: Optimize for a single variable (ie. max velocity) and determine what values our other variable data need to be such that our optimizing variable is optimized (easier method)
Option 2: Multivariable optimization such that all our variable data values are optimized → Some variable data may be dependent on each other (hard method, will need to come up with an optimization model)
Calculate output data using our optimized variable data
Use output data as the input data for the next segment and repeat this algorithm on that segment
...