serverparam.h
来自「2009 ROBOCUP 仿真2DSERVER 源码」· C头文件 代码 · 共 995 行 · 第 1/3 页
H
995 行
/* -*- Mode: C++ -*- *//* *Copyright: Copyright (C) 1996-2000 Electrotechnical Laboratory. Itsuki Noda, Yasuo Kuniyoshi and Hitoshi Matsubara. Copyright (C) 2000, 2001 RoboCup Soccer Server Maintainance Group. Patrick Riley, Tom Howard, Daniel Polani, Itsuki Noda, Mikhail Prokopenko, Jan Wendler This file is a part of SoccerServer. This code is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *EndCopyright: */#ifndef SERVER_PARAM_H#define SERVER_PARAM_H#include "utility.h"#include "types.h"#include <rcssbase/net/udpsocket.hpp>#include <boost/shared_ptr.hpp>#include <map>#include <cmath>namespace rcss {namespace conf {class Parser;class Builder;class StreamStatusHandler;}}class ServerParam {public: typedef std::map< std::string, unsigned int > VerMap;private: static bool S_in_init; static std::string S_program_name; boost::shared_ptr< rcss::conf::Builder > M_builder; boost::shared_ptr< rcss::conf::Parser > M_conf_parser; boost::shared_ptr< rcss::conf::StreamStatusHandler > M_err_handler; VerMap M_ver_map;private: ServerParam(); // not used ServerParam( const ServerParam & ); // not used ServerParam & operator=( const ServerParam & ); // not usedprotected: explicit ServerParam ( const std::string & progname );public: static ServerParam & instance(); static bool init( const int & argc, const char * const * argv ); virtual ~ServerParam(); void clear();private: void convertOldConf( const std::string & new_conf ); void setDefaults(); void addParams(); template< typename P > void addParam( const std::string & name, P & param, const std::string & desc, int version ); template< typename S, typename G > void addParam( const std::string & name, const S & setter, const G & getter, const std::string & desc, int version ); // default values static const int DEFAULT_PORT_NUMBER; static const int COACH_PORT_NUMBER; static const int OLCOACH_PORT_NUMBER; static const int SIMULATOR_STEP_INTERVAL_MSEC; /* milli-sec */ static const int UDP_RECV_STEP_INTERVAL_MSEC; /* milli-sec */ static const int UDP_SEND_STEP_INTERVAL_MSEC; /* milli-sec */ static const int SENSE_BODY_INTERVAL_MSEC; /* milli-sec */ static const int SEND_VISUALINFO_INTERVAL_MSEC; /* milli-sec */ static const int HALF_TIME; static const int DROP_TIME;public: static const double PITCH_LENGTH; static const double PITCH_WIDTH; static const double PITCH_MARGIN; static const double CENTER_CIRCLE_R; static const double PENALTY_AREA_LENGTH; static const double PENALTY_AREA_WIDTH; static const double GOAL_AREA_LENGTH; static const double GOAL_AREA_WIDTH; static const double GOAL_WIDTH; static const double GOAL_DEPTH; static const double PENALTY_SPOT_DIST; static const double CORNER_ARC_R; static const double KICK_OFF_CLEAR_DISTANCE; static const double CORNER_KICK_MARGIN;private: static const double KEEPAWAY_LENGTH; static const double KEEPAWAY_WIDTH; static const double BALL_SIZE; static const double BALL_DECAY; static const double BALL_RAND; static const double BALL_WEIGHT; static const double BALL_T_VEL; static const double BALL_SPEED_MAX; // th 6.3.00 static const double BALL_ACCEL_MAX; static const double PLAYER_SIZE; static const double PLAYER_WIDGET_SIZE; static const double PLAYER_DECAY; static const double PLAYER_RAND; static const double PLAYER_WEIGHT; static const double PLAYER_SPEED_MAX; // th 6.3.00 static const double PLAYER_ACCEL_MAX; // static const double IMPARAM; /* Inertia-Moment Parameter */ static const double STAMINA_MAX; static const double STAMINA_INC_MAX; static const double RECOVERY_DEC_THR; static const double RECOVERY_DEC; static const double RECOVERY_MIN; static const double EFFORT_DEC_THR; static const double EFFORT_DEC; static const double EFFORT_MIN; static const double EFFORT_INC_THR; static const double EFFORT_INC; static const double KICK_RAND; static const double PRAND_FACTOR_L; static const double PRAND_FACTOR_R; static const double KICK_RAND_FACTOR_L; static const double KICK_RAND_FACTOR_R; static const double GOALIE_CATCHABLE_POSSIBILITY; static const double GOALIE_CATCHABLE_AREA_LENGTH; static const double GOALIE_CATCHABLE_AREA_WIDTH; static const int GOALIE_CATCH_BAN_CYCLE; static const int GOALIE_MAX_MOVES; static const double VISIBLE_ANGLE; static const double VISIBLE_DISTANCE; static const double AUDIO_CUT_OFF_DIST; static const double DASHPOWERRATE; static const double KICKPOWERRATE; static const double MAXPOWER; static const double MINPOWER; static const double KICKABLE_MARGIN; static const double CONTROL_RADIUS; static const double DIST_QSTEP; static const double LAND_QSTEP; static const double DIR_QSTEP; static const double MAXMOMENT; static const double MINMOMENT; static const double MAX_NECK_MOMENT; static const double MIN_NECK_MOMENT; static const double MAX_NECK_ANGLE; static const double MIN_NECK_ANGLE; static const int DEF_SAY_COACH_MSG_SIZE; static const int DEF_SAY_COACH_CNT_MAX; static const double WIND_DIR; static const double WIND_FORCE; static const double WIND_RAND; static const double WIND_WEIGHT; static const double OFFSIDE_ACTIVE_AREA_SIZE; static const double OFFSIDE_KICK_MARGIN; static const std::string LANDMARK_FILE; static const std::string CONF_DIR; static const std::string SERVER_CONF; static const std::string OLD_SERVER_CONF; static const int SEND_COMMS; static const int TEXT_LOGGING; static const int GAME_LOGGING; static const int GAME_LOG_VERSION; static const std::string TEXT_LOG_DIR; static const std::string GAME_LOG_DIR; static const std::string TEXT_LOG_FIXED_NAME; static const std::string GAME_LOG_FIXED_NAME; static const int TEXT_LOG_FIXED; static const int GAME_LOG_FIXED; static const int TEXT_LOG_DATED; static const int GAME_LOG_DATED; static const std::string LOG_DATE_FORMAT; static const int LOG_TIMES; static const int RECORD_MESSAGES; static const int TEXT_LOG_COMPRESSION; static const int GAME_LOG_COMPRESSION; static const bool PROFILE; static const int KAWAY_LOGGING; static const std::string KAWAY_LOG_DIR; static const std::string KAWAY_LOG_FIXED_NAME; static const int KAWAY_LOG_FIXED; static const int KAWAY_LOG_DATED; static const int KAWAY_START; static const int POINT_TO_BAN; static const int POINT_TO_DURATION; static const unsigned int SAY_MSG_SIZE; static const unsigned int HEAR_MAX; static const unsigned int HEAR_INC; static const unsigned int HEAR_DECAY; static const double TACKLE_DIST; static const double TACKLE_BACK_DIST; static const double TACKLE_WIDTH; static const double TACKLE_EXPONENT; static const unsigned int TACKLE_CYCLES; static const double TACKLE_POWER_RATE; static const int NR_NORMAL_HALFS; static const int NR_EXTRA_HALFS; static const bool PENALTY_SHOOT_OUTS; static const int PEN_BEFORE_SETUP_WAIT; static const int PEN_SETUP_WAIT; static const int PEN_READY_WAIT; static const int PEN_TAKEN_WAIT; static const int PEN_NR_KICKS; static const int PEN_MAX_EXTRA_KICKS; static const bool PEN_RANDOM_WINNER; static const double PEN_DIST_X; static const double PEN_MAX_GOALIE_DIST_X; static const bool PEN_ALLOW_MULT_KICKS; static const bool PEN_COACH_MOVES_PLAYERS; static const unsigned int FREEFORM_WAIT_PERIOD; static const unsigned int FREEFORM_SEND_PERIOD; static const bool FREE_KICK_FAULTS; static const bool BACK_PASSES; static const bool PROPER_GOAL_KICKS; static const double STOPPED_BALL_VEL; static const int MAX_GOAL_KICKS; static const int CLANG_DEL_WIN; static const int CLANG_RULE_WIN; static const bool S_AUTO_MODE; static const int S_KICK_OFF_WAIT; static const int S_CONNECT_WAIT; static const int S_GAME_OVER_WAIT; static const std::string S_TEAM_L_START; static const std::string S_TEAM_R_START; //static const char S_MODULE_DIR[]; // 11.0.0 static const double BALL_STUCK_AREA; // 12.0.0 static const double MAX_TACKLE_POWER; static const double MAX_BACK_TACKLE_POWER; static const double PLAYER_SPEED_MAX_MIN; static const double EXTRA_STAMINA; static const int SYNCH_SEE_OFFSET; // 12.1.3 static const int EXTRA_HALF_TIME; // 13.0.0 static const double STAMINA_CAPACITY; static const double MAX_DASH_ANGLE; static const double MIN_DASH_ANGLE; static const double DASH_ANGLE_STEP; static const double SIDE_DASH_RATE; static const double BACK_DASH_RATE; static const double MAX_DASH_POWER; static const double MIN_DASH_POWER; double M_goal_width; /* goal width */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?