graphhopper/graphhopper — pull request #134 by khuebner (2013-12-22 20:54:26+00:00)
Title: Preparing support of turn restrictions (2): Encode turn costs depending on vehicle type

The second step of the integration of support of turn restrictions: The turn costs are stored within the graph by using turn tables (nope, not those ones DJs use, instead see #133). Now we need the turn cost values to be encoded depending on the vehicle type being used. In line with FlagEncoders this is handled the same way: for different vehicle types (such as CAR, BIKE, or FOOT) different turnCostEncoders will be used. Those encoders store their encoded turn cost value within ONE integer flag, which is stored in the turn cost table.

Some details:
Next to FlagEncoders for edge properties, TurnCostEncoders are now held by the EncodingManager. A TurnCostEncoder encodes and decodes turn restrictions/turn costs of several vehicle types into an integer flag,
like FlagEncoders do. For CAR, BIKE a DefaultTurnCostEncoder has been
declared, which stores turn restrictions only (DefaultTurnCostEncoder is ready for turn costs as well, but we don't need them yet). For FOOT a NoTurnRestrictionEncoder has been defined, which encodes neither restrictions nor costs. To define which TurnCostEncoders should be used, the EncodingManager accepts a second list of turnCostEncoders, which can be defined the same way as edgeFlagEncoders are defined.

However, those TurnCostEncoders are not being used anywhere in the code. This is just preparation for turn restriction support, which will be introduces step by step.