Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ServerSettings.C

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2000-2002, Jelle Kok, University of Amsterdam
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without 
00006 modification, are permitted provided that the following conditions are met:
00007 
00008 1. Redistributions of source code must retain the above copyright notice, this 
00009 list of conditions and the following disclaimer. 
00010 
00011 2. Redistributions in binary form must reproduce the above copyright notice, 
00012 this list of conditions and the following disclaimer in the documentation 
00013 and/or other materials provided with the distribution. 
00014 
00015 3. Neither the name of the University of Amsterdam nor the names of its 
00016 contributors may be used to endorse or promote products derived from this 
00017 software without specific prior written permission. 
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
00020 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
00021 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
00022 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 
00023 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
00024 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
00025 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
00026 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
00027 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00028 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 */
00054 #include "ServerSettings.h"
00055 #include <stdio.h>
00056 #include <string.h>           // needed for 'strcpy'
00057 
00058 /******************************************************************************/
00059 /********************   CLASS SERVERSETTINGS   ********************************/
00060 /******************************************************************************/
00061 
00067 ServerSettings::ServerSettings( ):GenericValues( "ServerSettings", 109 )
00068 {
00069   // goal-related parameters
00070   dGoalWidth         = 14.02; // goal_width: the width of the goal
00071 
00072   // player-related parameters
00073   dPlayerSize        = 0.3;   // player_size: the size (=radius) of a player
00074   dPlayerDecay       = 0.4;   // player_decay: player speed decay per cycle
00075   dPlayerRand        = 0.1;   // player_rand: random error in player movement
00076   dPlayerWeight      = 60.0;  // player_weight: weight of a player (for wind)
00077   dPlayerSpeedMax    = 1.2;   // player_speed_max: maximum speed of a player
00078   dPlayerAccelMax    = 1.0;   // player_accel_max: maximum acceleration of a
00079                               // player per cycle
00080 
00081   // stamina-related parameters
00082   dStaminaMax        = 4000.0;// stamina_max: maximum stamina of a player
00083   dStaminaIncMax     = 45.0;  // stamina_inc_max: maximum stamina increase of a
00084                               // player per cycle
00085   dRecoverDecThr     = 0.3;   // recover_dec_thr: percentage of stamina_max
00086                               // below which player recovery decreases
00087   dRecoverDec        = 0.002; // recover_dec: decrement step per cycle for
00088                               // player recovery
00089   dRecoverMin        = 0.5;   // recover_min: minimum player recovery
00090   dEffortDecThr      = 0.3;   // effort_dec_thr: percentage of stamina_max below
00091                               // which player effort capacity decreases
00092   dEffortDec         = 0.005; // effort_dec: decrement step per cycle for
00093                               // player effort capacity
00094   dEffortIncThr      = 0.6;   // effort_incr_thr: percentage of stamina_max
00095                               // above which player effort capacity increases
00096   dEffortInc         = 0.01;  // effort_inc: increment step per cycle for
00097                               // player effort capacity
00098   dEffortMin         = 0.6;   // effort_min: minimum value for player effort
00099 
00100   // parameters related to auditory perception
00101   iHearMax           = 2;     // hear_max: maximum hearing capacity of a player;
00102                               // a player can hear hear_inc messages in
00103                               // hear_decay simulation cycles
00104   iHearInc           = 1;     // hear_inc: minimum hearing capacity of a player,
00105                               // i.e. the number of messages a player can hear
00106                               // in hear_decay simulation cycles
00107   iHearDecay         = 2;     // hear_decay: decay rate of player hearing
00108                               // capacity, i.e. minimum number of cycles for
00109                               // hear_inc messages
00110 
00111   // parameters related to player turn actions
00112   dInertiaMoment     = 5.0;   // inertia_moment: inertia moment of a player;
00113                               // affects actual turn angle depending on speed
00114 
00115   // parameters related to sense_body information
00116   iSenseBodyStep     = 100;   // sense_body_step: length of the interval (in ms)
00117                               // between sense_body information messages
00118 
00119   // goalkeeper-related parameters
00120   dCatchableAreaL    = 2.0;   // catchable_area_l: length of area around
00121                               // goalkeeper in which he can catch the ball
00122   dCatchableAreaW    = 1.0;   // catchable_area_w: width of area around
00123                               // goalkeeper in which he can catch the ball
00124   dCatchProbability  = 1.0;   // catch_probability: the probability for a
00125                               // goalkeeper to catch the ball
00126   iCatchBanCycle     = 5 ;    // catch_ban_cycle: number of cycles after catch
00127                               // in which goalkeeper cannot catch again
00128   iGoalieMaxMoves    = 2;     // goalie_max_moves: maximum number of 'move'
00129                               // actions allowed for goalkeeper after catch
00130 
00131   // ball-related parameters
00132   dBallSize          = 0.085; // ball_size: the size (=radius) of the ball
00133   dBallDecay         = 0.94;  // ball_decay: ball speed decay per cycle
00134   dBallRand          = 0.05;  // ball_rand: random error in ball movement
00135   dBallWeight        = 0.2;   // ball_weight: weight of the ball (for wind)
00136   dBallSpeedMax      = 2.7;   // ball_speed_max: maximum speed of the ball
00137   dBallAccelMax      = 2.7;   // ball_accel_max: maximum acceleration of the
00138                               // ball per cycle
00139 
00140   // wind-related parameters
00141   dWindForce         = 0.0;   // wind_force: the force of the wind
00142   dWindDir           = 0.0;   // wind_dir: the direction of the wind
00143   dWindRand          = 0.0;   // wind_rand: random error in wind direction
00144   bWindRandom        = false; // wind_random: is wind force and direction random
00145 
00146   // parameters related to 'dash' and 'kick' commands
00147   dKickableMargin    = 0.7;   // kickable_margin: margin around player in which
00148                               // ball is kickable; kickable area thus equals
00149                               // kickable_margin + ball_size + player_size
00150   dCkickMargin       = 1.0;   // ckick_margin: corner kick margin, i.e. the
00151                               // minimum distance to the ball for offending
00152                               // players when a corner kick is taken
00153 
00154   dDashPowerRate     = 0.006; // dash_power_rate: rate by which the 'Power'
00155                               // argument in a 'dash' command is multiplied
00156                               // (thus determining the amount of displacement of
00157                               // the player as a result of the 'dash')
00158   dKickPowerRate     = 0.027; // kick_power_rate: rate by which the 'Power'
00159                               // argument in a 'kick' command is multiplied
00160                               // (thus determining the amount of displacement of
00161                               // the ball as a result of the 'kick')
00162   dKickRand          = 0.0;   // kick_rand: random error in kick direction
00163 
00164   // parameters related to visual and auditory perception range
00165   dVisibleAngle      = 90.0;  // visible_angle: angle of the view cone of a
00166                               // player in the standard view mode
00167   dAudioCutDist      = 50.0;  // audio_cut_dist: maximum distance over which a
00168                               // spoken message can be heard
00169 
00170   // quantization parameters
00171   dQuantizeStep      = 0.1;   // quantize_step: quantization step for distance
00172                               // of moving objects
00173   dQuantizeStepL     = 0.01;  // quantize_step_l: quantization step for distance
00174                               // of landmarks
00175 
00176   // range parameters for basic actuator commands
00177   iMaxPower          = 100;   // maxpower: maximum power for dash/kick
00178   iMinPower          = -100;  // minpower: minimum power for dash/kick
00179   iMaxMoment         = 180;   // maxmoment: maximum angle for turn/kick
00180   iMinMoment         = -180;  // minmoment: minimum angle for turn/kick
00181   iMaxNeckMoment     = 180;   // maxneckmoment: maximum angle for turnneck
00182   iMinNeckMoment     = -180;  // minneckmoment: minimum angle for turnneck
00183   iMaxNeckAng        = 90;    // maxneckang: maximum neck angle relative to body
00184   iMinNeckAng        = -90;   // minneckang: minimum neck angle relative to body
00185 
00186   // port-related parameters
00187   iPort              = 6000;  // port: port number for player connection
00188   iCoachPort         = 6001;  // coach_port: port number for coach connection
00189   iOlCoachPort       = 6002;  // ol_coach_port: port number for online coach
00190 
00191   // coach-related parameters
00192   iSayCoachCntMax    = 128;   // say_coach_cnt_max: maximum number of coach
00193                               // messages possible
00194   iSayCoachMsgSize   = 128;   // say_coach_msg_size: maximum size of coach
00195                               // messages
00196   iClangWinSize      = 300;   // clang_win_size: time window which controls how
00197                               // many coach messages can be sent
00198   iClangDefineWin    = 1;     // clang_define_win: number of define messages by
00199                               // coach per time window
00200   iClangMetaWin      = 1;     // clang_meta_win: number of meta messages by
00201                               // coach per time window
00202   iClangAdviceWin    = 1;     // clang_advice_win: number of advice messages by
00203                               // coach per time window
00204   iClangInfoWin      = 1;     // clang_info_win: number of info messages by
00205                               // coach per time window
00206   iClangMessDelay    = 50;    // clang_mess_delay: delay of coach messages, i.e.
00207                               // the number of cycles between send to player and
00208                               // receival of message
00209   iClangMessPerCycle = 1;     // clang_mess_per_cycle: number of coach messages
00210                               // per cycle
00211   iSendViStep        = 100;   // send_vi_step: interval of coach's look, i.e.
00212                               // the length of the interval (in ms) between
00213                               // visual messages to the coach
00214 
00215   // time-related parameters
00216   iSimulatorStep     = 100;   // simulator_step: the length (in ms) of a
00217                               // simulator cycle
00218   iSendStep          = 150;   // send_step: the length of the interval (in ms)
00219                               // between visual messages to a player in the
00220                               // standard view mode
00221   iRecvStep          = 10;    // recv_step: the length of the interval (in ms)
00222                               // for accepting commands from a player
00223   iHalfTime          = 300;   // half_time: the length (in seconds) of a single
00224                               // game half
00225   iDropBallTime      = 200;   // drop_ball_time: the number of cycles to wait
00226                               // until dropping the ball automatically for free
00227                               // kicks, corner kicks, etc.
00228 
00229   // speech-related parameters
00230   iSayMsgSize        = 512;   // say_msg_size: the maximum length (in bytes) of
00231                               // a spoken message
00232 
00233   // offside-related parameters
00234   bUseOffside            = true; // use_offside: a boolean flag indicating
00235                                  // whether the offside rule should be applied
00236                                  // or not
00237   dOffsideActiveAreaSize = 5.0;  // offside_active_area_size: offside active
00238                                  // area size, i.e. radius of circle around
00239                                  // the ball in which player can be offside
00240   bForbidKickOffOffside  = true; // forbid_kick_off_offside: a boolean flag
00241                                  // indicating whether a kick from offside
00242                                  // position is allowed
00243   dOffsideKickMargin     = 9.15; // offside_kick_margin: offside kick margin
00244                                  // i.e. the minimum distance to the ball for
00245                                  // offending players when a free kick for
00246                                  // offside is taken
00247 
00248   // log-related parameters
00249   bVerbose           = false; // verbose: flag indicating whether verbose mode
00250                               // is active or not; in verbose mode server sends
00251                               // extra error-information
00252   iRecordVersion     = 3;     // record_version: the type of log record
00253   bRecordLog         = true;  // record_log: flag indicating whether log record
00254                               // for game should be created
00255   bSendLog           = true;  // send_log: flag indicating whether send client
00256                               // command log for game should be created
00257   bLogTimes          = false; // log_times: flag indicating whether ms should be
00258                               // written between cycles in log file
00259   strcpy( strLogFile, "server.log" );// server log to store all actions received
00260 
00261   // heterogeneous player parameters from player.conf
00262   iPlayerTypes              = 7;     // player_types: the number of player types
00263                                      // including the default player type
00264   iSubsMax                  = 3;     // subs_max: the maximum number of
00265                                      // substitutions allowed during a game; the
00266                                      // value also indicates the maximum number
00267                                      // of players allowed for each type
00268   dPlayerSpeedMaxDeltaMin   = 0.0;   // player_speed_max_delta_min: minimum
00269                                      // delta for adjusting player_speed_max
00270   dPlayerSpeedMaxDeltaMax   = 0.0;   // player_speed_max_delta_max: maximum
00271                                      // delta for adjusting player_speed_max
00272   dStaminaIncMaxDeltaFactor = 0.0;   // stamina_inc_max_delta_factor: amount by
00273                                      // which delta is multiplied for
00274                                      // stamina_inc_max
00275   dPlayerDecayDeltaMin      = 0.0;   // player_decay_delta_min: minimum delta
00276                                      // for adjusting player_decay
00277   dPlayerDecayDeltaMax      = 0.2;   // player_decay_delta_max: maximum delta
00278                                      // for adjusting player_decay
00279   dInertiaMomentDeltaFactor = 25.0;  // inertia_moment_delta_factor: amount by
00280                                      // which delta is multiplied for
00281                                      // inertia_moment
00282   dDashPowerRateDeltaMin    = 0.0;   // dash_power_rate_delta_min: minimum delta
00283                                      // for adjusting dash_power_rate
00284   dDashPowerRateDeltaMax    = 0.0;   // dash_power_rate_delta_max: maximum delta
00285                                      // for adjusting dash_power_rate
00286   dPlayerSizeDeltaFactor    = -100.0;// player_size_delta_factor: amount delta
00287                                      // is multiplied by for player_size
00288   dKickableMarginDeltaMin   = 0.0;   // kickable_margin_delta_min: minimum delta
00289                                      // for adjusting kickable_margin
00290   dKickableMarginDeltaMax   = 0.2;   // kickable_margin_delta_max: maximum delta
00291                                      // for adjusting kickable_margin
00292   dKickRandDeltaFactor      = 0.5;   // kick_rand_delta_factor: amount delta is
00293                                      // multiplied by for kick_rand
00294   dExtraStaminaDeltaMin     = 0.0;   // extra_stamina_delta_min: minimum delta
00295                                      // for adjusting extra_stamina
00296   dExtraStaminaDeltaMax     = 100.0; // extra_stamina_delta_max: maximum delta
00297                                      // for adjusting extra_stamina
00298   dEffortMaxDeltaFactor     = -0.002;// effort_max_delta_factor: amount delta is
00299                                      // multiplied by for effort_max
00300   dEffortMinDeltaFactor     = -0.002;// effort_min_delta_factor: amount delta is
00301                                      // multiplied by for effort_min
00302   dNewDashPowerRateDeltaMin = 0.0;   // dash_power_rate_delta_min: minimum delta
00303                                      // for adjusting dash_power_rate
00304   dNewDashPowerRateDeltaMax = 0.002; // dash_power_rate_delta_max: maximum delta
00305                                      // for adjusting dash_power_rate
00306   dNewStaminaIncMaxDeltaFactor=-100000.0;// stamina_inc_max_delta_factor: amount 
00307                                      // by which delta is multiplied for
00308                                      // stamina_inc_max
00309 
00310   // important server parameters not in server.conf or player.conf
00311   dEffortMax         = 1.0; // effort_max: maximum player effort capacity
00312   iSlowDownFactor    = 1;   // slow_down_factor: factor to slow down simulator
00313                             // and send intervals
00314   dVisibleDistance   = 3.0; // visible_distance: distance within which objects
00315                             // are always 'visible' (even when not in view cone)
00316   dExtraStamina      = 0.0; // extra_stamina: extra stamina for heterogeneous
00317                             // player
00318 
00319   // parameters which depend on other values
00320   dMaximalKickDist = dKickableMargin +   // the maximum distance from a player
00321                      dPlayerSize +       // for which the ball is still kickable
00322                      dBallSize;
00323 
00324   // add all the settings, i.e. each parameter
00325   // becomes a new generic value for the class
00326 
00327   // goal-related parameters
00328   addSetting( "goal_width"        , &dGoalWidth       , GENERIC_VALUE_DOUBLE  );
00329 
00330   // player-related parameters
00331   addSetting( "player_size"       , &dPlayerSize      , GENERIC_VALUE_DOUBLE  );
00332   addSetting( "player_decay"      , &dPlayerDecay     , GENERIC_VALUE_DOUBLE  );
00333   addSetting( "player_rand"       , &dPlayerRand      , GENERIC_VALUE_DOUBLE  );
00334   addSetting( "player_weight"     , &dPlayerWeight    , GENERIC_VALUE_DOUBLE  );
00335   addSetting( "player_speed_max"  , &dPlayerSpeedMax  , GENERIC_VALUE_DOUBLE  );
00336   addSetting( "player_accel_max"  , &dPlayerAccelMax  , GENERIC_VALUE_DOUBLE  );
00337 
00338   // stamina-related parameters
00339   addSetting( "stamina_max"       , &dStaminaMax      , GENERIC_VALUE_DOUBLE  );
00340   addSetting( "stamina_inc_max"   , &dStaminaIncMax   , GENERIC_VALUE_DOUBLE  );
00341   addSetting( "recover_dec_thr"   , &dRecoverDecThr   , GENERIC_VALUE_DOUBLE  );
00342   addSetting( "recover_dec"       , &dRecoverDec      , GENERIC_VALUE_DOUBLE  );
00343   addSetting( "recover_min"       , &dRecoverMin      , GENERIC_VALUE_DOUBLE  );
00344   addSetting( "effort_dec_thr"    , &dEffortDecThr    , GENERIC_VALUE_DOUBLE  );
00345   addSetting( "effort_dec"        , &dEffortDec       , GENERIC_VALUE_DOUBLE  );
00346   addSetting( "effort_inc_thr"    , &dEffortIncThr    , GENERIC_VALUE_DOUBLE  );
00347   addSetting( "effort_inc"        , &dEffortInc       , GENERIC_VALUE_DOUBLE  );
00348   addSetting( "effort_min"        , &dEffortMin       , GENERIC_VALUE_DOUBLE  );
00349 
00350   // parameters related to auditory perception
00351   addSetting( "hear_max"          , &iHearMax         , GENERIC_VALUE_INTEGER );
00352   addSetting( "hear_inc"          , &iHearInc         , GENERIC_VALUE_INTEGER );
00353   addSetting( "hear_decay"        , &iHearDecay       , GENERIC_VALUE_INTEGER );
00354 
00355   // parameters related to player turn actions
00356   addSetting( "inertia_moment"    , &dInertiaMoment   , GENERIC_VALUE_DOUBLE  );
00357 
00358   // parameters related to sense_body information
00359   addSetting( "sense_body_step"   , &iSenseBodyStep   , GENERIC_VALUE_INTEGER );
00360 
00361   // goalkeeper-related parameters
00362   addSetting( "catchable_area_l"  , &dCatchableAreaL  , GENERIC_VALUE_DOUBLE  );
00363   addSetting( "catchable_area_w"  , &dCatchableAreaW  , GENERIC_VALUE_DOUBLE  );
00364   addSetting( "catch_probability" , &dCatchProbability, GENERIC_VALUE_DOUBLE  );
00365   addSetting( "catch_ban_cycle"   , &iCatchBanCycle   , GENERIC_VALUE_INTEGER );
00366   addSetting( "goalie_max_moves"  , &iGoalieMaxMoves  , GENERIC_VALUE_INTEGER );
00367 
00368   // ball-related parameters
00369   addSetting( "ball_size"         , &dBallSize        , GENERIC_VALUE_DOUBLE  );
00370   addSetting( "ball_decay"        , &dBallDecay       , GENERIC_VALUE_DOUBLE  );
00371   addSetting( "ball_rand"         , &dBallRand        , GENERIC_VALUE_DOUBLE  );
00372   addSetting( "ball_weight"       , &dBallWeight      , GENERIC_VALUE_DOUBLE  );
00373   addSetting( "ball_speed_max"    , &dBallSpeedMax    , GENERIC_VALUE_DOUBLE  );
00374   addSetting( "ball_accel_max"    , &dBallAccelMax    , GENERIC_VALUE_DOUBLE  );
00375 
00376   // wind-related parameters
00377   addSetting( "wind_force"        , &dWindForce       , GENERIC_VALUE_DOUBLE  );
00378   addSetting( "wind_dir"          , &dWindDir         , GENERIC_VALUE_DOUBLE  );
00379   addSetting( "wind_rand"         , &dWindRand        , GENERIC_VALUE_DOUBLE  );
00380   addSetting( "wind_random"       , &bWindRandom      , GENERIC_VALUE_BOOLEAN );
00381   // parameters related to 'dash' and 'kick' commands
00382   addSetting( "kickable_margin"   , &dKickableMargin  , GENERIC_VALUE_DOUBLE  );
00383   addSetting( "ckick_margin"      , &dCkickMargin     , GENERIC_VALUE_DOUBLE  );
00384   addSetting( "dash_power_rate"   , &dDashPowerRate   , GENERIC_VALUE_DOUBLE  );
00385   addSetting( "kick_power_rate"   , &dKickPowerRate   , GENERIC_VALUE_DOUBLE  );
00386   addSetting( "kick_rand"         , &dKickRand        , GENERIC_VALUE_DOUBLE  );
00387 
00388   // parameters related to visual and auditory perception range
00389   addSetting( "visible_angle"     , &dVisibleAngle    , GENERIC_VALUE_DOUBLE  );
00390   addSetting( "audio_cut_dist"    , &dAudioCutDist    , GENERIC_VALUE_DOUBLE  );
00391 
00392   // quantization parameters
00393   addSetting( "quantize_step"     , &dQuantizeStep    , GENERIC_VALUE_DOUBLE  );
00394   addSetting( "quantize_step_l"   , &dQuantizeStepL   , GENERIC_VALUE_DOUBLE  );
00395 
00396   // range parameters for basic actuator commands
00397   addSetting( "maxpower"          , &iMaxPower        , GENERIC_VALUE_INTEGER );
00398   addSetting( "minpower"          , &iMinPower        , GENERIC_VALUE_INTEGER );
00399   addSetting( "maxmoment"         , &iMaxMoment       , GENERIC_VALUE_INTEGER );
00400   addSetting( "minmoment"         , &iMinMoment       , GENERIC_VALUE_INTEGER );
00401   addSetting( "maxneckmoment"     , &iMaxNeckMoment   , GENERIC_VALUE_INTEGER );
00402   addSetting( "minneckmoment"     , &iMinNeckMoment   , GENERIC_VALUE_INTEGER );
00403   addSetting( "maxneckang"        , &iMaxNeckAng      , GENERIC_VALUE_INTEGER );
00404   addSetting( "minneckang"        , &iMinNeckAng      , GENERIC_VALUE_INTEGER );
00405 
00406   // port-related parameters
00407   addSetting( "port"              , &iPort            , GENERIC_VALUE_INTEGER );
00408   addSetting( "coach_port"        , &iCoachPort       , GENERIC_VALUE_INTEGER );
00409   addSetting( "ol_coach_port"     , &iOlCoachPort     , GENERIC_VALUE_INTEGER );  
00410 
00411   // coach-related parameters
00412   addSetting( "say_coach_cnt_max" , &iSayCoachCntMax  , GENERIC_VALUE_INTEGER );
00413   addSetting( "say_coach_msg_size", &iSayCoachMsgSize , GENERIC_VALUE_INTEGER );
00414   addSetting( "clang_win_size"    , &iClangWinSize    , GENERIC_VALUE_INTEGER );
00415   addSetting( "clang_define_win"  , &iClangDefineWin  , GENERIC_VALUE_INTEGER );
00416   addSetting( "clang_meta_win"    , &iClangMetaWin    , GENERIC_VALUE_INTEGER );
00417   addSetting( "clang_advice_win"  , &iClangAdviceWin  , GENERIC_VALUE_INTEGER );
00418   addSetting( "clang_info_win"    , &iClangInfoWin    , GENERIC_VALUE_INTEGER );
00419   addSetting( "clang_mess_delay"  , &iClangMessDelay  , GENERIC_VALUE_INTEGER );
00420   addSetting( "clang_mess_per_cycle",&iClangMessPerCycle,GENERIC_VALUE_INTEGER);
00421   addSetting( "send_vi_step"      , &iSendViStep      , GENERIC_VALUE_INTEGER );
00422 
00423   // time-related parameters
00424   addSetting( "simulator_step"    , &iSimulatorStep   , GENERIC_VALUE_INTEGER );
00425   addSetting( "send_step"         , &iSendStep        , GENERIC_VALUE_INTEGER );
00426   addSetting( "recv_step"         , &iRecvStep        , GENERIC_VALUE_INTEGER );
00427   addSetting( "half_time"         , &iHalfTime        , GENERIC_VALUE_INTEGER );
00428   addSetting( "drop_ball_time"    , &iDropBallTime    , GENERIC_VALUE_INTEGER );
00429 
00430   // speech-related parameters
00431   addSetting( "say_msg_size"      , &iSayMsgSize      , GENERIC_VALUE_INTEGER );
00432 
00433   // offside-related parameters
00434   addSetting( "use_offside"       , &bUseOffside      , GENERIC_VALUE_BOOLEAN );
00435   addSetting( "offside_active_area_size", &dOffsideActiveAreaSize,
00436                                                         GENERIC_VALUE_DOUBLE  );
00437   addSetting( "forbid_kick_off_offside" , &bForbidKickOffOffside ,
00438                                                         GENERIC_VALUE_BOOLEAN );
00439   addSetting( "offside_kick_margin",&dOffsideKickMargin,GENERIC_VALUE_DOUBLE  );
00440 
00441   // log-related parameters
00442   addSetting( "verbose"           , &bVerbose         , GENERIC_VALUE_BOOLEAN );
00443   addSetting( "record_version"    , &iRecordVersion   , GENERIC_VALUE_INTEGER );
00444   addSetting( "record_log"        , &bRecordLog       , GENERIC_VALUE_BOOLEAN );
00445   addSetting( "send_log"          , &bSendLog         , GENERIC_VALUE_BOOLEAN );
00446   addSetting( "log_times"         , &bLogTimes        , GENERIC_VALUE_BOOLEAN );
00447   addSetting( "log_file"          , &strLogFile       , GENERIC_VALUE_STRING  );
00448 
00449   // heterogeneous player parameters from player.conf
00450   addSetting( "player_types"      , &iPlayerTypes     , GENERIC_VALUE_INTEGER );
00451   addSetting( "subs_max"          , &iSubsMax         , GENERIC_VALUE_INTEGER );
00452   addSetting( "player_speed_max_delta_min"  , &dPlayerSpeedMaxDeltaMin  ,
00453                                                         GENERIC_VALUE_DOUBLE  );
00454   addSetting( "player_speed_max_delta_max"  , &dPlayerSpeedMaxDeltaMax  ,
00455                                                         GENERIC_VALUE_DOUBLE  );
00456   addSetting( "stamina_inc_max_delta_factor", &dStaminaIncMaxDeltaFactor,
00457                                                         GENERIC_VALUE_DOUBLE  );
00458   addSetting( "player_decay_delta_min"      , &dPlayerDecayDeltaMin     ,
00459                                                         GENERIC_VALUE_DOUBLE  );
00460   addSetting( "player_decay_delta_max"      , &dPlayerDecayDeltaMax     ,
00461                                                         GENERIC_VALUE_DOUBLE  );
00462   addSetting( "inertia_moment_delta_factor" , &dInertiaMomentDeltaFactor,
00463                                                         GENERIC_VALUE_DOUBLE  );
00464   addSetting( "dash_power_rate_delta_min"   , &dDashPowerRateDeltaMin   ,
00465                                                         GENERIC_VALUE_DOUBLE  );
00466   addSetting( "dash_power_rate_delta_max"   , &dDashPowerRateDeltaMax   ,
00467                                                         GENERIC_VALUE_DOUBLE  );
00468   addSetting( "player_size_delta_factor"    , &dPlayerSizeDeltaFactor   ,
00469                                                         GENERIC_VALUE_DOUBLE  );
00470   addSetting( "kickable_margin_delta_min"   , &dKickableMarginDeltaMin  ,
00471                                                         GENERIC_VALUE_DOUBLE  );
00472   addSetting( "kickable_margin_delta_max"   , &dKickableMarginDeltaMax  ,
00473                                                         GENERIC_VALUE_DOUBLE  );
00474   addSetting( "kick_rand_delta_factor"      , &dKickRandDeltaFactor     ,
00475                                                         GENERIC_VALUE_DOUBLE  );
00476   addSetting( "extra_stamina_delta_min"     , &dExtraStaminaDeltaMin    ,
00477                                                         GENERIC_VALUE_DOUBLE  );
00478   addSetting( "extra_stamina_delta_max"     , &dExtraStaminaDeltaMax    ,
00479                                                         GENERIC_VALUE_DOUBLE  );
00480   addSetting( "effort_max_delta_factor"     , &dEffortMaxDeltaFactor    ,
00481                                                         GENERIC_VALUE_DOUBLE  );
00482   addSetting( "effort_min_delta_factor"     , &dEffortMinDeltaFactor    ,
00483                                                         GENERIC_VALUE_DOUBLE  );
00484   addSetting( "new_dash_power_rate_delta_min", &dNewDashPowerRateDeltaMin   ,
00485                                                         GENERIC_VALUE_DOUBLE  );
00486   addSetting( "new_dash_power_rate_delta_max", &dNewDashPowerRateDeltaMax   ,
00487                                                         GENERIC_VALUE_DOUBLE  );
00488   addSetting( "new_stamina_inc_max_delta_factor", &dNewStaminaIncMaxDeltaFactor,
00489                                                         GENERIC_VALUE_DOUBLE  );
00490 
00491   // important server parameters not in server.conf or player.conf - are now
00492   addSetting( "effort_max"        , &dEffortMax       , GENERIC_VALUE_DOUBLE  );
00493   addSetting( "slow_down_factor"  , &iSlowDownFactor  , GENERIC_VALUE_INTEGER );
00494   addSetting( "visible_distance"  , &dVisibleDistance , GENERIC_VALUE_DOUBLE  );
00495   addSetting( "extra_stamina"     , &dExtraStamina    , GENERIC_VALUE_DOUBLE  );
00496 
00497   // parameters which depend on other values
00498   addSetting( "dMaximalKickDist"  , &dMaximalKickDist , GENERIC_VALUE_DOUBLE  );
00499 }
00500 
00509 bool ServerSettings::setValue( const char *strName, const char *strValue )
00510 {
00511   // call to the superclass method
00512   bool bReturn = GenericValues::setValue( strName, strValue );
00513   // compute values for parameters which depend on others (reason for override)
00514   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00515 
00516   return ( bReturn );
00517 }
00518 
00526 bool ServerSettings::readValues( char *strFileName, char *strSeparator )
00527 {
00528   // call to the superclass method
00529   bool bReturn = GenericValues::readValues( strFileName, strSeparator );
00530   // compute values for parameters which depend on others (reason for override)
00531   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00532 
00533   return ( bReturn );
00534 }
00535 
00539 bool ServerSettings::setGoalWidth( double d )
00540 {
00541   dGoalWidth = d;
00542   return ( true );
00543 }
00544 
00547 double ServerSettings::getGoalWidth( ) const
00548 {
00549   return ( dGoalWidth );
00550 }
00551 
00555 bool ServerSettings::setPlayerSize( double d )
00556 {
00557   dPlayerSize = d;
00558   // NOTE: also update parameters for which the value depends on this variable
00559   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00560 
00561   return ( true );
00562 }
00563 
00566 double ServerSettings::getPlayerSize( ) const
00567 {
00568   return ( dPlayerSize );
00569 }
00570 
00574 bool ServerSettings::setPlayerDecay( double d )
00575 {
00576   dPlayerDecay = d;
00577   return ( true );
00578 }
00579 
00582 double ServerSettings::getPlayerDecay( ) const
00583 {
00584   return ( dPlayerDecay );
00585 }
00586 
00590 bool ServerSettings::setPlayerRand( double d )
00591 {
00592   dPlayerRand = d;
00593   return ( true );
00594 }
00595 
00598 double ServerSettings::getPlayerRand( ) const
00599 {
00600   return ( dPlayerRand );
00601 }
00602 
00606 bool ServerSettings::setPlayerWeight( double d )
00607 {
00608   dPlayerWeight = d;
00609   return ( true );
00610 }
00611 
00614 double ServerSettings::getPlayerWeight( ) const
00615 {
00616   return ( dPlayerWeight );
00617 }
00618 
00622 bool ServerSettings::setPlayerSpeedMax( double d )
00623 {
00624   dPlayerSpeedMax = d;
00625   return ( true );
00626 }
00627 
00630 double ServerSettings::getPlayerSpeedMax( ) const
00631 {
00632   return ( dPlayerSpeedMax );
00633 }
00634 
00639 bool ServerSettings::setPlayerAccelMax( double d )
00640 {
00641   dPlayerAccelMax = d;
00642   return ( true );
00643 }
00644 
00647 double ServerSettings::getPlayerAccelMax( ) const
00648 {
00649   return ( dPlayerAccelMax );
00650 }
00651 
00655 bool ServerSettings::setStaminaMax( double d )
00656 {
00657   dStaminaMax = d;
00658   return ( true );
00659 }
00660 
00663 double ServerSettings::getStaminaMax( ) const
00664 {
00665   return ( dStaminaMax );
00666 }
00667 
00672 bool ServerSettings::setStaminaIncMax( double d )
00673 {
00674   dStaminaIncMax = d;
00675   return ( true );
00676 }
00677 
00680 double ServerSettings::getStaminaIncMax( ) const
00681 {
00682   return ( dStaminaIncMax );
00683 }
00684 
00689 bool ServerSettings::setRecoverDecThr( double d )
00690 {
00691   dRecoverDecThr = d;
00692   return ( true );
00693 }
00694 
00697 double ServerSettings::getRecoverDecThr( ) const
00698 {
00699   return ( dRecoverDecThr );
00700 }
00701 
00706 bool ServerSettings::setRecoverDec( double d )
00707 {
00708   dRecoverDec = d;
00709   return ( true );
00710 }
00711 
00714 double ServerSettings::getRecoverDec( ) const
00715 {
00716   return ( dRecoverDec );
00717 }
00718 
00722 bool ServerSettings::setRecoverMin( double d )
00723 {
00724   dRecoverMin = d;
00725   return ( true );
00726 }
00727 
00730 double ServerSettings::getRecoverMin( ) const
00731 {
00732   return ( dRecoverMin );
00733 }
00734 
00739 bool ServerSettings::setEffortDecThr( double d )
00740 {
00741   dEffortDecThr = d;
00742   return ( true );
00743 }
00744 
00748 double ServerSettings::getEffortDecThr( ) const
00749 {
00750   return ( dEffortDecThr );
00751 }
00752 
00757 bool ServerSettings::setEffortDec( double d )
00758 {
00759   dEffortDec = d;
00760   return ( true );
00761 }
00762 
00765 double ServerSettings::getEffortDec( ) const
00766 {
00767   return ( dEffortDec );
00768 }
00769 
00774 bool ServerSettings::setEffortIncThr( double d )
00775 {
00776   dEffortIncThr = d;
00777   return ( true );
00778 }
00779 
00783 double ServerSettings::getEffortIncThr( ) const
00784 {
00785   return ( dEffortIncThr );
00786 }
00787 
00792 bool ServerSettings::setEffortInc( double d )
00793 {
00794   dEffortInc = d;
00795   return ( true );
00796 }
00797 
00800 double ServerSettings::getEffortInc( ) const
00801 {
00802   return ( dEffortInc );
00803 }
00804 
00808 bool ServerSettings::setEffortMin( double d )
00809 {
00810   dEffortMin = d;
00811   return ( true );
00812 }
00813 
00816 double ServerSettings::getEffortMin( ) const
00817 {
00818   return ( dEffortMin );
00819 }
00820 
00825 bool ServerSettings::setHearMax( int i )
00826 {
00827   iHearMax = i;
00828   return ( true );
00829 }
00830 
00834 int ServerSettings::getHearMax( ) const
00835 {
00836   return ( iHearMax );
00837 }
00838 
00844 bool ServerSettings::setHearInc( int i )
00845 {
00846   iHearInc = i;
00847   return ( true );
00848 }
00849 
00853 int ServerSettings::getHearInc( ) const
00854 {
00855   return ( iHearInc );
00856 }
00857 
00862 bool ServerSettings::setHearDecay( int i )
00863 {
00864   iHearDecay = i;
00865   return ( true );
00866 }
00867 
00871 int ServerSettings::getHearDecay( ) const
00872 {
00873   return ( iHearDecay );
00874 }
00875 
00880 bool ServerSettings::setInertiaMoment( double d )
00881 {
00882   dInertiaMoment = d;
00883   return ( true );
00884 }
00885 
00889 double ServerSettings::getInertiaMoment( ) const
00890 {
00891   return ( dInertiaMoment );
00892 }
00893 
00898 bool ServerSettings::setSenseBodyStep( int i )
00899 {
00900   iSenseBodyStep = i;
00901   return ( true );
00902 }
00903 
00907 int ServerSettings::getSenseBodyStep( ) const
00908 {
00909   // NOTE: take slow down factor into account for send intervals
00910   return ( iSenseBodyStep * iSlowDownFactor );
00911 }
00912 
00917 bool ServerSettings::setCatchableAreaL( double d )
00918 {
00919   dCatchableAreaL = d;
00920   return ( true );
00921 }
00922 
00926 double ServerSettings::getCatchableAreaL( ) const
00927 {
00928   return ( dCatchableAreaL );
00929 }
00930 
00935 bool ServerSettings::setCatchableAreaW( double d )
00936 {
00937   dCatchableAreaW = d;
00938   return ( true );
00939 }
00940 
00944 double ServerSettings::getCatchableAreaW( ) const
00945 {
00946   return ( dCatchableAreaW );
00947 }
00948 
00953 bool ServerSettings::setCatchProbability( double d )
00954 {
00955   dCatchProbability = d;
00956   return ( true );
00957 }
00958 
00961 double ServerSettings::getCatchProbability( ) const
00962 {
00963   return ( dCatchProbability );
00964 }
00965 
00970 bool ServerSettings::setCatchBanCycle( int i )
00971 {
00972   iCatchBanCycle = i;
00973   return ( true );
00974 }
00975 
00979 int ServerSettings::getCatchBanCycle( ) const
00980 {
00981   return ( iCatchBanCycle );
00982 }
00983 
00988 bool ServerSettings::setGoalieMaxMoves( int i )
00989 {
00990   iGoalieMaxMoves = i;
00991   return ( true );
00992 }
00993 
00997 int ServerSettings::getGoalieMaxMoves( ) const
00998 {
00999   return ( iGoalieMaxMoves );
01000 }
01001 
01005 bool ServerSettings::setBallSize( double d )
01006 {
01007   dBallSize = d;
01008   // NOTE: also update parameters for which the value depends on this variable
01009   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
01010 
01011   return ( true );
01012 }
01013 
01016 double ServerSettings::getBallSize( ) const
01017 {
01018   return ( dBallSize );
01019 }
01020 
01024 bool ServerSettings::setBallDecay( double d )
01025 {
01026   dBallDecay = d;
01027   return ( true );
01028 }
01029 
01032 double ServerSettings::getBallDecay( ) const
01033 {
01034   return ( dBallDecay );
01035 }
01036 
01040 bool ServerSettings::setBallRand( double d )
01041 {
01042   dBallRand = d;
01043   return ( true );
01044 }
01045 
01048 double ServerSettings::getBallRand( ) const
01049 {
01050   return ( dBallRand );
01051 }
01052 
01056 bool ServerSettings::setBallWeight( double d )
01057 {
01058   dBallWeight = d;
01059   return ( true );
01060 }
01061 
01064 double ServerSettings::getBallWeight( ) const
01065 {
01066   return ( dBallWeight );
01067 }
01068 
01072 bool ServerSettings::setBallSpeedMax( double d )
01073 {
01074   dBallSpeedMax = d;
01075   return ( true );
01076 }
01077 
01080 double ServerSettings::getBallSpeedMax( ) const
01081 {
01082   return ( dBallSpeedMax );
01083 }
01084 
01089 bool ServerSettings::setBallAccelMax( double d )
01090 {
01091   dBallAccelMax = d;
01092   return ( true );
01093 }
01094 
01097 double ServerSettings::getBallAccelMax( ) const
01098 {
01099   return ( dBallAccelMax );
01100 }
01101 
01105 bool ServerSettings::setWindForce( double d )
01106 {
01107   dWindForce = d;
01108   return ( true );
01109 }
01110 
01113 double ServerSettings::getWindForce( ) const
01114 {
01115   return ( dWindForce );
01116 }
01117 
01121 bool ServerSettings::setWindDir( double d )
01122 {
01123   dWindDir = d;
01124   return ( true );
01125 }
01126 
01129 double ServerSettings::getWindDir( ) const
01130 {
01131   return ( dWindDir );
01132 }
01133 
01137 bool ServerSettings::setWindRand( double d )
01138 {
01139   dWindRand = d;
01140   return ( true );
01141 }
01142 
01145 double ServerSettings::getWindRand( ) const
01146 {
01147   return ( dWindRand );
01148 }
01149 
01153 bool ServerSettings::setWindRandom( bool b )
01154 {
01155   bWindRandom = b;
01156   return ( true );
01157 }
01158 
01161 bool ServerSettings::getWindRandom( ) const
01162 {
01163   return bWindRandom;
01164 }
01165 
01171 bool ServerSettings::setKickableMargin( double d )
01172 {
01173   dKickableMargin = d;
01174   // NOTE: also update parameters for which the value depends on this variable
01175   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
01176 
01177   return ( true );
01178 }
01179 
01183 double ServerSettings::getKickableMargin( ) const
01184 {
01185   return ( dKickableMargin );
01186 }
01187 
01193 bool ServerSettings::setCkickMargin( double d )
01194 {
01195   dCkickMargin = d;
01196   return ( true );
01197 }
01198 
01202 double ServerSettings::getCkickMargin( ) const
01203 {
01204   return ( dCkickMargin );
01205 }
01206 
01212 bool ServerSettings::setDashPowerRate( double d )
01213 {
01214   dDashPowerRate = d;
01215   return ( true );
01216 }
01217 
01222 double ServerSettings::getDashPowerRate( ) const
01223 {
01224   return ( dDashPowerRate );
01225 }
01226 
01232 bool ServerSettings::setKickPowerRate( double d )
01233 {
01234   dKickPowerRate = d;
01235   return ( true );
01236 }
01237 
01242 double ServerSettings::getKickPowerRate( ) const
01243 {
01244   return ( dKickPowerRate );
01245 }
01246 
01250 bool ServerSettings::setKickRand( double d )
01251 {
01252   dKickRand = d;
01253   return ( true );
01254 }
01255 
01258 double ServerSettings::getKickRand( ) const
01259 {
01260   return ( dKickRand );
01261 }
01262 
01267 bool ServerSettings::setVisibleAngle( double d )
01268 {
01269   dVisibleAngle = d;
01270   return ( true );
01271 }
01272 
01275 double ServerSettings::getVisibleAngle( ) const
01276 {
01277   return ( dVisibleAngle );
01278 }
01279 
01284 bool ServerSettings::setAudioCutDist( double d )
01285 {
01286   dAudioCutDist = d;
01287   return ( true );
01288 }
01289 
01292 double ServerSettings::getAudioCutDist( ) const
01293 {
01294   return ( dAudioCutDist );
01295 }
01296 
01301 bool ServerSettings::setQuantizeStep( double d )
01302 {
01303   dQuantizeStep = d;
01304   return ( true );
01305 }
01306 
01309 double ServerSettings::getQuantizeStep( ) const
01310 {
01311   return ( dQuantizeStep );
01312 }
01313 
01318 bool ServerSettings::setQuantizeStepL( double d )
01319 {
01320   dQuantizeStepL = d;
01321   return ( true );
01322 }
01323 
01326 double ServerSettings::getQuantizeStepL( ) const
01327 {
01328   return ( dQuantizeStepL );
01329 }
01330 
01334 bool ServerSettings::setMaxPower( int i )
01335 {
01336   iMaxPower = i;
01337   return ( true );
01338 }
01339 
01342 int ServerSettings::getMaxPower( ) const
01343 {
01344   return ( iMaxPower );
01345 }
01346 
01350 bool ServerSettings::setMinPower( int i )
01351 {
01352   iMinPower = i;
01353   return ( true );
01354 }
01355 
01358 int ServerSettings::getMinPower( ) const
01359 {
01360   return ( iMinPower );
01361 }
01362 
01366 bool ServerSettings::setMaxMoment( int i )
01367 {
01368   iMaxMoment = i;
01369   return ( true );
01370 }
01371 
01374 int ServerSettings::getMaxMoment( ) const
01375 {
01376   return ( iMaxMoment );
01377 }
01378 
01382 bool ServerSettings::setMinMoment( int i )
01383 {
01384   iMinMoment = i;
01385   return ( true );
01386 }
01387 
01390 int ServerSettings::getMinMoment( ) const
01391 {
01392   return ( iMinMoment );
01393 }
01394 
01398 bool ServerSettings::setMaxNeckMoment( int i )
01399 {
01400   iMaxNeckMoment = i;
01401   return ( true );
01402 }
01403 
01406 int ServerSettings::getMaxNeckMoment( ) const
01407 {
01408   return ( iMaxNeckMoment );
01409 }
01410 
01414 bool ServerSettings::setMinNeckMoment( int i )
01415 {
01416   iMinNeckMoment = i;
01417   return ( true );
01418 }
01419 
01422 int ServerSettings::getMinNeckMoment( ) const
01423 {
01424   return ( iMinNeckMoment );
01425 }
01426 
01430 bool ServerSettings::setMaxNeckAng( int i )
01431 {
01432   iMaxNeckAng = i;
01433   return ( true );
01434 }
01435 
01438 int ServerSettings::getMaxNeckAng( ) const
01439 {
01440   return ( iMaxNeckAng );
01441 }
01442 
01446 bool ServerSettings::setMinNeckAng( int i )
01447 {
01448   iMinNeckAng = i;
01449   return ( true );
01450 }
01451 
01454 int ServerSettings::getMinNeckAng( ) const
01455 {
01456   return ( iMinNeckAng );
01457 }
01458 
01463 bool ServerSettings::setPort( int i )
01464 {
01465   iPort = i;
01466   return ( true );
01467 }
01468 
01471 int ServerSettings::getPort( ) const
01472 {
01473   return ( iPort );
01474 }
01475 
01480 bool ServerSettings::setCoachPort( int i )
01481 {
01482   iCoachPort = i;
01483   return ( true );
01484 }
01485 
01488 int ServerSettings::getCoachPort( ) const
01489 {
01490   return ( iCoachPort );
01491 }
01492 
01497 bool ServerSettings::setOlCoachPort( int i )
01498 {
01499   iOlCoachPort = i;
01500   return ( true );
01501 }
01502 
01505 int ServerSettings::getOlCoachPort( ) const
01506 {
01507   return ( iOlCoachPort );
01508 }
01509 
01514 bool ServerSettings::setSayCoachCntMax( int i )
01515 {
01516   iSayCoachCntMax = i;
01517   return ( true );
01518 }
01519 
01522 int ServerSettings::getSayCoachCntMax( ) const
01523 {
01524   return ( iSayCoachCntMax );
01525 }
01526 
01530 bool ServerSettings::setSayCoachMsgSize( int i )
01531 {
01532   iSayCoachMsgSize = i;
01533   return ( true );
01534 }
01535 
01538 int ServerSettings::getSayCoachMsgSize( ) const
01539 {
01540   return ( iSayCoachMsgSize );
01541 }
01542 
01547 bool ServerSettings::setClangWinSize( int i )
01548 {
01549   iClangWinSize = i;
01550   return ( true );
01551 }
01552 
01555 int ServerSettings::getClangWinSize( ) const
01556 {
01557   return ( iClangWinSize );
01558 }
01559 
01564 bool ServerSettings::setClangDefineWin( int i )
01565 {
01566   iClangDefineWin = i;
01567   return ( true );
01568 }
01569 
01572 int ServerSettings::getClangDefineWin( ) const
01573 {
01574   return ( iClangDefineWin );
01575 }
01576 
01581 bool ServerSettings::setClangMetaWin( int i )
01582 {
01583   iClangMetaWin = i;
01584   return ( true );
01585 }
01586 
01589 int ServerSettings::getClangMetaWin( ) const
01590 {
01591   return ( iClangMetaWin );
01592 }
01593 
01598 bool ServerSettings::setClangAdviceWin( int i )
01599 {
01600   iClangAdviceWin = i;
01601   return ( true );
01602 }
01603 
01606 int ServerSettings::getClangAdviceWin( ) const
01607 {
01608   return ( iClangAdviceWin );
01609 }
01610 
01615 bool ServerSettings::setClangInfoWin( int i )
01616 {
01617   iClangInfoWin = i;
01618   return ( true );
01619 }
01620 
01623 int ServerSettings::getClangInfoWin( ) const
01624 {
01625   return ( iClangInfoWin );
01626 }
01627 
01633 bool ServerSettings::setClangMessDelay( int i )
01634 {
01635   iClangMessDelay = i;
01636   return ( true );
01637 }
01638 
01642 int ServerSettings::getClangMessDelay( ) const
01643 {
01644   return ( iClangMessDelay );
01645 }
01646 
01651 bool ServerSettings::setClangMessPerCycle( int i )
01652 {
01653   iClangMessPerCycle = i;
01654   return ( true );
01655 }
01656 
01659 int ServerSettings::getClangMessPerCycle( ) const
01660 {
01661   return ( iClangMessPerCycle );
01662 }
01663 
01669 bool ServerSettings::setSendViStep( int i )
01670 {
01671   iSendViStep = i;
01672   return ( true );
01673 }
01674 
01678 int ServerSettings::getSendViStep( ) const
01679 {
01680   // NOTE: take slow down factor into account for send intervals
01681   return ( iSendViStep * iSlowDownFactor );
01682 }
01683 
01688 bool ServerSettings::setSimulatorStep( int i )
01689 {
01690   iSimulatorStep = i;
01691   return ( true );
01692 }
01693 
01696 int ServerSettings::getSimulatorStep( ) const
01697 {
01698   // NOTE: take slow down factor into account for send intervals
01699   return ( iSimulatorStep * iSlowDownFactor );
01700 }
01701 
01706 bool ServerSettings::setSendStep( int i )
01707 {
01708   iSendStep = i;
01709   return ( true );
01710 }
01711 
01715 int ServerSettings::getSendStep( ) const
01716 {
01717   // NOTE: take slow down factor into account for send intervals
01718   return ( iSendStep * iSlowDownFactor );
01719 }
01720 
01725 bool ServerSettings::setRecvStep( int i )
01726 {
01727   iRecvStep = i;
01728   return ( true );
01729 }
01730 
01734 int ServerSettings::getRecvStep( ) const
01735 {
01736   return ( iRecvStep );
01737 }
01738 
01743 bool ServerSettings::setHalfTime( int i )
01744 {
01745   iHalfTime = i;
01746   return ( true );
01747 }
01748 
01751 int ServerSettings::getHalfTime( ) const
01752 {
01753   return ( iHalfTime );
01754 }
01755 
01760 bool ServerSettings::setDropBallTime( int i )
01761 {
01762   iDropBallTime = i;
01763   return ( true );
01764 }
01765 
01769 int ServerSettings::getDropBallTime( ) const
01770 {
01771   return ( iDropBallTime );
01772 }
01773 
01778 bool ServerSettings::setSayMsgSize( int i )
01779 {
01780   iSayMsgSize = i;
01781   return ( true );
01782 }
01783 
01786 int ServerSettings::getSayMsgSize( ) const
01787 {
01788   return ( iSayMsgSize );
01789 }
01790 
01795 bool ServerSettings::setUseOffside( bool b )
01796 {
01797   bUseOffside = b;
01798   return ( true );
01799 }
01800 
01804 bool ServerSettings::getUseOffside( ) const
01805 {
01806   return ( bUseOffside );
01807 }
01808 
01813 bool ServerSettings::setOffsideActiveAreaSize( double d )
01814 {
01815   dOffsideActiveAreaSize = d;
01816   return ( true );
01817 }
01818 
01822 double ServerSettings::getOffsideActiveAreaSize( ) const
01823 {
01824   return ( dOffsideActiveAreaSize );
01825 }
01826 
01831 bool ServerSettings::setForbidKickOffOffside( bool b )
01832 {
01833   bForbidKickOffOffside = b;
01834   return ( true );
01835 }
01836 
01840 bool ServerSettings::getForbidKickOffOffside( ) const
01841 {
01842   return ( bForbidKickOffOffside );
01843 }
01844 
01850 bool ServerSettings::setOffsideKickMargin( double d )
01851 {
01852   dOffsideKickMargin = d;
01853   return ( true );
01854 }
01855 
01859 double ServerSettings::getOffsideKickMargin( ) const
01860 {
01861   return ( dOffsideKickMargin );
01862 }
01863 
01868 bool ServerSettings::setVerbose( bool b )
01869 {
01870   bVerbose = b;
01871   return ( true );
01872 }
01873 
01877 bool ServerSettings::getVerbose( ) const
01878 {
01879   return ( bVerbose );
01880 }
01881 
01885 bool ServerSettings::setRecordVersion( int i )
01886 {
01887   iRecordVersion = i;
01888   return ( true );
01889 }
01890 
01893 int ServerSettings::getRecordVersion( ) const
01894 {
01895   return ( iRecordVersion );
01896 }
01897 
01902 bool ServerSettings::setRecordLog( bool b )
01903 {
01904   bRecordLog = b;
01905   return ( true );
01906 }
01907 
01911 bool ServerSettings::getRecordLog( ) const
01912 {
01913   return ( bRecordLog );
01914 }
01915 
01920 bool ServerSettings::setSendLog( bool b )
01921 {
01922   bSendLog = b;
01923   return ( true );
01924 }
01925 
01929 bool ServerSettings::getSendLog( ) const
01930 {
01931   return ( bSendLog );
01932 }
01933 
01938 bool ServerSettings::setLogTimes( bool b )
01939 {
01940   bLogTimes = b;
01941   return ( true );
01942 }
01943 
01947 bool ServerSettings::getLogTimes( ) const
01948 {
01949   return ( bLogTimes );
01950 }
01951 
01956 bool ServerSettings::setLogFile( char *str )
01957 {
01958   strcpy( strLogFile, str );
01959   return ( true );
01960 }
01961 
01964 char* ServerSettings::getLogFile( )
01965 {
01966   return ( strLogFile );
01967 }
01968 
01973 bool ServerSettings::setPlayerTypes( int i )
01974 {
01975   iPlayerTypes = i;
01976   return ( true );
01977 }
01978 
01981 int ServerSettings::getPlayerTypes( ) const
01982 {
01983   return ( iPlayerTypes );
01984 }
01985 
01991 bool ServerSettings::setSubsMax( int i )
01992 {
01993   iSubsMax = i;
01994   return ( true );
01995 }
01996 
02000 int ServerSettings::getSubsMax( ) const
02001 {
02002   return ( iSubsMax );
02003 }
02004 
02009 bool ServerSettings::setPlayerSpeedMaxDeltaMin( double d )
02010 {
02011   dPlayerSpeedMaxDeltaMin = d;
02012   return ( true );
02013 }
02014 
02017 double ServerSettings::getPlayerSpeedMaxDeltaMin( ) const
02018 {
02019   return ( dPlayerSpeedMaxDeltaMin );
02020 }
02021 
02026 bool ServerSettings::setPlayerSpeedMaxDeltaMax( double d )
02027 {
02028   dPlayerSpeedMaxDeltaMax = d;
02029   return ( true );
02030 }
02031 
02034 double ServerSettings::getPlayerSpeedMaxDeltaMax( ) const
02035 {
02036   return ( dPlayerSpeedMaxDeltaMax );
02037 }
02038 
02043 bool ServerSettings::setStaminaIncMaxDeltaFactor( double d )
02044 {
02045   dStaminaIncMaxDeltaFactor = d;
02046   return ( true );
02047 }
02048 
02051 double ServerSettings::getStaminaIncMaxDeltaFactor( ) const
02052 {
02053   return ( dStaminaIncMaxDeltaFactor );
02054 }
02055 
02060 bool ServerSettings::setPlayerDecayDeltaMin( double d )
02061 {
02062   dPlayerDecayDeltaMin = d;
02063   return ( true );
02064 }
02065 
02068 double ServerSettings::getPlayerDecayDeltaMin( ) const
02069 {
02070   return ( dPlayerDecayDeltaMin );
02071 }
02072 
02077 bool ServerSettings::setPlayerDecayDeltaMax( double d )
02078 {
02079   dPlayerDecayDeltaMax = d;
02080   return ( true );
02081 }
02082 
02085 double ServerSettings::getPlayerDecayDeltaMax( ) const
02086 {
02087   return ( dPlayerDecayDeltaMax );
02088 }
02089 
02094 bool ServerSettings::setInertiaMomentDeltaFactor( double d )
02095 {
02096   dInertiaMomentDeltaFactor = d;
02097   return ( true );
02098 }
02099 
02102 double ServerSettings::getInertiaMomentDeltaFactor( ) const
02103 {
02104   return ( dInertiaMomentDeltaFactor );
02105 }
02106 
02111 bool ServerSettings::setDashPowerRateDeltaMin( double d )
02112 {
02113   dDashPowerRateDeltaMin = d;
02114   return ( true );
02115 }
02116 
02119 double ServerSettings::getDashPowerRateDeltaMin( ) const
02120 {
02121   return ( dDashPowerRateDeltaMin );
02122 }
02123 
02128 bool ServerSettings::setDashPowerRateDeltaMax( double d )
02129 {
02130   dDashPowerRateDeltaMax = d;
02131   return ( true );
02132 }
02133 
02136 double ServerSettings::getDashPowerRateDeltaMax( ) const
02137 {
02138   return ( dDashPowerRateDeltaMax );
02139 }
02140 
02145 bool ServerSettings::setPlayerSizeDeltaFactor( double d )
02146 {
02147   dPlayerSizeDeltaFactor = d;
02148   return ( true );
02149 }
02150 
02153 double ServerSettings::getPlayerSizeDeltaFactor( ) const
02154 {
02155   return ( dPlayerSizeDeltaFactor );
02156 }
02157 
02162 bool ServerSettings::setKickableMarginDeltaMin( double d )
02163 {
02164   dKickableMarginDeltaMin = d;
02165   return ( true );
02166 }
02167 
02170 double ServerSettings::getKickableMarginDeltaMin( ) const
02171 {
02172   return ( dKickableMarginDeltaMin );
02173 }
02174 
02179 bool ServerSettings::setKickableMarginDeltaMax( double d )
02180 {
02181   dKickableMarginDeltaMax = d;
02182   return ( true );
02183 }
02184 
02187 double ServerSettings::getKickableMarginDeltaMax( ) const
02188 {
02189   return ( dKickableMarginDeltaMax );
02190 }
02191 
02196 bool ServerSettings::setKickRandDeltaFactor( double d )
02197 {
02198   dKickRandDeltaFactor = d;
02199   return ( true );
02200 }
02201 
02204 double ServerSettings::getKickRandDeltaFactor( ) const
02205 {
02206   return ( dKickRandDeltaFactor );
02207 }
02208 
02213 bool ServerSettings::setExtraStaminaDeltaMin( double d )
02214 {
02215   dExtraStaminaDeltaMin = d;
02216   return ( true );
02217 }
02218 
02221 double ServerSettings::getExtraStaminaDeltaMin( ) const
02222 {
02223   return ( dExtraStaminaDeltaMin );
02224 }
02225 
02230 bool ServerSettings::setExtraStaminaDeltaMax( double d )
02231 {
02232   dExtraStaminaDeltaMax = d;
02233   return ( true );
02234 }
02235 
02238 double ServerSettings::getExtraStaminaDeltaMax( ) const
02239 {
02240   return ( dExtraStaminaDeltaMax );
02241 }
02242 
02247 bool ServerSettings::setEffortMaxDeltaFactor( double d )
02248 {
02249   dEffortMaxDeltaFactor = d;
02250   return ( true );
02251 }
02252 
02255 double ServerSettings::getEffortMaxDeltaFactor( ) const
02256 {
02257   return ( dEffortMaxDeltaFactor );
02258 }
02259 
02264 bool ServerSettings::setEffortMinDeltaFactor( double d )
02265 {
02266   dEffortMinDeltaFactor = d;
02267   return ( true );
02268 }
02269 
02272 double ServerSettings::getEffortMinDeltaFactor( ) const
02273 {
02274   return ( dEffortMinDeltaFactor );
02275 }
02276 
02281 bool ServerSettings::setNewDashPowerRateDeltaMin( double d )
02282 {
02283   dNewDashPowerRateDeltaMin = d;
02284   return ( true );
02285 }
02286 
02289 double ServerSettings::getNewDashPowerRateDeltaMin( ) const
02290 {
02291   return ( dNewDashPowerRateDeltaMin );
02292 }
02293 
02298 bool ServerSettings::setNewDashPowerRateDeltaMax( double d )
02299 {
02300   dNewDashPowerRateDeltaMax = d;
02301   return ( true );
02302 }
02303 
02306 double ServerSettings::getNewDashPowerRateDeltaMax( ) const
02307 {
02308   return ( dNewDashPowerRateDeltaMax );
02309 }
02310 
02315 bool ServerSettings::setNewStaminaIncMaxDeltaFactor( double d )
02316 {
02317   dNewStaminaIncMaxDeltaFactor = d;
02318   return ( true );
02319 }
02320 
02323 double ServerSettings::getNewStaminaIncMaxDeltaFactor( ) const
02324 {
02325   return ( dNewStaminaIncMaxDeltaFactor );
02326 }
02327 
02331 bool ServerSettings::setEffortMax( double d )
02332 {
02333   dEffortMax = d;
02334   return ( true );
02335 }
02336 
02339 double ServerSettings::getEffortMax(  ) const
02340 {
02341   return ( dEffortMax );
02342 }
02343 
02348 bool ServerSettings::setSlowDownFactor( int i )
02349 {
02350   iSlowDownFactor = i;
02351   return ( true );
02352 }
02353 
02356 int ServerSettings::getSlowDownFactor( ) const
02357 {
02358   return ( iSlowDownFactor );
02359 }
02360 
02365 bool ServerSettings::setVisibleDistance( double d )
02366 {
02367   dVisibleDistance = d;
02368   return ( true );
02369 }
02370 
02374 double ServerSettings::getVisibleDistance( ) const
02375 {
02376   return ( dVisibleDistance );
02377 }
02378 
02384 bool ServerSettings::setExtraStamina( double d )
02385 {
02386   dExtraStamina = d;
02387   return ( true );
02388 }
02389 
02393 double ServerSettings::getExtraStamina( ) const
02394 {
02395   return ( dExtraStamina );
02396 }
02397 
02402 bool ServerSettings::setMaximalKickDist( double d )
02403 {
02404   dMaximalKickDist = d;
02405   return ( true );
02406 }
02407 
02411 double ServerSettings::getMaximalKickDist( ) const
02412 {
02413   return ( dMaximalKickDist );
02414 }
02415 
02416 /******************************************************************************/
02417 /********************   CLASS HETEROPLAYERSETTINGS ****************************/
02418 /******************************************************************************/
02419 
02423 void HeteroPlayerSettings::show( ostream &os )
02424 {
02425   os.setf( ios::left );
02426   os << dPlayerSpeedMax << " ";
02427   os.width( 5 );  
02428   os.precision( 4 );
02429   os.setf( ios::left );
02430   os << dStaminaIncMax << " " ;
02431   os.width( 6 );    
02432   os.precision( 4 );  
02433   os.setf( ios::left );
02434   os << dPlayerDecay  << " ";
02435   os.width( 5 );  
02436   os.precision( 4 );  
02437   os.setf( ios::left );  
02438   os << dInertiaMoment  << " " ;
02439   os.width( 8 );    
02440   os.precision( 4 );  
02441   os.setf( ios::left );  
02442   os << dDashPowerRate << " " ;
02443   os.width( 3 );    
02444   os.precision( 4 );  
02445   os.setf( ios::left );  
02446   os << dPlayerSize     << " " ;
02447   os.width( 6 );    
02448   os.precision( 4 );  
02449   os.setf( ios::left );  
02450   os << dKickableMargin << " " ;
02451   os.width( 6 );    
02452   os.precision( 4 );  
02453   os.setf( ios::left );  
02454   os << dKickRand      << " " ;
02455   os.width( 5 );    
02456   os.precision( 3 );  
02457   os.setf( ios::left );  
02458   os << dExtraStamina    << " " ;
02459   os.width( 6 );    
02460   os.precision( 4 );  
02461   os.setf( ios::left );  
02462   os << dEffortMin     << " " ;
02463   os.width( 6 );    
02464   os.setf( ios::left );  
02465   os.precision( 4 );  
02466   os << dEffortMax      << endl ;
02467 /*
02468   os <<        dPlayerSpeedMax << " " << dStaminaIncMax << " " << dPlayerDecay
02469      << " " << dInertiaMoment  << " " << dDashPowerRate << " " << dPlayerSize
02470      << " " << dKickableMargin << " " << dKickRand      << " " << dExtraStamina
02471      << " " << dEffortMax      << " " << dEffortMin     << endl;
02472 */
02473 }
02474 
02475 
02476 /********************** TESTING PURPOSES **************************************/
02477 /*
02478 
02479 int main( void )
02480 {
02481   ServerSettings settings;
02482 //  settings.show( cout );
02483   settings.readValues( "server.conf", ":" );
02484 //  printf( "------------\n" );
02485   settings.show( cout );
02486   cout << "player_size: " << settings.getPlayerSize( ) << endl;
02487 }
02488 
02489 */

Generated on Tue Jul 2 10:18:53 2002 for UvA Trilearn 2002 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001