How to create a turning movements/turn penalty file using Voyager script?


Product(s):Cube
Version(s):6.1 to 6.5
Area:Network


Turn penalty files are used for incorporating turn delays in highway skimming/assignment. These files define the turning movement, the penalty set and the penalty value in time units (a negative value is used for turn prohibitions). Turn penalty files are ASCII files with 4 four columns of data: From Node, Through Node, To Node, Penalty Set and Penalty Value. Below is an example

437 443 599 1 0.2
437 443 993 1 0.2
437 443 1235 1 0.4
599 443 437 1 0.2
599 443 993 1 0.4
599 443 1235 1 -1.0
993 443 437 1 0.4

Solution

Users can create a turn penalty file by using any text editor and visually identifying the nodes and direction of turn for each turning movement, from a highway network. Cube network editor window also provides an excellent interface for coding turn penalties. Both these methods involve coding turn penalties each node at a time. This could be time consuming. To avoid this manual coding and save some time coding each turning movement, user’s can use the attached Voyager script to output a turn penalty file, which has left and right turning movements with constant penalties. This script uses the NETWORK program and the topology functions to code left and right turn movements in the network. It works by identifying the upstream link for each link, and calculates the angle from the upstream link. If the angle is greater than 45 deg and less than 135 deg, the turning movement is coded as left turn. If the angle is greater than 225 deg and less than 315 deg, the turning movement is coded as right turn. The angles might be more accurate if the input network is a shape network compared to a stick network.

Users have to update the following variables before running the script for their network.

  1. <OutputPenaltyFile> - Name of the output penalty file e.g., BaseTurnPenalty.pen
  2. <InputNetwork> - Location of the input highway network
  3. <penalty set> - penalty set for the movement
  4. <left turn penalty> - penalty for left turn movement in time units e.g, 0.3
  5. <right turn penalty> - penalty for right turn movement in time units e.g., 0.1

communities.bentley.com/.../WriteTurnPenalties.zip