src/yapf/yapf_settings.h
changeset 10703 2c998f3776d1
parent 10702 d36547edcb86
child 10704 fddc3dafcc69
equal deleted inserted replaced
10702:d36547edcb86 10703:2c998f3776d1
     1 /* $Id$ */
       
     2 
       
     3 /** @file yapf_settings.h Penalty settings for YAPF. */
       
     4 
       
     5 #if !defined(YAPF_SETTINGS_H) || defined(YS_DEF)
       
     6 
       
     7 # ifndef  YAPF_SETTINGS_H
       
     8 #  define  YAPF_SETTINGS_H
       
     9 # endif
       
    10 
       
    11 # ifndef YS_DEF
       
    12 /*
       
    13  *  if YS_DEF is not defined, we will only do following declaration:
       
    14  *  struct YapfSettings {
       
    15  *    bool   disable_node_optimization;
       
    16  *    uint32 max_search_nodes;
       
    17  *    .... all other yapf related settings ...
       
    18  *  };
       
    19  *
       
    20  *  otherwise we will just expand YS_DEF_xx macros and then #undef them
       
    21  */
       
    22 #  define YS_DEF_BEGIN struct YapfSettings {
       
    23 #  define YS_DEF(type, name) type name;
       
    24 #  define YS_DEF_END };
       
    25 
       
    26 # endif /* !YS_DEF */
       
    27 
       
    28 # ifndef   YS_DEF_BEGIN
       
    29 #  define  YS_DEF_BEGIN
       
    30 # endif // YS_DEF_BEGIN
       
    31 
       
    32 # ifndef   YS_DEF_END
       
    33 #  define  YS_DEF_END
       
    34 # endif // YS_DEF_END
       
    35 
       
    36 YS_DEF_BEGIN
       
    37 	YS_DEF(bool  , disable_node_optimization)  ///< whether to use exit-dir instead of trackdir in node key
       
    38 	YS_DEF(uint32, max_search_nodes)           ///< stop path-finding when this number of nodes visited
       
    39 	YS_DEF(bool  , ship_use_yapf)              ///< use YAPF for ships
       
    40 	YS_DEF(bool  , road_use_yapf)              ///< use YAPF for road
       
    41 	YS_DEF(bool  , rail_use_yapf)              ///< use YAPF for rail
       
    42 	YS_DEF(uint32, road_slope_penalty)         ///< penalty for up-hill slope
       
    43 	YS_DEF(uint32, road_curve_penalty)         ///< penalty for curves
       
    44 	YS_DEF(uint32, road_crossing_penalty)      ///< penalty for level crossing
       
    45 	YS_DEF(uint32, road_stop_penalty)          ///< penalty for going through a drive-through road stop
       
    46 	YS_DEF(bool  , rail_firstred_twoway_eol)   ///< treat first red two-way signal as dead end
       
    47 	YS_DEF(uint32, rail_firstred_penalty)      ///< penalty for first red signal
       
    48 	YS_DEF(uint32, rail_firstred_exit_penalty) ///< penalty for first red exit signal
       
    49 	YS_DEF(uint32, rail_lastred_penalty)       ///< penalty for last red signal
       
    50 	YS_DEF(uint32, rail_lastred_exit_penalty)  ///< penalty for last red exit signal
       
    51 	YS_DEF(uint32, rail_station_penalty)       ///< penalty for non-target station tile
       
    52 	YS_DEF(uint32, rail_slope_penalty)         ///< penalty for up-hill slope
       
    53 	YS_DEF(uint32, rail_curve45_penalty)       ///< penalty for curve
       
    54 	YS_DEF(uint32, rail_curve90_penalty)       ///< penalty for 90-deg curve
       
    55 	YS_DEF(uint32, rail_depot_reverse_penalty) ///< penalty for reversing in the depot
       
    56 	YS_DEF(uint32, rail_crossing_penalty)      ///< penalty for level crossing
       
    57 	YS_DEF(uint32, rail_look_ahead_max_signals)///< max. number of signals taken into consideration in look-ahead load balancer
       
    58 	YS_DEF(int32 , rail_look_ahead_signal_p0)  ///< constant in polynomial penalty function
       
    59 	YS_DEF(int32 , rail_look_ahead_signal_p1)  ///< constant in polynomial penalty function
       
    60 	YS_DEF(int32 , rail_look_ahead_signal_p2)  ///< constant in polynomial penalty function
       
    61 
       
    62 	YS_DEF(uint32, rail_longer_platform_penalty)           ///< penalty for longer  station platform than train
       
    63 	YS_DEF(uint32, rail_longer_platform_per_tile_penalty)  ///< penalty for longer  station platform than train (per tile)
       
    64 	YS_DEF(uint32, rail_shorter_platform_penalty)          ///< penalty for shorter station platform than train
       
    65 	YS_DEF(uint32, rail_shorter_platform_per_tile_penalty) ///< penalty for shorter station platform than train (per tile)
       
    66 YS_DEF_END
       
    67 
       
    68 #undef YS_DEF_BEGIN
       
    69 #undef YS_DEF
       
    70 #undef YS_DEF_END
       
    71 
       
    72 #endif /* !YAPF_SETTINGS_H || YS_DEF */