00001
00002
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00031
00032 #ifndef RCSC_PARAM_SERVER_PARAM_H
00033 #define RCSC_PARAM_SERVER_PARAM_H
00034
00035 #include <rcsc/geom/vector_2d.h>
00036
00037 #include <boost/scoped_ptr.hpp>
00038
00039 #include <string>
00040
00041 namespace rcsc {
00042
00043 namespace rcg {
00044 struct server_params_t;
00045 }
00046 class ParamMap;
00047
00052 class ServerParam {
00053 private:
00054
00056 boost::scoped_ptr< ParamMap > M_param_map;
00057
00058 public:
00060
00061 static const int DEFAULT_MAX_PLAYER;
00062 static const double DEFAULT_PITCH_LENGTH;
00063 static const double DEFAULT_PITCH_WIDTH;
00064 static const double DEFAULT_PITCH_MARGIN;
00065 static const double DEFAULT_CENTER_CIRCLE_R;
00066 static const double DEFAULT_PENALTY_AREA_LENGTH;
00067 static const double DEFAULT_PENALTY_AREA_WIDTH;
00068 static const double DEFAULT_PENALTY_SPOT_DIST;
00069 static const double DEFAULT_PENALTY_CIRCLE_R;
00070 static const double DEFAULT_GOAL_AREA_LENGTH;
00071 static const double DEFAULT_GOAL_AREA_WIDTH;
00072 static const double DEFAULT_GOAL_DEPTH;
00073 static const double DEFAULT_CORNER_ARC_R;
00074
00075 static const double DEFAULT_GOAL_POST_RADIUS;
00076
00077 static const double DEFAULT_WIND_WEIGHT;
00078
00080
00081
00082
00083 static const double DEFAULT_GOAL_WIDTH;
00084 static const double DEFAULT_INERTIA_MOMENT;
00085
00086 static const double DEFAULT_PLAYER_SIZE;
00087 static const double DEFAULT_PLAYER_DECAY;
00088 static const double DEFAULT_PLAYER_RAND;
00089 static const double DEFAULT_PLAYER_WEIGHT;
00090 static const double DEFAULT_PLAYER_SPEED_MAX;
00091 static const double DEFAULT_PLAYER_SPEED_MAX_MIN;
00092 static const double DEFAULT_PLAYER_ACCEL_MAX;
00093
00094 static const double DEFAULT_STAMINA_MAX;
00095 static const double DEFAULT_STAMINA_INC_MAX;
00096
00097 static const double DEFAULT_RECOVER_INIT;
00098 static const double DEFAULT_RECOVER_DEC_THR;
00099 static const double DEFAULT_RECOVER_MIN;
00100 static const double DEFAULT_RECOVER_DEC;
00101
00102 static const double DEFAULT_EFFORT_INIT;
00103 static const double DEFAULT_EFFORT_DEC_THR;
00104 static const double DEFAULT_EFFORT_MIN;
00105 static const double DEFAULT_EFFORT_DEC;
00106 static const double DEFAULT_EFFORT_INC_THR;
00107 static const double DEFAULT_EFFORT_INC;
00108
00109 static const double DEFAULT_KICK_RAND;
00110 static const bool DEFAULT_TEAM_ACTUATOR_NOISE;
00111 static const double DEFAULT_PLAYER_RAND_FACTOR_L;
00112 static const double DEFAULT_PLAYER_RAND_FACTOR_R;
00113 static const double DEFAULT_KICK_RAND_FACTOR_L;
00114 static const double DEFAULT_KICK_RAND_FACTOR_R;
00115
00116 static const double DEFAULT_BALL_SIZE;
00117 static const double DEFAULT_BALL_DECAY;
00118 static const double DEFAULT_BALL_RAND;
00119 static const double DEFAULT_BALL_WEIGHT;
00120 static const double DEFAULT_BALL_SPEED_MAX;
00121 static const double DEFAULT_BALL_ACCEL_MAX;
00122
00123 static const double DEFAULT_DASH_POWER_RATE;
00124 static const double DEFAULT_KICK_POWER_RATE;
00125 static const double DEFAULT_KICKABLE_MARGIN;
00126 static const double DEFAULT_CONTROL_RADIUS;
00127
00128
00129 static const double DEFAULT_MAX_POWER;
00130 static const double DEFAULT_MIN_POWER;
00131 static const double DEFAULT_MAX_MOMENT;
00132 static const double DEFAULT_MIN_MOMENT;
00133 static const double DEFAULT_MAX_NECK_MOMENT;
00134 static const double DEFAULT_MIN_NECK_MOMENT;
00135 static const double DEFAULT_MAX_NECK_ANGLE;
00136 static const double DEFAULT_MIN_NECK_ANGLE;
00137
00138 static const double DEFAULT_VISIBLE_ANGLE;
00139 static const double DEFAULT_VISIBLE_DISTANCE;
00140
00141 static const double DEFAULT_WIND_DIR;
00142 static const double DEFAULT_WIND_FORCE;
00143 static const double DEFAULT_WIND_ANGLE;
00144 static const double DEFAULT_WIND_RAND;
00145
00146
00147
00148 static const double DEFAULT_CATCH_AREA_L;
00149 static const double DEFAULT_CATCH_AREA_W;
00150 static const double DEFAULT_CATCH_PROBABILITY;
00151 static const int DEFAULT_GOALIE_MAX_MOVES;
00152
00153 static const double DEFAULT_CORNER_KICK_MARGIN;
00154 static const double DEFAULT_OFFSIDE_ACTIVE_AREA_SIZE;
00155
00156 static const bool DEFAULT_WIND_NONE;
00157 static const bool DEFAULT_USE_WIND_RANDOM;
00158
00159 static const int DEFAULT_COACH_SAY_COUNT_MAX;
00160 static const int DEFAULT_COACH_SAY_MSG_SIZE;
00161
00162 static const int DEFAULT_CLANG_WIN_SIZE;
00163 static const int DEFAULT_CLANG_DEFINE_WIN;
00164 static const int DEFAULT_CLANG_META_WIN;
00165 static const int DEFAULT_CLANG_ADVICE_WIN;
00166 static const int DEFAULT_CLANG_INFO_WIN;
00167 static const int DEFAULT_CLANG_MESS_DELAY;
00168 static const int DEFAULT_CLANG_MESS_PER_CYCLE;
00169
00170 static const int DEFAULT_HALF_TIME;
00171 static const int DEFAULT_SIMULATOR_STEP;
00172 static const int DEFAULT_SEND_STEP;
00173 static const int DEFAULT_RECV_STEP;
00174 static const int DEFAULT_SENSE_BODY_STEP;
00175
00176
00177 static const int DEFAULT_PLAYER_SAY_MSG_SIZE;
00178 static const int DEFAULT_PLAYER_HEAR_MAX;
00179 static const int DEFAULT_PLAYER_HEAR_INC;
00180 static const int DEFAULT_PLAYER_HEAR_DECAY;
00181
00182 static const int DEFAULT_CATCH_BAN_CYCLE;
00183
00184 static const int DEFAULT_SLOW_DOWN_FACTOR;
00185
00186 static const bool DEFAULT_USE_OFFSIDE;
00187 static const bool DEFAULT_KICKOFF_OFFSIDE;
00188 static const double DEFAULT_OFFSIDE_KICK_MARGIN;
00189
00190 static const double DEFAULT_AUDIO_CUT_DIST;
00191
00192 static const double DEFAULT_DIST_QUANTIZE_STEP;
00193 static const double DEFAULT_LANDMARK_DIST_QUANTIZE_STEP;
00194 static const double DEFAULT_DIR_QUANTIZE_STEP;
00195
00196
00197
00198
00199
00200
00201
00202 static const bool DEFAULT_COACH_MODE;
00203 static const bool DEFAULT_COACH_WITH_REFEREE_MODE;
00204 static const bool DEFAULT_USE_OLD_COACH_HEAR;
00205
00206 static const double DEFAULT_SLOWNESS_ON_TOP_FOR_LEFT_TEAM;
00207 static const double DEFAULT_SLOWNESS_ON_TOP_FOR_RIGHT_TEAM;
00208
00209
00210 static const int DEFAULT_START_GOAL_L;
00211 static const int DEFAULT_START_GOAL_R;
00212
00213 static const bool DEFAULT_FULLSTATE_L;
00214 static const bool DEFAULT_FULLSTATE_R;
00215
00216 static const int DEFAULT_DROP_BALL_TIME;
00217
00218 static const bool DEFAULT_SYNC_MODE;
00219 static const int DEFAULT_SYNC_OFFSET;
00220 static const int DEFAULT_SYNC_MICRO_SLEEP;
00221
00222 static const int DEFAULT_POINT_TO_BAN;
00223 static const int DEFAULT_POINT_TO_DURATION;
00224
00225
00226
00227 static const int DEFAULT_PLAYER_PORT;
00228 static const int DEFAULT_TRAINER_PORT;
00229 static const int DEFAULT_ONLINE_COACH_PORT;
00230
00231 static const bool DEFAULT_VERBOSE_MODE;
00232
00233 static const int DEFAULT_COACH_SEND_VI_STEP;
00234
00235 static const std::string DEFAULT_REPLAY_FILE;
00236 static const std::string DEFAULT_LANDMARK_FILE;
00237
00238 static const int DEFAULT_SEND_COMMS;
00239
00240 static const bool DEFAULT_TEXT_LOGGING;
00241 static const bool DEFAULT_GAME_LOGGING;
00242 static const int DEFAULT_GAME_LOG_VERSION;
00243 static const std::string DEFAULT_TEXT_LOG_DIR;
00244 static const std::string DEFAULT_GAME_LOG_DIR;
00245 static const std::string DEFAULT_TEXT_LOG_FIXED_NAME;
00246 static const std::string DEFAULT_GAME_LOG_FIXED_NAME;
00247 static const bool DEFAULT_USE_TEXT_LOG_FIXED;
00248 static const bool DEFAULT_USE_GAME_LOG_FIXED;
00249 static const bool DEFAULT_USE_TEXT_LOG_DATED;
00250 static const bool DEFAULT_USE_GAME_LOG_DATED;
00251 static const std::string DEFAULT_LOG_DATE_FORMAT;
00252 static const bool DEFAULT_LOG_TIMES;
00253 static const bool DEFAULT_RECORD_MESSAGES;
00254 static const int DEFAULT_TEXT_LOG_COMPRESSION;
00255 static const int DEFAULT_GAME_LOG_COMPRESSION;
00256
00257 static const bool DEFAULT_USE_PROFILE;
00258
00259 static const double DEFAULT_TACKLE_DIST;
00260 static const double DEFAULT_TACKLE_BACK_DIST;
00261 static const double DEFAULT_TACKLE_WIDTH;
00262 static const double DEFAULT_TACKLE_EXPONENT;
00263 static const int DEFAULT_TACKLE_CYCLES;
00264 static const double DEFAULT_TACKLE_POWER_RATE;
00265
00266 static const int DEFAULT_FREEFORM_WAIT_PERIOD;
00267 static const int DEFAULT_FREEFORM_SEND_PERIOD;
00268
00269 static const bool DEFAULT_FREE_KICK_FAULTS;
00270 static const bool DEFAULT_BACK_PASSES;
00271
00272 static const bool DEFAULT_PROPER_GOAL_KICKS;
00273 static const double DEFAULT_STOPPED_BALL_VEL;
00274 static const int DEFAULT_MAX_GOAL_KICKS;
00275
00276 static const int DEFAULT_CLANG_DEL_WIN;
00277 static const int DEFAULT_CLANG_RULE_WIN;
00278
00279 static const bool DEFAULT_AUTO_MODE;
00280 static const int DEFAULT_KICK_OFF_WAIT;
00281 static const int DEFAULT_CONNECT_WAIT;
00282 static const int DEFAULT_GAME_OVER_WAIT;
00283 static const std::string DEFAULT_TEAM_L_START;
00284 static const std::string DEFAULT_TEAM_R_START;
00285
00286 static const bool DEFAULT_KEEPAWAY_MODE;
00287 static const double DEFAULT_KEEPAWAY_LENGTH;
00288 static const double DEFAULT_KEEPAWAY_WIDTH;
00289
00290 static const bool DEFAULT_KEEPAWAY_LOGGING;
00291 static const std::string DEFAULT_KEEPAWAY_LOG_DIR;
00292 static const std::string DEFAULT_KEEPAWAY_LOG_FIXED_NAME;
00293 static const bool DEFAULT_KEEPAWAY_LOG_FIXED;
00294 static const bool DEFAULT_KEEPAWAY_LOG_DATED;
00295
00296 static const int DEFAULT_KEEPAWAY_START;
00297
00298 static const int DEFAULT_NR_NORMAL_HALFS;
00299 static const int DEFAULT_NR_EXTRA_HALFS;
00300 static const bool DEFAULT_PENALTY_SHOOT_OUTS;
00301
00302 static const int DEFAULT_PEN_BEFORE_SETUP_WAIT;
00303 static const int DEFAULT_PEN_SETUP_WAIT;
00304 static const int DEFAULT_PEN_READY_WAIT;
00305 static const int DEFAULT_PEN_TAKEN_WAIT;
00306 static const int DEFAULT_PEN_NR_KICKS;
00307 static const int DEFAULT_PEN_MAX_EXTRA_KICKS;
00308 static const double DEFAULT_PEN_DIST_X;
00309 static const bool DEFAULT_PEN_RANDOM_WINNER;
00310 static const bool DEFAULT_PEN_ALLOW_MULT_KICKS;
00311 static const double DEFAULT_PEN_MAX_GOALIE_DIST_X;
00312 static const bool DEFAULT_PEN_COACH_MOVES_PLAYERS;
00313
00314 static const std::string DEFAULT_MODULE_DIR;
00315
00316 static const double DEFAULT_BALL_STUCK_AREA;
00317
00318 static const bool DEFAULT_ALLOW_MULT_DEFAULT_TYPE;
00319 static const double DEFAULT_MAX_TACKLE_POWER;
00320 static const double DEFAULT_MAX_BACK_TACKLE_POWER;
00321 static const double DEFAULT_EXTRA_STAMINA;
00322
00323 private:
00324
00327
00328
00329
00330 double M_goal_width;
00331 double M_inertia_moment;
00332
00333 double M_player_size;
00334 double M_player_decay;
00335 double M_player_rand;
00336 double M_player_weight;
00337 double M_player_speed_max;
00338 double M_player_accel_max;
00339
00340 double M_stamina_max;
00341 double M_stamina_inc_max;
00342
00343 double M_recover_init;
00344 double M_recover_dec_thr;
00345 double M_recover_min;
00346 double M_recover_dec;
00347
00348 double M_effort_init;
00349 double M_effort_dec_thr;
00350 double M_effort_min;
00351 double M_effort_dec;
00352 double M_effort_inc_thr;
00353 double M_effort_inc;
00354
00355 double M_kick_rand;
00356 bool M_team_actuator_noise;
00357 double M_player_rand_factor_l;
00358 double M_player_rand_factor_r;
00359 double M_kick_rand_factor_l;
00360 double M_kick_rand_factor_r;
00361
00362 double M_ball_size;
00363 double M_ball_decay;
00364 double M_ball_rand;
00365 double M_ball_weight;
00366 double M_ball_speed_max;
00367 double M_ball_accel_max;
00368
00369 double M_dash_power_rate;
00370 double M_kick_power_rate;
00371 double M_kickable_margin;
00372 double M_control_radius;
00373 double M_control_radius_width;
00374
00375 double M_max_power;
00376 double M_min_power;
00377 double M_max_moment;
00378 double M_min_moment;
00379 double M_max_neck_moment;
00380 double M_min_neck_moment;
00381 double M_max_neck_angle;
00382 double M_min_neck_angle;
00383
00384 double M_visible_angle;
00385 double M_visible_distance;
00386
00387 double M_wind_dir;
00388 double M_wind_force;
00389 double M_wind_angle;
00390 double M_wind_rand;
00391
00392 double M_kickable_area;
00393
00394 double M_catch_area_l;
00395 double M_catch_area_w;
00396 double M_catch_probability;
00397 int M_goalie_max_moves;
00398
00399 double M_corner_kick_margin;
00400 double M_offside_active_area_size;
00401
00402 bool M_wind_none;
00403 bool M_use_wind_random;
00404
00405 int M_coach_say_count_max;
00406 int M_coach_say_msg_size;
00407
00408 int M_clang_win_size;
00409 int M_clang_define_win;
00410 int M_clang_meta_win;
00411 int M_clang_advice_win;
00412 int M_clang_info_win;
00413 int M_clang_mess_delay;
00414 int M_clang_mess_per_cycle;
00415
00416 int M_half_time;
00417 int M_simulator_step;
00418 int M_send_step;
00419 int M_recv_step;
00420 int M_sense_body_step;
00421 int M_lcm_step;
00422
00423 int M_player_say_msg_size;
00424 int M_player_hear_max;
00425 int M_player_hear_inc;
00426 int M_player_hear_decay;
00427
00428 int M_catch_ban_cycle;
00429
00430 int M_slow_down_factor;
00431
00432 bool M_use_offside;
00433 bool M_kickoff_offside;
00434 double M_offside_kick_margin;
00435
00436 double M_audio_cut_dist;
00437
00438 double M_dist_quantize_step;
00439 double M_landmark_dist_quantize_step;
00440 double M_dir_quantize_step;
00441 double M_dist_quantize_step_l;
00442 double M_dist_quantize_step_r;
00443 double M_landmark_dist_quantize_step_l;
00444 double M_landmark_dist_quantize_step_r;
00445 double M_dir_quantize_step_l;
00446 double M_dir_quantize_step_r;
00447
00448 bool M_coach_mode;
00449 bool M_coach_with_referee_mode;
00450 bool M_use_old_coach_hear;
00451
00452 double M_slowness_on_top_for_left_team;
00453 double M_slowness_on_top_for_right_team;
00454
00455 int M_start_goal_l;
00456 int M_start_goal_r;
00457
00458 bool M_fullstate_l;
00459 bool M_fullstate_r;
00460
00461 int M_drop_ball_time;
00462
00463
00464
00465
00466 bool M_synch_mode;
00467 int M_synch_offset;
00468 int M_synch_micro_sleep;
00469
00470 int M_point_to_ban;
00471 int M_point_to_duration;
00472
00473
00474
00475 int M_player_port;
00476 int M_trainer_port;
00477 int M_online_coach_port;
00478
00479 bool M_verbose_mode;
00480
00481 int M_coach_send_vi_step;
00482
00483 std::string M_replay_file;
00484 std::string M_landmark_file;
00485
00486 bool M_send_comms;
00487
00488 bool M_text_logging;
00489 bool M_game_logging;
00490 int M_game_log_version;
00491 std::string M_text_log_dir;
00492 std::string M_game_log_dir;
00493 std::string M_text_log_fixed_name;
00494 std::string M_game_log_fixed_name;
00495 bool M_use_text_log_fixed;
00496 bool M_use_game_log_fixed;
00497 bool M_use_text_log_dated;
00498 bool M_use_game_log_dated;
00499 std::string M_log_date_format;
00500 bool M_log_times;
00501 bool M_record_message;
00502 int M_text_log_compression;
00503 int M_game_log_compression;
00504
00505 bool M_use_profile;
00506
00507 double M_tackle_dist;
00508 double M_tackle_back_dist;
00509 double M_tackle_width;
00510 double M_tackle_exponent;
00511 int M_tackle_cycles;
00512 double M_tackle_power_rate;
00513
00514 int M_freeform_wait_period;
00515 int M_freeform_send_period;
00516
00517 bool M_free_kick_faults;
00518 bool M_back_passes;
00519
00520 bool M_proper_goal_kicks;
00521 double M_stopped_ball_vel;
00522 int M_max_goal_kicks;
00523
00524 int M_clang_del_win;
00525 int M_clang_rule_win;
00526
00527
00528
00529
00530
00531 bool M_auto_mode;
00532 int M_kick_off_wait;
00533 int M_connect_wait;
00534 int M_game_over_wait;
00535 std::string M_team_l_start;
00536 std::string M_team_r_start;
00537
00538
00539
00540 bool M_keepaway_mode;
00541 double M_keepaway_length;
00542 double M_keepaway_width;
00543
00544 bool M_keepaway_logging;
00545 std::string M_keepaway_log_dir;
00546 std::string M_keepaway_log_fixed_name;
00547 bool M_keepaway_log_fixed;
00548 bool M_keepaway_log_dated;
00549
00550 int M_keepaway_start;
00551
00552
00553
00554 int M_nr_normal_halfs;
00555 int M_nr_extra_halfs;
00556 bool M_penalty_shoot_outs;
00557
00558 int M_pen_before_setup_wait;
00559 int M_pen_setup_wait;
00560 int M_pen_ready_wait;
00561 int M_pen_taken_wait;
00562 int M_pen_nr_kicks;
00563 int M_pen_max_extra_kicks;
00564 double M_pen_dist_x;
00565 bool M_pen_random_winner;
00566 bool M_pen_allow_mult_kicks;
00567 double M_pen_max_goalie_dist_x;
00568
00569
00570 bool M_pen_coach_moves_players;
00571 std::string M_module_dir;
00572
00573
00574 double M_ball_stuck_area;
00575 std::string M_coach_msg_file;
00576
00577
00578 double M_max_tackle_power;
00579 double M_max_back_tackle_power;
00580 double M_player_speed_max_min;
00581 double M_extra_stamina;
00582 int M_synch_see_offset;
00583
00584
00585 int M_max_monitors;
00586
00587
00588 double M_min_catch_probability;
00589 double M_reliable_catch_area_l;
00590
00591
00592
00593 double M_catchable_area;
00594 double M_real_speed_max;
00595
00596 private:
00600 ServerParam();
00601
00605 void createMap();
00606
00610 void setDefaultParam();
00611
00615 void setAdditionalParam();
00616
00617 public:
00618
00623 static
00624 ServerParam & instance();
00625
00630 inline
00631 static const
00632 ServerParam & i()
00633 {
00634 return instance();
00635 }
00636
00643 bool parse( const char * msg,
00644 const double & version );
00645
00646 private:
00652 bool parseV7( const char * msg );
00653
00654 public:
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00671 void convertFrom( const rcg::server_params_t & from );
00672
00677 void convertTo( rcg::server_params_t & to ) const;
00678
00683 std::string toStr() const;
00684
00685
00686
00687
00688 const
00689 int maxPlayer() const
00690 {
00691 return DEFAULT_MAX_PLAYER;
00692 }
00693 const
00694 double & pitchLength() const
00695 {
00696 return DEFAULT_PITCH_LENGTH;
00697 }
00698 const
00699 double & pitchWidth() const
00700 {
00701 return DEFAULT_PITCH_WIDTH;
00702 }
00703 const
00704 double & pitchMargin() const
00705 {
00706 return DEFAULT_PITCH_MARGIN;
00707 }
00708 const
00709 double & centerCircleR() const
00710 {
00711 return DEFAULT_CENTER_CIRCLE_R;
00712 }
00713 const
00714 double & penaltyAreaLength() const
00715 {
00716 return DEFAULT_PENALTY_AREA_LENGTH;
00717 }
00718 const
00719 double & penaltyAreaWidth() const
00720 {
00721 return DEFAULT_PENALTY_AREA_WIDTH;
00722 }
00723 const
00724 double & goalAreaLength() const
00725 {
00726 return DEFAULT_GOAL_AREA_LENGTH;
00727 }
00728 const
00729 double & goalAreaWidth() const
00730 {
00731 return DEFAULT_GOAL_AREA_WIDTH;
00732 }
00733 const
00734 double & goalDepth() const
00735 {
00736 return DEFAULT_GOAL_DEPTH;
00737 }
00738 const
00739 double & penaltyCircleR() const
00740 {
00741 return DEFAULT_PENALTY_CIRCLE_R;
00742 }
00743 const
00744 double & penaltySpotDist() const
00745 {
00746 return DEFAULT_PENALTY_SPOT_DIST;
00747 }
00748 const
00749 double & cornerArcR() const
00750 {
00751 return DEFAULT_CORNER_ARC_R;
00752 }
00753 const
00754 double & kickOffClearDistance() const
00755 {
00756 return DEFAULT_CENTER_CIRCLE_R;
00757 }
00758 const
00759 double & windWeight() const
00760 {
00761 return DEFAULT_WIND_WEIGHT;
00762 }
00763 const
00764 double & goalPostRadius() const
00765 {
00766 return DEFAULT_GOAL_POST_RADIUS;
00767 }
00768
00769
00770
00771
00772 const
00773 double & goalWidth() const
00774 {
00775 return M_goal_width;
00776 }
00777
00778 const
00779 double & defaultInertiaMoment() const
00780 {
00781 return M_inertia_moment;
00782 }
00783
00784 const
00785 double & defaultPlayerSize() const
00786 {
00787 return M_player_size;
00788 }
00789
00790 const
00791 double & defaultPlayerDecay() const
00792 {
00793 return M_player_decay;
00794 }
00795 const
00796 double & playerRand() const
00797 {
00798 return M_player_rand;
00799 }
00800 const
00801 double & playerWeight() const
00802 {
00803 return M_player_weight;
00804 }
00805
00806 const
00807 double & defaultPlayerSpeedMax() const
00808 {
00809 return M_player_speed_max;
00810 }
00811 const
00812 double & playerAccelMax() const
00813 {
00814 return M_player_accel_max;
00815 }
00816
00817 const
00818 double & staminaMax() const
00819 {
00820 return M_stamina_max;
00821 }
00822
00823 const
00824 double & defaultStaminaIncMax() const
00825 {
00826 return M_stamina_inc_max;
00827 }
00828 const
00829 double & recoverInit() const
00830 {
00831 return M_recover_init;
00832 }
00833 const
00834 double & recoverDecThr() const
00835 {
00836 return M_recover_dec_thr;
00837 }
00838 const
00839 double & recoverMin() const
00840 {
00841 return M_recover_min;
00842 }
00843 const
00844 double & recoverDec() const
00845 {
00846 return M_recover_dec;
00847 }
00848
00849 const
00850 double & effortInit() const
00851 {
00852 return M_effort_init;
00853 }
00854 const
00855 double & effortDecThr() const
00856 {
00857 return M_effort_dec_thr;
00858 }
00859
00860 const
00861 double & defaultEffortMax() const
00862 {
00863 return M_effort_init;
00864 }
00865
00866 const
00867 double & defaultEffortMin() const
00868 {
00869 return M_effort_min;
00870 }
00871 const
00872 double & effortDec() const
00873 {
00874 return M_effort_dec;
00875 }
00876 const
00877 double & effortIncThr() const
00878 {
00879 return M_effort_inc_thr;
00880 }
00881 const
00882 double & effortInc() const
00883 {
00884 return M_effort_inc;
00885 }
00886
00887
00888 const
00889 double & defaultKickRand() const
00890 {
00891 return M_kick_rand;
00892 }
00893 const
00894 bool teamActuatorNoise() const
00895 {
00896 return M_team_actuator_noise;
00897 }
00898 const
00899 double & playerRandFactorLeft() const
00900 {
00901 return M_player_rand_factor_l;
00902 }
00903 const
00904 double & playerRandFactorRight() const
00905 {
00906 return M_player_rand_factor_r;
00907 }
00908 const
00909 double & kickRandFactorLeft() const
00910 {
00911 return M_kick_rand_factor_l;
00912 }
00913 const
00914 double & kickRandFactorRight() const
00915 {
00916 return M_kick_rand_factor_r;
00917 }
00918
00919 const
00920 double & ballSize() const
00921 {
00922 return M_ball_size;
00923 }
00924 const
00925 double & ballDecay() const
00926 {
00927 return M_ball_decay;
00928 }
00929 const
00930 double & ballRand() const
00931 {
00932 return M_ball_rand;
00933 }
00934 const
00935 double & ballWeight() const
00936 {
00937 return M_ball_weight;
00938 }
00939 const
00940 double & ballSpeedMax() const
00941 {
00942 return M_ball_speed_max;
00943 }
00944 const
00945 double & ballAccelMax() const
00946 {
00947 return M_ball_accel_max;
00948 }
00949
00950
00951 const
00952 double & defaultDashPowerRate() const
00953 {
00954 return M_dash_power_rate;
00955 }
00956 const
00957 double & kickPowerRate() const
00958 {
00959 return M_kick_power_rate;
00960 }
00961
00962 const
00963 double & defaultKickableMargin() const
00964 {
00965 return M_kickable_margin;
00966 }
00967 const
00968 double & controlRadius() const
00969 {
00970 return M_control_radius;
00971 }
00972 const
00973 double & controlRadiusWidth() const
00974 {
00975 return M_control_radius_width;
00976 }
00977
00978 const
00979 double & maxPower() const
00980 {
00981 return M_max_power;
00982 }
00983 const
00984 double & minPower() const
00985 {
00986 return M_min_power;
00987 }
00988 const
00989 double & maxMoment() const
00990 {
00991 return M_max_moment;
00992 }
00993 const
00994 double & minMoment() const
00995 {
00996 return M_min_moment;
00997 }
00998 const
00999 double & maxNeckMoment() const
01000 {
01001 return M_max_neck_moment;
01002 }
01003 const
01004 double & minNeckMoment() const
01005 {
01006 return M_min_neck_moment;
01007 }
01008 const
01009 double & maxNeckAngle() const
01010 {
01011 return M_max_neck_angle;
01012 }
01013 const
01014 double & minNeckAngle() const
01015 {
01016 return M_min_neck_angle;
01017 }
01018
01019 const
01020 double & visibleAngle() const
01021 {
01022 return M_visible_angle;
01023 }
01024 const
01025 double & visibleDistance() const
01026 {
01027 return M_visible_distance;
01028 }
01029
01030 const
01031 double & windDir() const
01032 {
01033 return M_wind_dir;
01034 }
01035 const
01036 double & windForce() const
01037 {
01038 return M_wind_force;
01039 }
01040 const
01041 double & windAngle() const
01042 {
01043 return M_wind_angle;
01044 }
01045 const
01046 double & windRand() const
01047 {
01048 return M_wind_rand;
01049 }
01050
01051 const
01052 double & defaultKickableArea() const
01053 {
01054 return M_kickable_area;
01055 }
01056
01057 const
01058 double & catchAreaLength() const
01059 {
01060 return M_catch_area_l;
01061 }
01062 const
01063 double & catchAreaWidth() const
01064 {
01065 return M_catch_area_w;
01066 }
01067 const
01068 double & catchProbability() const
01069 {
01070 return M_catch_probability;
01071 }
01072 const
01073 int goalieMaxMoves() const
01074 {
01075 return M_goalie_max_moves;
01076 }
01077
01078 const
01079 double & cornerKickMargin() const
01080 {
01081 return M_corner_kick_margin;
01082 }
01083 const
01084 double & offsideActiveAreaSize() const
01085 {
01086 return M_offside_active_area_size;
01087 }
01088
01089 const
01090 bool windNone() const
01091 {
01092 return M_wind_none;
01093 }
01094 const
01095 bool useWindRandom() const
01096 {
01097 return M_use_wind_random;
01098 }
01099
01100 const
01101 int coachSayCountMax() const
01102 {
01103 return M_coach_say_count_max;
01104 }
01105 const
01106 int coachSayMsgSize() const
01107 {
01108 return M_coach_say_msg_size;
01109 }
01110
01111 const
01112 int clangWinSize() const
01113 {
01114 return M_clang_win_size;
01115 }
01116 const
01117 int clangDefineWin() const
01118 {
01119 return M_clang_define_win;
01120 }
01121 const
01122 int clangMetaWin() const
01123 {
01124 return M_clang_meta_win;
01125 }
01126 const
01127 int clangAdviceWin() const
01128 {
01129 return M_clang_advice_win;
01130 }
01131 const
01132 int clangInfoWin() const
01133 {
01134 return M_clang_info_win;
01135 }
01136 const
01137 int clangMessDelay() const
01138 {
01139 return M_clang_mess_delay;
01140 }
01141 const
01142 int clangMessPerCycle() const
01143 {
01144 return M_clang_mess_per_cycle;
01145 }
01146
01147 const
01148 int halfTime() const
01149 {
01150 return M_half_time;
01151 }
01152 const
01153 int simulatorStep() const
01154 {
01155 return M_simulator_step;
01156 }
01157 const
01158 int sendStep() const
01159 {
01160 return M_send_step;
01161 }
01162
01163 const
01164 int recvStep() const
01165 {
01166 return M_recv_step;
01167 }
01168 const
01169 int senseBodyStep() const
01170 {
01171 return M_sense_body_step;
01172 }
01173 const
01174 int lcmStep() const
01175 {
01176 return M_lcm_step;
01177 }
01178
01179 const
01180 int playerSayMsgSize() const
01181 {
01182 return M_player_say_msg_size;
01183 }
01184 const
01185 int playerHearMax() const
01186 {
01187 return M_player_hear_max;
01188 }
01189 const
01190 int playerHearInc() const
01191 {
01192 return M_player_hear_inc;
01193 }
01194 const
01195 int playerHearDecay() const
01196 {
01197 return M_player_hear_decay;
01198 }
01199
01200 const
01201 int catchBanCycle() const
01202 {
01203 return M_catch_ban_cycle;
01204 }
01205
01206 const
01207 int slowDownFactor() const
01208 {
01209 return M_slow_down_factor;
01210 }
01211
01212 const
01213 bool useOffside() const
01214 {
01215 return M_use_offside;
01216 }
01217 const
01218 bool kickoffOffside() const
01219 {
01220 return M_kickoff_offside;
01221 }
01222 const
01223 double & offsideKickMargin() const
01224 {
01225 return M_offside_kick_margin;
01226 }
01227
01228 const
01229 double & audioCutDist() const
01230 {
01231 return M_audio_cut_dist;
01232 }
01233
01234 const
01235 double & distQuantizeStep() const
01236 {
01237 return M_dist_quantize_step;
01238 }
01239 const
01240 double & landmarkDistQuantizeStep() const
01241 {
01242 return M_landmark_dist_quantize_step;
01243 }
01244 const
01245 double & dirQuantizeStep() const
01246 {
01247 return M_dir_quantize_step;
01248 }
01249 const
01250 double & distQuantizeSteqLeft() const
01251 {
01252 return M_dist_quantize_step_l;
01253 }
01254 const
01255 double & distQuantizeStepRight() const
01256 {
01257 return M_dist_quantize_step_r;
01258 }
01259 const
01260 double & landmarkDistQuantizeStepLeft() const
01261 {
01262 return M_landmark_dist_quantize_step_l;
01263 }
01264 const
01265 double & landmarkDistQuantizeStepRight() const
01266 {
01267 return M_landmark_dist_quantize_step_r;
01268 }
01269 const
01270 double & dirQuantizeStepLeft() const
01271 {
01272 return M_dir_quantize_step_l;
01273 }
01274 const
01275 double & dirQuantizeStepRight() const
01276 {
01277 return M_dir_quantize_step_r;
01278 }
01279
01280 const
01281 bool coachMode() const
01282 {
01283 return M_coach_mode;
01284 }
01285 const
01286 bool coachWithRefereeMode() const
01287 {
01288 return M_coach_with_referee_mode;
01289 }
01290 const
01291 bool useOldCoachHear() const
01292 {
01293 return M_use_old_coach_hear;
01294 }
01295
01296 const
01297 double & slownessOnTopForLeft() const
01298 {
01299 return M_slowness_on_top_for_left_team;
01300 }
01301 const
01302 double & slownessOnTopForRight() const
01303 {
01304 return M_slowness_on_top_for_right_team;
01305 }
01306
01307 const
01308 int startGoalLeft() const
01309 {
01310 return M_start_goal_l;
01311 }
01312 const
01313 int stargGoalRight() const
01314 {
01315 return M_start_goal_r;
01316 }
01317
01318 const
01319 bool fullstateLeft() const
01320 {
01321 return M_fullstate_l;
01322 }
01323 const
01324 bool fullstateRight() const
01325 {
01326 return M_fullstate_r;
01327 }
01328
01329 const
01330 int dropBallTime() const
01331 {
01332 return M_drop_ball_time;
01333 }
01334
01335 const
01336 bool synchMode() const
01337 {
01338 return M_synch_mode;
01339 }
01340 const
01341 int synchOffset() const
01342 {
01343 return M_synch_offset;
01344 }
01345 const
01346 int synchMicroSleep() const
01347 {
01348 return M_synch_micro_sleep;
01349 }
01350
01351 const
01352 int pointToBan() const
01353 {
01354 return M_point_to_ban;
01355 }
01356 const
01357 int pointToDuration() const
01358 {
01359 return M_point_to_duration;
01360 }
01361
01362
01363
01364
01365 const
01366 int playerPort() const
01367 {
01368 return M_player_port;
01369 }
01370 const
01371 int trainerPort() const
01372 {
01373 return M_trainer_port;
01374 }
01375 const
01376 int onlineCoachPort() const
01377 {
01378 return M_online_coach_port;
01379 }
01380
01381 const
01382 bool verboseMode() const
01383 {
01384 return M_verbose_mode;
01385 }
01386
01387 const
01388 int coachSendVIStep() const
01389 {
01390 return M_coach_send_vi_step;
01391 }
01392
01393 const
01394 std::string & replayFile() const
01395 {
01396 return M_replay_file;
01397 }
01398 const
01399 std::string & landmarkFile() const
01400 {
01401 return M_landmark_file;
01402 }
01403
01404 const
01405 bool sendComms() const
01406 {
01407 return M_send_comms;
01408 }
01409
01410 const
01411 bool textLogging() const
01412 {
01413 return M_text_logging;
01414 }
01415 const
01416 bool gameLogging() const
01417 {
01418 return M_game_logging;
01419 }
01420 const
01421 int gameLogVersion() const
01422 {
01423 return M_game_log_version;
01424 }
01425 const
01426 std::string & textLogDir() const
01427 {
01428 return M_text_log_dir;
01429 }
01430 const
01431 std::string & gameLogDir() const
01432 {
01433 return M_game_log_dir;
01434 }
01435 const
01436 std::string & textLogFixedName() const
01437 {
01438 return M_text_log_fixed_name;
01439 }
01440 const
01441 std::string & gameLogFixedName() const
01442 {
01443 return M_game_log_fixed_name;
01444 }
01445 const
01446 bool textLogFixed() const
01447 {
01448 return M_use_text_log_fixed;
01449 }
01450 const
01451 bool gameLogFixed() const
01452 {
01453 return M_use_game_log_fixed;
01454 }
01455 const
01456 bool textLogDated() const
01457 {
01458 return M_use_text_log_dated;
01459 }
01460 const
01461 bool gameLogDated() const
01462 {
01463 return M_use_game_log_dated;
01464 }
01465 const
01466 std::string & logDateFormat() const
01467 {
01468 return M_log_date_format;
01469 }
01470 const
01471 bool logTimes() const
01472 {
01473 return M_log_times;
01474 }
01475 const
01476 bool recordMessage() const
01477 {
01478 return M_record_message;
01479 }
01480 const
01481 int textLogCompression() const
01482 {
01483 return M_text_log_compression;
01484 }
01485 const
01486 int gameLogCompression() const
01487 {
01488 return M_game_log_compression;
01489 }
01490
01491 const
01492 bool useProfile() const
01493 {
01494 return M_use_profile;
01495 }
01496
01497 const
01498 double & tackleDist() const
01499 {
01500 return M_tackle_dist;
01501 }
01502 const
01503 double & tackleBackDist() const
01504 {
01505 return M_tackle_back_dist;
01506 }
01507 const
01508 double & tackleWidth() const
01509 {
01510 return M_tackle_width;
01511 }
01512 const
01513 double & tackleExponent() const
01514 {
01515 return M_tackle_exponent;
01516 }
01517 const
01518 int tackleCycles() const
01519 {
01520 return M_tackle_cycles;
01521 }
01522 const
01523 double & tacklePowerRate() const
01524 {
01525 return M_tackle_power_rate;
01526 }
01527
01528 const
01529 int freeformWaitPeriod() const
01530 {
01531 return M_freeform_wait_period;
01532 }
01533 const
01534 int freeformSendPeriod() const
01535 {
01536 return M_freeform_send_period;
01537 }
01538
01539 const
01540 bool freeKickFaults() const
01541 {
01542 return M_free_kick_faults;
01543 }
01544 const
01545 bool backPasses() const
01546 {
01547 return M_back_passes;
01548 }
01549
01550 const
01551 bool properGoalKicks() const
01552 {
01553 return M_proper_goal_kicks;
01554 }
01555 const
01556 double & stoppedBallVel() const
01557 {
01558 return M_stopped_ball_vel;
01559 }
01560 const
01561 int maxGoalKicks() const
01562 {
01563 return M_max_goal_kicks;
01564 }
01565
01566 const
01567 bool autoMode() const
01568 {
01569 return M_auto_mode;
01570 }
01571 const
01572 int kickOffWait() const
01573 {
01574 return M_kick_off_wait;
01575 }
01576 const
01577 int connectWait() const
01578 {
01579 return M_connect_wait;
01580 }
01581 const
01582 int gameOverWait() const
01583 {
01584 return M_game_over_wait;
01585 }
01586 const
01587 std::string & teamLeftStartCommand() const
01588 {
01589 return M_team_l_start;
01590 }
01591 const
01592 std::string & teamRightStartCommand() const
01593 {
01594 return M_team_r_start;
01595 }
01596
01597 const
01598 bool keepawayMode() const
01599 {
01600 return M_keepaway_mode;
01601 }
01602 const
01603 double & keepawayLength() const
01604 {
01605 return M_keepaway_length;
01606 }
01607 const
01608 double & keepawayWidth() const
01609 {
01610 return M_keepaway_width;
01611 }
01612
01613 const
01614 bool keepawayLogging() const
01615 {
01616 return M_keepaway_logging;
01617 }
01618 const
01619 std::string & keepawayLogDir() const
01620 {
01621 return M_keepaway_log_dir;
01622 }
01623 const
01624 std::string & keepawayLogFixedName() const
01625 {
01626 return M_keepaway_log_fixed_name;
01627 }
01628 const
01629 bool keepawayLogFixed() const
01630 {
01631 return M_keepaway_log_fixed;
01632 }
01633 const
01634 bool keepawayLogDated() const
01635 {
01636 return M_keepaway_log_dated;
01637 }
01638
01639 const
01640 int keepawayStart() const
01641 {
01642 return M_keepaway_start;
01643 }
01644
01645 const
01646 int nrNormalHalfs() const
01647 {
01648 return M_nr_normal_halfs;
01649 }
01650 const
01651 int nrExtraHalfs() const
01652 {
01653 return M_nr_extra_halfs;
01654 }
01655 const
01656 bool penaltyShootOuts() const
01657 {
01658 return M_penalty_shoot_outs;
01659 }
01660
01661 const
01662 int penBeforeSetupWait() const
01663 {
01664 return M_pen_before_setup_wait;
01665 }
01666 const
01667 int penSetupWait() const
01668 {
01669 return M_pen_setup_wait;
01670 }
01671 const
01672 int penReadyWait() const
01673 {
01674 return M_pen_ready_wait;
01675 }
01676 const
01677 int penTakenWait() const
01678 {
01679 return M_pen_taken_wait;
01680 }
01681 const
01682 int penNrKicks() const
01683 {
01684 return M_pen_nr_kicks;
01685 }
01686 const
01687 int penMaxExtraKicks() const
01688 {
01689 return M_pen_max_extra_kicks;
01690 }
01691 const
01692 double & penDistX() const
01693 {
01694 return M_pen_dist_x;
01695 }
01696 const
01697 bool penRandomWinner() const
01698 {
01699 return M_pen_random_winner;
01700 }
01701 const
01702 bool penAllowMultKicks() const
01703 {
01704 return M_pen_allow_mult_kicks;
01705 }
01706 const
01707 double & penMaxGoalieDistX() const
01708 {
01709 return M_pen_max_goalie_dist_x;
01710 }
01711 const
01712 bool penCoachMovesPlayers() const
01713 {
01714 return M_pen_coach_moves_players;
01715 }
01716
01717 const
01718 std::string & moduleDir() const
01719 {
01720 return M_module_dir;
01721 }
01722
01723
01724
01725 const
01726 double & ballStuckArea() const
01727 {
01728 return M_ball_stuck_area;
01729 }
01730 const
01731 std::string & coachMsgFile() const
01732 {
01733 return M_coach_msg_file;
01734 }
01735
01736
01737
01738 const
01739 double & maxTacklePower() const
01740 {
01741 return M_max_tackle_power;
01742 }
01743 const
01744 double & maxBackTacklePower() const
01745 {
01746 return M_max_back_tackle_power;
01747 }
01748 const
01749 double & playerSpeedMaxMin() const
01750 {
01751 return M_player_speed_max_min;
01752 }
01753 const
01754 double & defaultExtraStamina() const
01755 {
01756 return M_extra_stamina;
01757 }
01758
01759 int synchSeeOffset() const
01760 {
01761 return M_synch_see_offset;
01762 }
01763
01764 int maxMonitors() const
01765 {
01766 return M_max_monitors;
01767 }
01768
01769
01770
01771
01772 double pitchHalfLength() const
01773 {
01774 return pitchLength() * 0.5;
01775 }
01776
01777 double pitchHalfWidth() const
01778 {
01779 return pitchWidth() * 0.5;
01780 }
01781
01782 double penaltyAreaHalfWidth() const
01783 {
01784 return penaltyAreaWidth() * 0.5;
01785 }
01786
01787 double goalAreaHalfWidth() const
01788 {
01789 return goalAreaWidth() * 0.5;
01790 }
01791
01792 double goalHalfWidth() const
01793 {
01794 return goalWidth() * 0.5;
01795 }
01796
01797 double ourTeamGoalLineX() const
01798 {
01799 return - pitchHalfLength();
01800 }
01801
01802 double theirTeamGoalLineX() const
01803 {
01804 return + pitchHalfLength();
01805 }
01806
01807 Vector2D ourTeamGoalPos() const
01808 {
01809 return Vector2D( - pitchHalfLength(), 0.0 );
01810 }
01811
01812 Vector2D theirTeamGoalPos() const
01813 {
01814 return Vector2D( + pitchHalfLength(), 0.0 );
01815 }
01816
01817 double ourPenaltyAreaLineX() const
01818 {
01819 return -pitchHalfLength() + penaltyAreaLength();
01820 }
01821
01822 double theirPenaltyAreaLineX() const
01823 {
01824 return pitchHalfLength() - penaltyAreaLength();
01825 }
01826
01827 const
01828 double & defaultRealSpeedMax() const
01829 {
01830 return M_real_speed_max;
01831 }
01832
01833 double recoverDecThrValue() const
01834 {
01835 return recoverDecThr() * staminaMax();
01836 }
01837
01838 double effortDecThrValue() const
01839 {
01840 return effortDecThr() * staminaMax();
01841 }
01842
01843 double effortIncThrValue() const
01844 {
01845 return effortIncThr() * staminaMax();
01846 }
01847
01848
01849 const
01850 double & catchableArea() const
01851 {
01852 return M_catchable_area;
01853 }
01854
01855
01856
01862 const
01863 double & normalizePower( const double & power ) const
01864 {
01865 if ( power < minPower() ) return minPower();
01866 else if ( power > maxPower() ) return maxPower();
01867 return power;
01868 }
01874 const
01875 double & normalizeMoment( const double & moment ) const
01876 {
01877 if ( moment < minMoment() ) return minMoment();
01878 else if ( moment > maxMoment() ) return maxMoment();
01879 return moment;
01880 }
01886 const
01887 double & normalizeNeckMoment( const double & moment ) const
01888 {
01889 if ( moment < minNeckMoment() ) return minNeckMoment();
01890 else if ( moment > maxNeckMoment() ) return maxNeckMoment();
01891 return moment;
01892 }
01898 const
01899 double & normalizeNeckAngle( const double & neck_angle ) const
01900 {
01901 if ( neck_angle < minNeckAngle() ) return minNeckAngle();
01902 else if ( neck_angle > maxNeckAngle() ) return maxNeckAngle();
01903 return neck_angle;
01904 }
01905
01906 };
01907
01908 }
01909
01910 #endif