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,2001, 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 */
00046 #include "ServerSettings.h"
00047 #include <stdio.h>
00048 #include <string.h>           // needed for 'strcpy'
00049 
00050 /******************************************************************************/
00051 /********************   CLASS SERVERSETTINGS   ********************************/
00052 /******************************************************************************/
00053 
00059 ServerSettings::ServerSettings( ):GenericValues( "ServerSettings", 104 )
00060 {
00061   // goal-related parameters
00062   dGoalWidth         = 14.02; // goal_width: the width of the goal
00063 
00064   // player-related parameters
00065   dPlayerSize        = 0.3;   // player_size: the size (=radius) of a player
00066   dPlayerDecay       = 0.4;   // player_decay: player speed decay per cycle
00067   dPlayerRand        = 0.1;   // player_rand: random error in player movement
00068   dPlayerWeight      = 60.0;  // player_weight: weight of a player (for wind)
00069   dPlayerSpeedMax    = 1.0;   // player_speed_max: maximum speed of a player
00070   dPlayerAccelMax    = 1.0;   // player_accel_max: maximum acceleration of a
00071                               // player per cycle
00072 
00073   // stamina-related parameters
00074   dStaminaMax        = 4000.0;// stamina_max: maximum stamina of a player
00075   dStaminaIncMax     = 45.0;  // stamina_inc_max: maximum stamina increase of a
00076                               // player per cycle
00077   dRecoverDecThr     = 0.3;   // recover_dec_thr: percentage of stamina_max
00078                               // below which player recovery decreases
00079   dRecoverDec        = 0.002; // recover_dec: decrement step per cycle for
00080                               // player recovery
00081   dRecoverMin        = 0.5;   // recover_min: minimum player recovery
00082   dEffortDecThr      = 0.3;   // effort_dec_thr: percentage of stamina_max below
00083                               // which player effort capacity decreases
00084   dEffortDec         = 0.005; // effort_dec: decrement step per cycle for
00085                               // player effort capacity
00086   dEffortIncThr      = 0.6;   // effort_incr_thr: percentage of stamina_max
00087                               // above which player effort capacity increases
00088   dEffortInc         = 0.01;  // effort_inc: increment step per cycle for
00089                               // player effort capacity
00090   dEffortMin         = 0.6;   // effort_min: minimum value for player effort
00091 
00092   // parameters related to auditory perception
00093   iHearMax           = 2;     // hear_max: maximum hearing capacity of a player;
00094                               // a player can hear hear_inc messages in
00095                               // hear_decay simulation cycles
00096   iHearInc           = 1;     // hear_inc: minimum hearing capacity of a player,
00097                               // i.e. the number of messages a player can hear
00098                               // in hear_decay simulation cycles
00099   iHearDecay         = 2;     // hear_decay: decay rate of player hearing
00100                               // capacity, i.e. minimum number of cycles for
00101                               // hear_inc messages
00102 
00103   // parameters related to player turn actions
00104   dInertiaMoment     = 5.0;   // inertia_moment: inertia moment of a player;
00105                               // affects actual turn angle depending on speed
00106 
00107   // parameters related to sense_body information
00108   iSenseBodyStep     = 100;   // sense_body_step: length of the interval (in ms)
00109                               // between sense_body information messages
00110 
00111   // goalkeeper-related parameters
00112   dCatchableAreaL    = 2.0;   // catchable_area_l: length of area around
00113                               // goalkeeper in which he can catch the ball
00114   dCatchableAreaW    = 1.0;   // catchable_area_w: width of area around
00115                               // goalkeeper in which he can catch the ball
00116   dCatchProbability  = 1.0;   // catch_probability: the probability for a
00117                               // goalkeeper to catch the ball
00118   iCatchBanCycle     = 5 ;    // catch_ban_cycle: number of cycles after catch
00119                               // in which goalkeeper cannot catch again
00120   iGoalieMaxMoves    = 2;     // goalie_max_moves: maximum number of 'move'
00121                               // actions allowed for goalkeeper after catch
00122 
00123   // ball-related parameters
00124   dBallSize          = 0.085; // ball_size: the size (=radius) of the ball
00125   dBallDecay         = 0.94;  // ball_decay: ball speed decay per cycle
00126   dBallRand          = 0.05;  // ball_rand: random error in ball movement
00127   dBallWeight        = 0.2;   // ball_weight: weight of the ball (for wind)
00128   dBallSpeedMax      = 2.7;   // ball_speed_max: maximum speed of the ball
00129   dBallAccelMax      = 2.7;   // ball_accel_max: maximum acceleration of the
00130                               // ball per cycle
00131 
00132   // wind-related parameters
00133   dWindForce         = 0.0;   // wind_force: the force of the wind
00134   dWindDir           = 0.0;   // wind_dir: the direction of the wind
00135   dWindRand          = 0.0;   // wind_rand: random error in wind direction
00136 
00137   // parameters related to 'dash' and 'kick' commands
00138   dKickableMargin    = 0.7;   // kickable_margin: margin around player in which
00139                               // ball is kickable; kickable area thus equals
00140                               // kickable_margin + ball_size + player_size
00141   dCkickMargin       = 1.0;   // ckick_margin: corner kick margin, i.e. the
00142                               // minimum distance to the ball for offending
00143                               // players when a corner kick is taken
00144 
00145   dDashPowerRate     = 0.006; // dash_power_rate: rate by which the 'Power'
00146                               // argument in a 'dash' command is multiplied
00147                               // (thus determining the amount of displacement of
00148                               // the player as a result of the 'dash')
00149   dKickPowerRate     = 0.027; // kick_power_rate: rate by which the 'Power'
00150                               // argument in a 'kick' command is multiplied
00151                               // (thus determining the amount of displacement of
00152                               // the ball as a result of the 'kick')
00153   dKickRand          = 0.0;   // kick_rand: random error in kick direction
00154 
00155   // parameters related to visual and auditory perception range
00156   dVisibleAngle      = 90.0;  // visible_angle: angle of the view cone of a
00157                               // player in the standard view mode
00158   dAudioCutDist      = 50.0;  // audio_cut_dist: maximum distance over which a
00159                               // spoken message can be heard
00160 
00161   // quantization parameters
00162   dQuantizeStep      = 0.1;   // quantize_step: quantization step for distance
00163                               // of moving objects
00164   dQuantizeStepL     = 0.01;  // quantize_step_l: quantization step for distance
00165                               // of landmarks
00166 
00167   // range parameters for basic actuator commands
00168   iMaxPower          = 100;   // maxpower: maximum power for dash/kick
00169   iMinPower          = -100;  // minpower: minimum power for dash/kick
00170   iMaxMoment         = 180;   // maxmoment: maximum angle for turn/kick
00171   iMinMoment         = -180;  // minmoment: minimum angle for turn/kick
00172   iMaxNeckMoment     = 180;   // maxneckmoment: maximum angle for turnneck
00173   iMinNeckMoment     = -180;  // minneckmoment: minimum angle for turnneck
00174   iMaxNeckAng        = 90;    // maxneckang: maximum neck angle relative to body
00175   iMinNeckAng        = -90;   // minneckang: minimum neck angle relative to body
00176 
00177   // port-related parameters
00178   iPort              = 6000;  // port: port number for player connection
00179   iCoachPort         = 6001;  // coach_port: port number for coach connection
00180 
00181   // coach-related parameters
00182   iSayCoachCntMax    = 128;   // say_coach_cnt_max: maximum number of coach
00183                               // messages possible
00184   iSayCoachMsgSize   = 128;   // say_coach_msg_size: maximum size of coach
00185                               // messages
00186   iClangWinSize      = 300;   // clang_win_size: time window which controls how
00187                               // many coach messages can be sent
00188   iClangDefineWin    = 1;     // clang_define_win: number of define messages by
00189                               // coach per time window
00190   iClangMetaWin      = 1;     // clang_meta_win: number of meta messages by
00191                               // coach per time window
00192   iClangAdviceWin    = 1;     // clang_advice_win: number of advice messages by
00193                               // coach per time window
00194   iClangInfoWin      = 1;     // clang_info_win: number of info messages by
00195                               // coach per time window
00196   iClangMessDelay    = 50;    // clang_mess_delay: delay of coach messages, i.e.
00197                               // the number of cycles between send to player and
00198                               // receival of message
00199   iClangMessPerCycle = 1;     // clang_mess_per_cycle: number of coach messages
00200                               // per cycle
00201   iSendViStep        = 100;   // send_vi_step: interval of coach's look, i.e.
00202                               // the length of the interval (in ms) between
00203                               // visual messages to the coach
00204 
00205   // time-related parameters
00206   iSimulatorStep     = 100;   // simulator_step: the length (in ms) of a
00207                               // simulator cycle
00208   iSendStep          = 150;   // send_step: the length of the interval (in ms)
00209                               // between visual messages to a player in the
00210                               // standard view mode
00211   iRecvStep          = 10;    // recv_step: the length of the interval (in ms)
00212                               // for accepting commands from a player
00213   iHalfTime          = 300;   // half_time: the length (in seconds) of a single
00214                               // game half
00215   iDropBallTime      = 200;   // drop_ball_time: the number of cycles to wait
00216                               // until dropping the ball automatically for free
00217                               // kicks, corner kicks, etc.
00218 
00219   // speech-related parameters
00220   iSayMsgSize        = 512;   // say_msg_size: the maximum length (in bytes) of
00221                               // a spoken message
00222 
00223   // offside-related parameters
00224   bUseOffside            = true; // use_offside: a boolean flag indicating
00225                                  // whether the offside rule should be applied
00226                                  // or not
00227   dOffsideActiveAreaSize = 5.0;  // offside_active_area_size: offside active
00228                                  // area size, i.e. radius of circle around
00229                                  // the ball in which player can be offside
00230   bForbidKickOffOffside  = true; // forbid_kick_off_offside: a boolean flag
00231                                  // indicating whether a kick from offside
00232                                  // position is allowed
00233   dOffsideKickMargin     = 9.15; // offside_kick_margin: offside kick margin
00234                                  // i.e. the minimum distance to the ball for
00235                                  // offending players when a free kick for
00236                                  // offside is taken
00237 
00238   // log-related parameters
00239   bVerbose           = false; // verbose: flag indicating whether verbose mode
00240                               // is active or not; in verbose mode server sends
00241                               // extra error-information
00242   iRecordVersion     = 3;     // record_version: the type of log record
00243   bRecordLog         = true;  // record_log: flag indicating whether log record
00244                               // for game should be created
00245   bSendLog           = true;  // send_log: flag indicating whether send client
00246                               // command log for game should be created
00247   bLogTimes          = false; // log_times: flag indicating whether ms should be
00248                               // written between cycles in log file
00249   strcpy( strLogFile, "server.log" );// server log to store all actions received
00250 
00251   // heterogeneous player parameters from player.conf
00252   iPlayerTypes              = 7;     // player_types: the number of player types
00253                                      // including the default player type
00254   iSubsMax                  = 3;     // subs_max: the maximum number of
00255                                      // substitutions allowed during a game; the
00256                                      // value also indicates the maximum number
00257                                      // of players allowed for each type
00258   dPlayerSpeedMaxDeltaMin   = 0.0;   // player_speed_max_delta_min: minimum
00259                                      // delta for adjusting player_speed_max
00260   dPlayerSpeedMaxDeltaMax   = 0.2;   // player_speed_max_delta_max: maximum
00261                                      // delta for adjusting player_speed_max
00262   dStaminaIncMaxDeltaFactor = -100.0;// stamina_inc_max_delta_factor: amount by
00263                                      // which delta is multiplied for
00264                                      // stamina_inc_max
00265   dPlayerDecayDeltaMin      = 0.0;   // player_decay_delta_min: minimum delta
00266                                      // for adjusting player_decay
00267   dPlayerDecayDeltaMax      = 0.2;   // player_decay_delta_max: maximum delta
00268                                      // for adjusting player_decay
00269   dInertiaMomentDeltaFactor = 25.0;  // inertia_moment_delta_factor: amount by
00270                                      // which delta is multiplied for
00271                                      // inertia_moment
00272   dDashPowerRateDeltaMin    = 0.0;   // dash_power_rate_delta_min: minimum delta
00273                                      // for adjusting dash_power_rate
00274   dDashPowerRateDeltaMax    = 0.002; // dash_power_rate_delta_max: maximum delta
00275                                      // for adjusting dash_power_rate
00276   dPlayerSizeDeltaFactor    = -100.0;// player_size_delta_factor: amount delta
00277                                      // is multiplied by for player_size
00278   dKickableMarginDeltaMin   = 0.0;   // kickable_margin_delta_min: minimum delta
00279                                      // for adjusting kickable_margin
00280   dKickableMarginDeltaMax   = 0.2;   // kickable_margin_delta_max: maximum delta
00281                                      // for adjusting kickable_margin
00282   dKickRandDeltaFactor      = 0.5;   // kick_rand_delta_factor: amount delta is
00283                                      // multiplied by for kick_rand
00284   dExtraStaminaDeltaMin     = 0.0;   // extra_stamina_delta_min: minimum delta
00285                                      // for adjusting extra_stamina
00286   dExtraStaminaDeltaMax     = 100.0; // extra_stamina_delta_max: maximum delta
00287                                      // for adjusting extra_stamina
00288   dEffortMaxDeltaFactor     = -0.002;// effort_max_delta_factor: amount delta is
00289                                      // multiplied by for effort_max
00290   dEffortMinDeltaFactor     = -0.002;// effort_min_delta_factor: amount delta is
00291                                      // multiplied by for effort_min
00292 
00293   // important server parameters not in server.conf or player.conf
00294   dEffortMax         = 1.0; // effort_max: maximum player effort capacity
00295   iSlowDownFactor    = 1;   // slow_down_factor: factor to slow down simulator
00296                             // and send intervals
00297   dVisibleDistance   = 3.0; // visible_distance: distance within which objects
00298                             // are always 'visible' (even when not in view cone)
00299   dExtraStamina      = 0.0; // extra_stamina: extra stamina for heterogeneous
00300                             // player
00301 
00302   // parameters which depend on other values
00303   dMaximalKickDist = dKickableMargin +   // the maximum distance from a player
00304                      dPlayerSize +       // for which the ball is still kickable
00305                      dBallSize;
00306 
00307   // add all the settings, i.e. each parameter
00308   // becomes a new generic value for the class
00309 
00310   // goal-related parameters
00311   addSetting( "goal_width"        , &dGoalWidth       , GENERIC_VALUE_DOUBLE  );
00312 
00313   // player-related parameters
00314   addSetting( "player_size"       , &dPlayerSize      , GENERIC_VALUE_DOUBLE  );
00315   addSetting( "player_decay"      , &dPlayerDecay     , GENERIC_VALUE_DOUBLE  );
00316   addSetting( "player_rand"       , &dPlayerRand      , GENERIC_VALUE_DOUBLE  );
00317   addSetting( "player_weight"     , &dPlayerWeight    , GENERIC_VALUE_DOUBLE  );
00318   addSetting( "player_speed_max"  , &dPlayerSpeedMax  , GENERIC_VALUE_DOUBLE  );
00319   addSetting( "player_accel_max"  , &dPlayerAccelMax  , GENERIC_VALUE_DOUBLE  );
00320 
00321   // stamina-related parameters
00322   addSetting( "stamina_max"       , &dStaminaMax      , GENERIC_VALUE_DOUBLE  );
00323   addSetting( "stamina_inc_max"   , &dStaminaIncMax   , GENERIC_VALUE_DOUBLE  );
00324   addSetting( "recover_dec_thr"   , &dRecoverDecThr   , GENERIC_VALUE_DOUBLE  );
00325   addSetting( "recover_dec"       , &dRecoverDec      , GENERIC_VALUE_DOUBLE  );
00326   addSetting( "recover_min"       , &dRecoverMin      , GENERIC_VALUE_DOUBLE  );
00327   addSetting( "effort_dec_thr"    , &dEffortDecThr    , GENERIC_VALUE_DOUBLE  );
00328   addSetting( "effort_dec"        , &dEffortDec       , GENERIC_VALUE_DOUBLE  );
00329   addSetting( "effort_inc_thr"    , &dEffortIncThr    , GENERIC_VALUE_DOUBLE  );
00330   addSetting( "effort_inc"        , &dEffortInc       , GENERIC_VALUE_DOUBLE  );
00331   addSetting( "effort_min"        , &dEffortMin       , GENERIC_VALUE_DOUBLE  );
00332 
00333   // parameters related to auditory perception
00334   addSetting( "hear_max"          , &iHearMax         , GENERIC_VALUE_INTEGER );
00335   addSetting( "hear_inc"          , &iHearInc         , GENERIC_VALUE_INTEGER );
00336   addSetting( "hear_decay"        , &iHearDecay       , GENERIC_VALUE_INTEGER );
00337 
00338   // parameters related to player turn actions
00339   addSetting( "inertia_moment"    , &dInertiaMoment   , GENERIC_VALUE_DOUBLE  );
00340 
00341   // parameters related to sense_body information
00342   addSetting( "sense_body_step"   , &iSenseBodyStep   , GENERIC_VALUE_INTEGER );
00343 
00344   // goalkeeper-related parameters
00345   addSetting( "catchable_area_l"  , &dCatchableAreaL  , GENERIC_VALUE_DOUBLE  );
00346   addSetting( "catchable_area_w"  , &dCatchableAreaW  , GENERIC_VALUE_DOUBLE  );
00347   addSetting( "catch_probability" , &dCatchProbability, GENERIC_VALUE_DOUBLE  );
00348   addSetting( "catch_ban_cycle"   , &iCatchBanCycle   , GENERIC_VALUE_INTEGER );
00349   addSetting( "goalie_max_moves"  , &iGoalieMaxMoves  , GENERIC_VALUE_INTEGER );
00350 
00351   // ball-related parameters
00352   addSetting( "ball_size"         , &dBallSize        , GENERIC_VALUE_DOUBLE  );
00353   addSetting( "ball_decay"        , &dBallDecay       , GENERIC_VALUE_DOUBLE  );
00354   addSetting( "ball_rand"         , &dBallRand        , GENERIC_VALUE_DOUBLE  );
00355   addSetting( "ball_weight"       , &dBallWeight      , GENERIC_VALUE_DOUBLE  );
00356   addSetting( "ball_speed_max"    , &dBallSpeedMax    , GENERIC_VALUE_DOUBLE  );
00357   addSetting( "ball_accel_max"    , &dBallAccelMax    , GENERIC_VALUE_DOUBLE  );
00358 
00359   // wind-related parameters
00360   addSetting( "wind_force"        , &dWindForce       , GENERIC_VALUE_DOUBLE  );
00361   addSetting( "wind_dir"          , &dWindDir         , GENERIC_VALUE_DOUBLE  );
00362   addSetting( "wind_rand"         , &dWindRand        , GENERIC_VALUE_DOUBLE  );
00363 
00364   // parameters related to 'dash' and 'kick' commands
00365   addSetting( "kickable_margin"   , &dKickableMargin  , GENERIC_VALUE_DOUBLE  );
00366   addSetting( "ckick_margin"      , &dCkickMargin     , GENERIC_VALUE_DOUBLE  );
00367   addSetting( "dash_power_rate"   , &dDashPowerRate   , GENERIC_VALUE_DOUBLE  );
00368   addSetting( "kick_power_rate"   , &dKickPowerRate   , GENERIC_VALUE_DOUBLE  );
00369   addSetting( "kick_rand"         , &dKickRand        , GENERIC_VALUE_DOUBLE  );
00370 
00371   // parameters related to visual and auditory perception range
00372   addSetting( "visible_angle"     , &dVisibleAngle    , GENERIC_VALUE_DOUBLE  );
00373   addSetting( "audio_cut_dist"    , &dAudioCutDist    , GENERIC_VALUE_DOUBLE  );
00374 
00375   // quantization parameters
00376   addSetting( "quantize_step"     , &dQuantizeStep    , GENERIC_VALUE_DOUBLE  );
00377   addSetting( "quantize_step_l"   , &dQuantizeStepL   , GENERIC_VALUE_DOUBLE  );
00378 
00379   // range parameters for basic actuator commands
00380   addSetting( "maxpower"          , &iMaxPower        , GENERIC_VALUE_INTEGER );
00381   addSetting( "minpower"          , &iMinPower        , GENERIC_VALUE_INTEGER );
00382   addSetting( "maxmoment"         , &iMaxMoment       , GENERIC_VALUE_INTEGER );
00383   addSetting( "minmoment"         , &iMinMoment       , GENERIC_VALUE_INTEGER );
00384   addSetting( "maxneckmoment"     , &iMaxNeckMoment   , GENERIC_VALUE_INTEGER );
00385   addSetting( "minneckmoment"     , &iMinNeckMoment   , GENERIC_VALUE_INTEGER );
00386   addSetting( "maxneckang"        , &iMaxNeckAng      , GENERIC_VALUE_INTEGER );
00387   addSetting( "minneckang"        , &iMinNeckAng      , GENERIC_VALUE_INTEGER );
00388 
00389   // port-related parameters
00390   addSetting( "port"              , &iPort            , GENERIC_VALUE_INTEGER );
00391   addSetting( "coach_port"        , &iCoachPort       , GENERIC_VALUE_INTEGER );
00392 
00393   // coach-related parameters
00394   addSetting( "say_coach_cnt_max" , &iSayCoachCntMax  , GENERIC_VALUE_INTEGER );
00395   addSetting( "say_coach_msg_size", &iSayCoachMsgSize , GENERIC_VALUE_INTEGER );
00396   addSetting( "clang_win_size"    , &iClangWinSize    , GENERIC_VALUE_INTEGER );
00397   addSetting( "clang_define_win"  , &iClangDefineWin  , GENERIC_VALUE_INTEGER );
00398   addSetting( "clang_meta_win"    , &iClangMetaWin    , GENERIC_VALUE_INTEGER );
00399   addSetting( "clang_advice_win"  , &iClangAdviceWin  , GENERIC_VALUE_INTEGER );
00400   addSetting( "clang_info_win"    , &iClangInfoWin    , GENERIC_VALUE_INTEGER );
00401   addSetting( "clang_mess_delay"  , &iClangMessDelay  , GENERIC_VALUE_INTEGER );
00402   addSetting( "clang_mess_per_cycle",&iClangMessPerCycle,GENERIC_VALUE_INTEGER);
00403   addSetting( "send_vi_step"      , &iSendViStep      , GENERIC_VALUE_INTEGER );
00404 
00405   // time-related parameters
00406   addSetting( "simulator_step"    , &iSimulatorStep   , GENERIC_VALUE_INTEGER );
00407   addSetting( "send_step"         , &iSendStep        , GENERIC_VALUE_INTEGER );
00408   addSetting( "recv_step"         , &iRecvStep        , GENERIC_VALUE_INTEGER );
00409   addSetting( "half_time"         , &iHalfTime        , GENERIC_VALUE_INTEGER );
00410   addSetting( "drop_ball_time"    , &iDropBallTime    , GENERIC_VALUE_INTEGER );
00411 
00412   // speech-related parameters
00413   addSetting( "say_msg_size"      , &iSayMsgSize      , GENERIC_VALUE_INTEGER );
00414 
00415   // offside-related parameters
00416   addSetting( "use_offside"       , &bUseOffside      , GENERIC_VALUE_BOOLEAN );
00417   addSetting( "offside_active_area_size", &dOffsideActiveAreaSize,
00418                                                         GENERIC_VALUE_DOUBLE  );
00419   addSetting( "forbid_kick_off_offside" , &bForbidKickOffOffside ,
00420                                                         GENERIC_VALUE_BOOLEAN );
00421   addSetting( "offside_kick_margin",&dOffsideKickMargin,GENERIC_VALUE_DOUBLE  );
00422 
00423   // log-related parameters
00424   addSetting( "verbose"           , &bVerbose         , GENERIC_VALUE_BOOLEAN );
00425   addSetting( "record_version"    , &iRecordVersion   , GENERIC_VALUE_INTEGER );
00426   addSetting( "record_log"        , &bRecordLog       , GENERIC_VALUE_BOOLEAN );
00427   addSetting( "send_log"          , &bSendLog         , GENERIC_VALUE_BOOLEAN );
00428   addSetting( "log_times"         , &bLogTimes        , GENERIC_VALUE_BOOLEAN );
00429   addSetting( "log_file"          , &strLogFile       , GENERIC_VALUE_STRING  );
00430 
00431   // heterogeneous player parameters from player.conf
00432   addSetting( "player_types"      , &iPlayerTypes     , GENERIC_VALUE_INTEGER );
00433   addSetting( "subs_max"          , &iSubsMax         , GENERIC_VALUE_INTEGER );
00434   addSetting( "player_speed_max_delta_min"  , &dPlayerSpeedMaxDeltaMin  ,
00435                                                         GENERIC_VALUE_DOUBLE  );
00436   addSetting( "player_speed_max_delta_max"  , &dPlayerSpeedMaxDeltaMax  ,
00437                                                         GENERIC_VALUE_DOUBLE  );
00438   addSetting( "stamina_inc_max_delta_factor", &dStaminaIncMaxDeltaFactor,
00439                                                         GENERIC_VALUE_DOUBLE  );
00440   addSetting( "player_decay_delta_min"      , &dPlayerDecayDeltaMin     ,
00441                                                         GENERIC_VALUE_DOUBLE  );
00442   addSetting( "player_decay_delta_max"      , &dPlayerDecayDeltaMax     ,
00443                                                         GENERIC_VALUE_DOUBLE  );
00444   addSetting( "inertia_moment_delta_factor" , &dInertiaMomentDeltaFactor,
00445                                                         GENERIC_VALUE_DOUBLE  );
00446   addSetting( "dash_power_rate_delta_min"   , &dDashPowerRateDeltaMin   ,
00447                                                         GENERIC_VALUE_DOUBLE  );
00448   addSetting( "dash_power_rate_delta_max"   , &dDashPowerRateDeltaMax   ,
00449                                                         GENERIC_VALUE_DOUBLE  );
00450   addSetting( "player_size_delta_factor"    , &dPlayerSizeDeltaFactor   ,
00451                                                         GENERIC_VALUE_DOUBLE  );
00452   addSetting( "kickable_margin_delta_min"   , &dKickableMarginDeltaMin  ,
00453                                                         GENERIC_VALUE_DOUBLE  );
00454   addSetting( "kickable_margin_delta_max"   , &dKickableMarginDeltaMax  ,
00455                                                         GENERIC_VALUE_DOUBLE  );
00456   addSetting( "kick_rand_delta_factor"      , &dKickRandDeltaFactor     ,
00457                                                         GENERIC_VALUE_DOUBLE  );
00458   addSetting( "extra_stamina_delta_min"     , &dExtraStaminaDeltaMin    ,
00459                                                         GENERIC_VALUE_DOUBLE  );
00460   addSetting( "extra_stamina_delta_max"     , &dExtraStaminaDeltaMax    ,
00461                                                         GENERIC_VALUE_DOUBLE  );
00462   addSetting( "effort_max_delta_factor"     , &dEffortMaxDeltaFactor    ,
00463                                                         GENERIC_VALUE_DOUBLE  );
00464   addSetting( "effort_min_delta_factor"     , &dEffortMinDeltaFactor    ,
00465                                                         GENERIC_VALUE_DOUBLE  );
00466 
00467   // important server parameters not in server.conf or player.conf
00468   addSetting( "effort_max"        , &dEffortMax       , GENERIC_VALUE_DOUBLE  );
00469   addSetting( "slow_down_factor"  , &iSlowDownFactor  , GENERIC_VALUE_INTEGER );
00470   addSetting( "visible_distance"  , &dVisibleDistance , GENERIC_VALUE_DOUBLE  );
00471   addSetting( "extra_stamina"     , &dExtraStamina    , GENERIC_VALUE_DOUBLE  );
00472 
00473   // parameters which depend on other values
00474   addSetting( "dMaximalKickDist"  , &dMaximalKickDist , GENERIC_VALUE_DOUBLE  );
00475 }
00476 
00485 bool ServerSettings::setValue( const char *strName, const char *strValue )
00486 {
00487   // call to the superclass method
00488   bool bReturn = GenericValues::setValue( strName, strValue );
00489   // compute values for parameters which depend on others (reason for override)
00490   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00491 
00492   return ( bReturn );
00493 }
00494 
00502 bool ServerSettings::readValues( char *strFileName, char *strSeparator )
00503 {
00504   // call to the superclass method
00505   bool bReturn = GenericValues::readValues( strFileName, strSeparator );
00506   // compute values for parameters which depend on others (reason for override)
00507   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00508 
00509   return ( bReturn );
00510 }
00511 
00515 bool ServerSettings::setGoalWidth( double d )
00516 {
00517   dGoalWidth = d;
00518   return ( true );
00519 }
00520 
00523 double ServerSettings::getGoalWidth( ) const
00524 {
00525   return ( dGoalWidth );
00526 }
00527 
00531 bool ServerSettings::setPlayerSize( double d )
00532 {
00533   dPlayerSize = d;
00534   // NOTE: also update parameters for which the value depends on this variable
00535   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00536 
00537   return ( true );
00538 }
00539 
00542 double ServerSettings::getPlayerSize( ) const
00543 {
00544   return ( dPlayerSize );
00545 }
00546 
00550 bool ServerSettings::setPlayerDecay( double d )
00551 {
00552   dPlayerDecay = d;
00553   return ( true );
00554 }
00555 
00558 double ServerSettings::getPlayerDecay( ) const
00559 {
00560   return ( dPlayerDecay );
00561 }
00562 
00566 bool ServerSettings::setPlayerRand( double d )
00567 {
00568   dPlayerRand = d;
00569   return ( true );
00570 }
00571 
00574 double ServerSettings::getPlayerRand( ) const
00575 {
00576   return ( dPlayerRand );
00577 }
00578 
00582 bool ServerSettings::setPlayerWeight( double d )
00583 {
00584   dPlayerWeight = d;
00585   return ( true );
00586 }
00587 
00590 double ServerSettings::getPlayerWeight( ) const
00591 {
00592   return ( dPlayerWeight );
00593 }
00594 
00598 bool ServerSettings::setPlayerSpeedMax( double d )
00599 {
00600   dPlayerSpeedMax = d;
00601   return ( true );
00602 }
00603 
00606 double ServerSettings::getPlayerSpeedMax( ) const
00607 {
00608   return ( dPlayerSpeedMax );
00609 }
00610 
00615 bool ServerSettings::setPlayerAccelMax( double d )
00616 {
00617   dPlayerAccelMax = d;
00618   return ( true );
00619 }
00620 
00623 double ServerSettings::getPlayerAccelMax( ) const
00624 {
00625   return ( dPlayerAccelMax );
00626 }
00627 
00631 bool ServerSettings::setStaminaMax( double d )
00632 {
00633   dStaminaMax = d;
00634   return ( true );
00635 }
00636 
00639 double ServerSettings::getStaminaMax( ) const
00640 {
00641   return ( dStaminaMax );
00642 }
00643 
00648 bool ServerSettings::setStaminaIncMax( double d )
00649 {
00650   dStaminaIncMax = d;
00651   return ( true );
00652 }
00653 
00656 double ServerSettings::getStaminaIncMax( ) const
00657 {
00658   return ( dStaminaIncMax );
00659 }
00660 
00665 bool ServerSettings::setRecoverDecThr( double d )
00666 {
00667   dRecoverDecThr = d;
00668   return ( true );
00669 }
00670 
00673 double ServerSettings::getRecoverDecThr( ) const
00674 {
00675   return ( dRecoverDecThr );
00676 }
00677 
00682 bool ServerSettings::setRecoverDec( double d )
00683 {
00684   dRecoverDec = d;
00685   return ( true );
00686 }
00687 
00690 double ServerSettings::getRecoverDec( ) const
00691 {
00692   return ( dRecoverDec );
00693 }
00694 
00698 bool ServerSettings::setRecoverMin( double d )
00699 {
00700   dRecoverMin = d;
00701   return ( true );
00702 }
00703 
00706 double ServerSettings::getRecoverMin( ) const
00707 {
00708   return ( dRecoverMin );
00709 }
00710 
00715 bool ServerSettings::setEffortDecThr( double d )
00716 {
00717   dEffortDecThr = d;
00718   return ( true );
00719 }
00720 
00724 double ServerSettings::getEffortDecThr( ) const
00725 {
00726   return ( dEffortDecThr );
00727 }
00728 
00733 bool ServerSettings::setEffortDec( double d )
00734 {
00735   dEffortDec = d;
00736   return ( true );
00737 }
00738 
00741 double ServerSettings::getEffortDec( ) const
00742 {
00743   return ( dEffortDec );
00744 }
00745 
00750 bool ServerSettings::setEffortIncThr( double d )
00751 {
00752   dEffortIncThr = d;
00753   return ( true );
00754 }
00755 
00759 double ServerSettings::getEffortIncThr( ) const
00760 {
00761   return ( dEffortIncThr );
00762 }
00763 
00768 bool ServerSettings::setEffortInc( double d )
00769 {
00770   dEffortInc = d;
00771   return ( true );
00772 }
00773 
00776 double ServerSettings::getEffortInc( ) const
00777 {
00778   return ( dEffortInc );
00779 }
00780 
00784 bool ServerSettings::setEffortMin( double d )
00785 {
00786   dEffortMin = d;
00787   return ( true );
00788 }
00789 
00792 double ServerSettings::getEffortMin( ) const
00793 {
00794   return ( dEffortMin );
00795 }
00796 
00801 bool ServerSettings::setHearMax( int i )
00802 {
00803   iHearMax = i;
00804   return ( true );
00805 }
00806 
00810 int ServerSettings::getHearMax( ) const
00811 {
00812   return ( iHearMax );
00813 }
00814 
00820 bool ServerSettings::setHearInc( int i )
00821 {
00822   iHearInc = i;
00823   return ( true );
00824 }
00825 
00829 int ServerSettings::getHearInc( ) const
00830 {
00831   return ( iHearInc );
00832 }
00833 
00838 bool ServerSettings::setHearDecay( int i )
00839 {
00840   iHearDecay = i;
00841   return ( true );
00842 }
00843 
00847 int ServerSettings::getHearDecay( ) const
00848 {
00849   return ( iHearDecay );
00850 }
00851 
00856 bool ServerSettings::setInertiaMoment( double d )
00857 {
00858   dInertiaMoment = d;
00859   return ( true );
00860 }
00861 
00865 double ServerSettings::getInertiaMoment( ) const
00866 {
00867   return ( dInertiaMoment );
00868 }
00869 
00874 bool ServerSettings::setSenseBodyStep( int i )
00875 {
00876   iSenseBodyStep = i;
00877   return ( true );
00878 }
00879 
00883 int ServerSettings::getSenseBodyStep( ) const
00884 {
00885   // NOTE: take slow down factor into account for send intervals
00886   return ( iSenseBodyStep * iSlowDownFactor );
00887 }
00888 
00893 bool ServerSettings::setCatchableAreaL( double d )
00894 {
00895   dCatchableAreaL = d;
00896   return ( true );
00897 }
00898 
00902 double ServerSettings::getCatchableAreaL( ) const
00903 {
00904   return ( dCatchableAreaL );
00905 }
00906 
00911 bool ServerSettings::setCatchableAreaW( double d )
00912 {
00913   dCatchableAreaW = d;
00914   return ( true );
00915 }
00916 
00920 double ServerSettings::getCatchableAreaW( ) const
00921 {
00922   return ( dCatchableAreaW );
00923 }
00924 
00929 bool ServerSettings::setCatchProbability( double d )
00930 {
00931   dCatchProbability = d;
00932   return ( true );
00933 }
00934 
00937 double ServerSettings::getCatchProbability( ) const
00938 {
00939   return ( dCatchProbability );
00940 }
00941 
00946 bool ServerSettings::setCatchBanCycle( int i )
00947 {
00948   iCatchBanCycle = i;
00949   return ( true );
00950 }
00951 
00955 int ServerSettings::getCatchBanCycle( ) const
00956 {
00957   return ( iCatchBanCycle );
00958 }
00959 
00964 bool ServerSettings::setGoalieMaxMoves( int i )
00965 {
00966   iGoalieMaxMoves = i;
00967   return ( true );
00968 }
00969 
00973 int ServerSettings::getGoalieMaxMoves( ) const
00974 {
00975   return ( iGoalieMaxMoves );
00976 }
00977 
00981 bool ServerSettings::setBallSize( double d )
00982 {
00983   dBallSize = d;
00984   // NOTE: also update parameters for which the value depends on this variable
00985   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00986 
00987   return ( true );
00988 }
00989 
00992 double ServerSettings::getBallSize( ) const
00993 {
00994   return ( dBallSize );
00995 }
00996 
01000 bool ServerSettings::setBallDecay( double d )
01001 {
01002   dBallDecay = d;
01003   return ( true );
01004 }
01005 
01008 double ServerSettings::getBallDecay( ) const
01009 {
01010   return ( dBallDecay );
01011 }
01012 
01016 bool ServerSettings::setBallRand( double d )
01017 {
01018   dBallRand = d;
01019   return ( true );
01020 }
01021 
01024 double ServerSettings::getBallRand( ) const
01025 {
01026   return ( dBallRand );
01027 }
01028 
01032 bool ServerSettings::setBallWeight( double d )
01033 {
01034   dBallWeight = d;
01035   return ( true );
01036 }
01037 
01040 double ServerSettings::getBallWeight( ) const
01041 {
01042   return ( dBallWeight );
01043 }
01044 
01048 bool ServerSettings::setBallSpeedMax( double d )
01049 {
01050   dBallSpeedMax = d;
01051   return ( true );
01052 }
01053 
01056 double ServerSettings::getBallSpeedMax( ) const
01057 {
01058   return ( dBallSpeedMax );
01059 }
01060 
01065 bool ServerSettings::setBallAccelMax( double d )
01066 {
01067   dBallAccelMax = d;
01068   return ( true );
01069 }
01070 
01073 double ServerSettings::getBallAccelMax( ) const
01074 {
01075   return ( dBallAccelMax );
01076 }
01077 
01081 bool ServerSettings::setWindForce( double d )
01082 {
01083   dWindForce = d;
01084   return ( true );
01085 }
01086 
01089 double ServerSettings::getWindForce( ) const
01090 {
01091   return ( dWindForce );
01092 }
01093 
01097 bool ServerSettings::setWindDir( double d )
01098 {
01099   dWindDir = d;
01100   return ( true );
01101 }
01102 
01105 double ServerSettings::getWindDir( ) const
01106 {
01107   return ( dWindDir );
01108 }
01109 
01113 bool ServerSettings::setWindRand( double d )
01114 {
01115   dWindRand = d;
01116   return ( true );
01117 }
01118 
01121 double ServerSettings::getWindRand( ) const
01122 {
01123   return ( dWindRand );
01124 }
01125 
01131 bool ServerSettings::setKickableMargin( double d )
01132 {
01133   dKickableMargin = d;
01134   // NOTE: also update parameters for which the value depends on this variable
01135   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
01136 
01137   return ( true );
01138 }
01139 
01143 double ServerSettings::getKickableMargin( ) const
01144 {
01145   return ( dKickableMargin );
01146 }
01147 
01153 bool ServerSettings::setCkickMargin( double d )
01154 {
01155   dCkickMargin = d;
01156   return ( true );
01157 }
01158 
01162 double ServerSettings::getCkickMargin( ) const
01163 {
01164   return ( dCkickMargin );
01165 }
01166 
01172 bool ServerSettings::setDashPowerRate( double d )
01173 {
01174   dDashPowerRate = d;
01175   return ( true );
01176 }
01177 
01182 double ServerSettings::getDashPowerRate( ) const
01183 {
01184   return ( dDashPowerRate );
01185 }
01186 
01192 bool ServerSettings::setKickPowerRate( double d )
01193 {
01194   dKickPowerRate = d;
01195   return ( true );
01196 }
01197 
01202 double ServerSettings::getKickPowerRate( ) const
01203 {
01204   return ( dKickPowerRate );
01205 }
01206 
01210 bool ServerSettings::setKickRand( double d )
01211 {
01212   dKickRand = d;
01213   return ( true );
01214 }
01215 
01218 double ServerSettings::getKickRand( ) const
01219 {
01220   return ( dKickRand );
01221 }
01222 
01227 bool ServerSettings::setVisibleAngle( double d )
01228 {
01229   dVisibleAngle = d;
01230   return ( true );
01231 }
01232 
01235 double ServerSettings::getVisibleAngle( ) const
01236 {
01237   return ( dVisibleAngle );
01238 }
01239 
01244 bool ServerSettings::setAudioCutDist( double d )
01245 {
01246   dAudioCutDist = d;
01247   return ( true );
01248 }
01249 
01252 double ServerSettings::getAudioCutDist( ) const
01253 {
01254   return ( dAudioCutDist );
01255 }
01256 
01261 bool ServerSettings::setQuantizeStep( double d )
01262 {
01263   dQuantizeStep = d;
01264   return ( true );
01265 }
01266 
01269 double ServerSettings::getQuantizeStep( ) const
01270 {
01271   return ( dQuantizeStep );
01272 }
01273 
01278 bool ServerSettings::setQuantizeStepL( double d )
01279 {
01280   dQuantizeStepL = d;
01281   return ( true );
01282 }
01283 
01286 double ServerSettings::getQuantizeStepL( ) const
01287 {
01288   return ( dQuantizeStepL );
01289 }
01290 
01294 bool ServerSettings::setMaxPower( int i )
01295 {
01296   iMaxPower = i;
01297   return ( true );
01298 }
01299 
01302 int ServerSettings::getMaxPower( ) const
01303 {
01304   return ( iMaxPower );
01305 }
01306 
01310 bool ServerSettings::setMinPower( int i )
01311 {
01312   iMinPower = i;
01313   return ( true );
01314 }
01315 
01318 int ServerSettings::getMinPower( ) const
01319 {
01320   return ( iMinPower );
01321 }
01322 
01326 bool ServerSettings::setMaxMoment( int i )
01327 {
01328   iMaxMoment = i;
01329   return ( true );
01330 }
01331 
01334 int ServerSettings::getMaxMoment( ) const
01335 {
01336   return ( iMaxMoment );
01337 }
01338 
01342 bool ServerSettings::setMinMoment( int i )
01343 {
01344   iMinMoment = i;
01345   return ( true );
01346 }
01347 
01350 int ServerSettings::getMinMoment( ) const
01351 {
01352   return ( iMinMoment );
01353 }
01354 
01358 bool ServerSettings::setMaxNeckMoment( int i )
01359 {
01360   iMaxNeckMoment = i;
01361   return ( true );
01362 }
01363 
01366 int ServerSettings::getMaxNeckMoment( ) const
01367 {
01368   return ( iMaxNeckMoment );
01369 }
01370 
01374 bool ServerSettings::setMinNeckMoment( int i )
01375 {
01376   iMinNeckMoment = i;
01377   return ( true );
01378 }
01379 
01382 int ServerSettings::getMinNeckMoment( ) const
01383 {
01384   return ( iMinNeckMoment );
01385 }
01386 
01390 bool ServerSettings::setMaxNeckAng( int i )
01391 {
01392   iMaxNeckAng = i;
01393   return ( true );
01394 }
01395 
01398 int ServerSettings::getMaxNeckAng( ) const
01399 {
01400   return ( iMaxNeckAng );
01401 }
01402 
01406 bool ServerSettings::setMinNeckAng( int i )
01407 {
01408   iMinNeckAng = i;
01409   return ( true );
01410 }
01411 
01414 int ServerSettings::getMinNeckAng( ) const
01415 {
01416   return ( iMinNeckAng );
01417 }
01418 
01423 bool ServerSettings::setPort( int i )
01424 {
01425   iPort = i;
01426   return ( true );
01427 }
01428 
01431 int ServerSettings::getPort( ) const
01432 {
01433   return ( iPort );
01434 }
01435 
01440 bool ServerSettings::setCoachPort( int i )
01441 {
01442   iCoachPort = i;
01443   return ( true );
01444 }
01445 
01448 int ServerSettings::getCoachPort( ) const
01449 {
01450   return ( iCoachPort );
01451 }
01452 
01457 bool ServerSettings::setSayCoachCntMax( int i )
01458 {
01459   iSayCoachCntMax = i;
01460   return ( true );
01461 }
01462 
01465 int ServerSettings::getSayCoachCntMax( ) const
01466 {
01467   return ( iSayCoachCntMax );
01468 }
01469 
01473 bool ServerSettings::setSayCoachMsgSize( int i )
01474 {
01475   iSayCoachMsgSize = i;
01476   return ( true );
01477 }
01478 
01481 int ServerSettings::getSayCoachMsgSize( ) const
01482 {
01483   return ( iSayCoachMsgSize );
01484 }
01485 
01490 bool ServerSettings::setClangWinSize( int i )
01491 {
01492   iClangWinSize = i;
01493   return ( true );
01494 }
01495 
01498 int ServerSettings::getClangWinSize( ) const
01499 {
01500   return ( iClangWinSize );
01501 }
01502 
01507 bool ServerSettings::setClangDefineWin( int i )
01508 {
01509   iClangDefineWin = i;
01510   return ( true );
01511 }
01512 
01515 int ServerSettings::getClangDefineWin( ) const
01516 {
01517   return ( iClangDefineWin );
01518 }
01519 
01524 bool ServerSettings::setClangMetaWin( int i )
01525 {
01526   iClangMetaWin = i;
01527   return ( true );
01528 }
01529 
01532 int ServerSettings::getClangMetaWin( ) const
01533 {
01534   return ( iClangMetaWin );
01535 }
01536 
01541 bool ServerSettings::setClangAdviceWin( int i )
01542 {
01543   iClangAdviceWin = i;
01544   return ( true );
01545 }
01546 
01549 int ServerSettings::getClangAdviceWin( ) const
01550 {
01551   return ( iClangAdviceWin );
01552 }
01553 
01558 bool ServerSettings::setClangInfoWin( int i )
01559 {
01560   iClangInfoWin = i;
01561   return ( true );
01562 }
01563 
01566 int ServerSettings::getClangInfoWin( ) const
01567 {
01568   return ( iClangInfoWin );
01569 }
01570 
01576 bool ServerSettings::setClangMessDelay( int i )
01577 {
01578   iClangMessDelay = i;
01579   return ( true );
01580 }
01581 
01585 int ServerSettings::getClangMessDelay( ) const
01586 {
01587   return ( iClangMessDelay );
01588 }
01589 
01594 bool ServerSettings::setClangMessPerCycle( int i )
01595 {
01596   iClangMessPerCycle = i;
01597   return ( true );
01598 }
01599 
01602 int ServerSettings::getClangMessPerCycle( ) const
01603 {
01604   return ( iClangMessPerCycle );
01605 }
01606 
01612 bool ServerSettings::setSendViStep( int i )
01613 {
01614   iSendViStep = i;
01615   return ( true );
01616 }
01617 
01621 int ServerSettings::getSendViStep( ) const
01622 {
01623   // NOTE: take slow down factor into account for send intervals
01624   return ( iSendViStep * iSlowDownFactor );
01625 }
01626 
01631 bool ServerSettings::setSimulatorStep( int i )
01632 {
01633   iSimulatorStep = i;
01634   return ( true );
01635 }
01636 
01639 int ServerSettings::getSimulatorStep( ) const
01640 {
01641   // NOTE: take slow down factor into account for send intervals
01642   return ( iSimulatorStep * iSlowDownFactor );
01643 }
01644 
01649 bool ServerSettings::setSendStep( int i )
01650 {
01651   iSendStep = i;
01652   return ( true );
01653 }
01654 
01658 int ServerSettings::getSendStep( ) const
01659 {
01660   // NOTE: take slow down factor into account for send intervals
01661   return ( iSendStep * iSlowDownFactor );
01662 }
01663 
01668 bool ServerSettings::setRecvStep( int i )
01669 {
01670   iRecvStep = i;
01671   return ( true );
01672 }
01673 
01677 int ServerSettings::getRecvStep( ) const
01678 {
01679   return ( iRecvStep );
01680 }
01681 
01686 bool ServerSettings::setHalfTime( int i )
01687 {
01688   iHalfTime = i;
01689   return ( true );
01690 }
01691 
01694 int ServerSettings::getHalfTime( ) const
01695 {
01696   return ( iHalfTime );
01697 }
01698 
01703 bool ServerSettings::setDropBallTime( int i )
01704 {
01705   iDropBallTime = i;
01706   return ( true );
01707 }
01708 
01712 int ServerSettings::getDropBallTime( ) const
01713 {
01714   return ( iDropBallTime );
01715 }
01716 
01721 bool ServerSettings::setSayMsgSize( int i )
01722 {
01723   iSayMsgSize = i;
01724   return ( true );
01725 }
01726 
01729 int ServerSettings::getSayMsgSize( ) const
01730 {
01731   return ( iSayMsgSize );
01732 }
01733 
01738 bool ServerSettings::setUseOffside( bool b )
01739 {
01740   bUseOffside = b;
01741   return ( true );
01742 }
01743 
01747 bool ServerSettings::getUseOffside( ) const
01748 {
01749   return ( bUseOffside );
01750 }
01751 
01756 bool ServerSettings::setOffsideActiveAreaSize( double d )
01757 {
01758   dOffsideActiveAreaSize = d;
01759   return ( true );
01760 }
01761 
01765 double ServerSettings::getOffsideActiveAreaSize( ) const
01766 {
01767   return ( dOffsideActiveAreaSize );
01768 }
01769 
01774 bool ServerSettings::setForbidKickOffOffside( bool b )
01775 {
01776   bForbidKickOffOffside = b;
01777   return ( true );
01778 }
01779 
01783 bool ServerSettings::getForbidKickOffOffside( ) const
01784 {
01785   return ( bForbidKickOffOffside );
01786 }
01787 
01793 bool ServerSettings::setOffsideKickMargin( double d )
01794 {
01795   dOffsideKickMargin = d;
01796   return ( true );
01797 }
01798 
01802 double ServerSettings::getOffsideKickMargin( ) const
01803 {
01804   return ( dOffsideKickMargin );
01805 }
01806 
01811 bool ServerSettings::setVerbose( bool b )
01812 {
01813   bVerbose = b;
01814   return ( true );
01815 }
01816 
01820 bool ServerSettings::getVerbose( ) const
01821 {
01822   return ( bVerbose );
01823 }
01824 
01828 bool ServerSettings::setRecordVersion( int i )
01829 {
01830   iRecordVersion = i;
01831   return ( true );
01832 }
01833 
01836 int ServerSettings::getRecordVersion( ) const
01837 {
01838   return ( iRecordVersion );
01839 }
01840 
01845 bool ServerSettings::setRecordLog( bool b )
01846 {
01847   bRecordLog = b;
01848   return ( true );
01849 }
01850 
01854 bool ServerSettings::getRecordLog( ) const
01855 {
01856   return ( bRecordLog );
01857 }
01858 
01863 bool ServerSettings::setSendLog( bool b )
01864 {
01865   bSendLog = b;
01866   return ( true );
01867 }
01868 
01872 bool ServerSettings::getSendLog( ) const
01873 {
01874   return ( bSendLog );
01875 }
01876 
01881 bool ServerSettings::setLogTimes( bool b )
01882 {
01883   bLogTimes = b;
01884   return ( true );
01885 }
01886 
01890 bool ServerSettings::getLogTimes( ) const
01891 {
01892   return ( bLogTimes );
01893 }
01894 
01899 bool ServerSettings::setLogFile( char *str )
01900 {
01901   strcpy( strLogFile, str );
01902   return ( true );
01903 }
01904 
01907 char* ServerSettings::getLogFile( )
01908 {
01909   return ( strLogFile );
01910 }
01911 
01916 bool ServerSettings::setPlayerTypes( int i )
01917 {
01918   iPlayerTypes = i;
01919   return ( true );
01920 }
01921 
01924 int ServerSettings::getPlayerTypes( ) const
01925 {
01926   return ( iPlayerTypes );
01927 }
01928 
01934 bool ServerSettings::setSubsMax( int i )
01935 {
01936   iSubsMax = i;
01937   return ( true );
01938 }
01939 
01943 int ServerSettings::getSubsMax( ) const
01944 {
01945   return ( iSubsMax );
01946 }
01947 
01952 bool ServerSettings::setPlayerSpeedMaxDeltaMin( double d )
01953 {
01954   dPlayerSpeedMaxDeltaMin = d;
01955   return ( true );
01956 }
01957 
01960 double ServerSettings::getPlayerSpeedMaxDeltaMin( ) const
01961 {
01962   return ( dPlayerSpeedMaxDeltaMin );
01963 }
01964 
01969 bool ServerSettings::setPlayerSpeedMaxDeltaMax( double d )
01970 {
01971   dPlayerSpeedMaxDeltaMax = d;
01972   return ( true );
01973 }
01974 
01977 double ServerSettings::getPlayerSpeedMaxDeltaMax( ) const
01978 {
01979   return ( dPlayerSpeedMaxDeltaMax );
01980 }
01981 
01986 bool ServerSettings::setStaminaIncMaxDeltaFactor( double d )
01987 {
01988   dStaminaIncMaxDeltaFactor = d;
01989   return ( true );
01990 }
01991 
01994 double ServerSettings::getStaminaIncMaxDeltaFactor( ) const
01995 {
01996   return ( dStaminaIncMaxDeltaFactor );
01997 }
01998 
02003 bool ServerSettings::setPlayerDecayDeltaMin( double d )
02004 {
02005   dPlayerDecayDeltaMin = d;
02006   return ( true );
02007 }
02008 
02011 double ServerSettings::getPlayerDecayDeltaMin( ) const
02012 {
02013   return ( dPlayerDecayDeltaMin );
02014 }
02015 
02020 bool ServerSettings::setPlayerDecayDeltaMax( double d )
02021 {
02022   dPlayerDecayDeltaMax = d;
02023   return ( true );
02024 }
02025 
02028 double ServerSettings::getPlayerDecayDeltaMax( ) const
02029 {
02030   return ( dPlayerDecayDeltaMax );
02031 }
02032 
02037 bool ServerSettings::setInertiaMomentDeltaFactor( double d )
02038 {
02039   dInertiaMomentDeltaFactor = d;
02040   return ( true );
02041 }
02042 
02045 double ServerSettings::getInertiaMomentDeltaFactor( ) const
02046 {
02047   return ( dInertiaMomentDeltaFactor );
02048 }
02049 
02054 bool ServerSettings::setDashPowerRateDeltaMin( double d )
02055 {
02056   dDashPowerRateDeltaMin = d;
02057   return ( true );
02058 }
02059 
02062 double ServerSettings::getDashPowerRateDeltaMin( ) const
02063 {
02064   return ( dDashPowerRateDeltaMin );
02065 }
02066 
02071 bool ServerSettings::setDashPowerRateDeltaMax( double d )
02072 {
02073   dDashPowerRateDeltaMax = d;
02074   return ( true );
02075 }
02076 
02079 double ServerSettings::getDashPowerRateDeltaMax( ) const
02080 {
02081   return ( dDashPowerRateDeltaMax );
02082 }
02083 
02088 bool ServerSettings::setPlayerSizeDeltaFactor( double d )
02089 {
02090   dPlayerSizeDeltaFactor = d;
02091   return ( true );
02092 }
02093 
02096 double ServerSettings::getPlayerSizeDeltaFactor( ) const
02097 {
02098   return ( dPlayerSizeDeltaFactor );
02099 }
02100 
02105 bool ServerSettings::setKickableMarginDeltaMin( double d )
02106 {
02107   dKickableMarginDeltaMin = d;
02108   return ( true );
02109 }
02110 
02113 double ServerSettings::getKickableMarginDeltaMin( ) const
02114 {
02115   return ( dKickableMarginDeltaMin );
02116 }
02117 
02122 bool ServerSettings::setKickableMarginDeltaMax( double d )
02123 {
02124   dKickableMarginDeltaMax = d;
02125   return ( true );
02126 }
02127 
02130 double ServerSettings::getKickableMarginDeltaMax( ) const
02131 {
02132   return ( dKickableMarginDeltaMax );
02133 }
02134 
02139 bool ServerSettings::setKickRandDeltaFactor( double d )
02140 {
02141   dKickRandDeltaFactor = d;
02142   return ( true );
02143 }
02144 
02147 double ServerSettings::getKickRandDeltaFactor( ) const
02148 {
02149   return ( dKickRandDeltaFactor );
02150 }
02151 
02156 bool ServerSettings::setExtraStaminaDeltaMin( double d )
02157 {
02158   dExtraStaminaDeltaMin = d;
02159   return ( true );
02160 }
02161 
02164 double ServerSettings::getExtraStaminaDeltaMin( ) const
02165 {
02166   return ( dExtraStaminaDeltaMin );
02167 }
02168 
02173 bool ServerSettings::setExtraStaminaDeltaMax( double d )
02174 {
02175   dExtraStaminaDeltaMax = d;
02176   return ( true );
02177 }
02178 
02181 double ServerSettings::getExtraStaminaDeltaMax( ) const
02182 {
02183   return ( dExtraStaminaDeltaMax );
02184 }
02185 
02190 bool ServerSettings::setEffortMaxDeltaFactor( double d )
02191 {
02192   dEffortMaxDeltaFactor = d;
02193   return ( true );
02194 }
02195 
02198 double ServerSettings::getEffortMaxDeltaFactor( ) const
02199 {
02200   return ( dEffortMaxDeltaFactor );
02201 }
02202 
02207 bool ServerSettings::setEffortMinDeltaFactor( double d )
02208 {
02209   dEffortMinDeltaFactor = d;
02210   return ( true );
02211 }
02212 
02215 double ServerSettings::getEffortMinDeltaFactor( ) const
02216 {
02217   return ( dEffortMinDeltaFactor );
02218 }
02219 
02223 bool ServerSettings::setEffortMax( double d )
02224 {
02225   dEffortMax = d;
02226   return ( true );
02227 }
02228 
02231 double ServerSettings::getEffortMax(  ) const
02232 {
02233   return ( dEffortMax );
02234 }
02235 
02240 bool ServerSettings::setSlowDownFactor( int i )
02241 {
02242   iSlowDownFactor = i;
02243   return ( true );
02244 }
02245 
02248 int ServerSettings::getSlowDownFactor( ) const
02249 {
02250   return ( iSlowDownFactor );
02251 }
02252 
02257 bool ServerSettings::setVisibleDistance( double d )
02258 {
02259   dVisibleDistance = d;
02260   return ( true );
02261 }
02262 
02266 double ServerSettings::getVisibleDistance( ) const
02267 {
02268   return ( dVisibleDistance );
02269 }
02270 
02276 bool ServerSettings::setExtraStamina( double d )
02277 {
02278   dExtraStamina = d;
02279   return ( true );
02280 }
02281 
02285 double ServerSettings::getExtraStamina( ) const
02286 {
02287   return ( dExtraStamina );
02288 }
02289 
02294 bool ServerSettings::setMaximalKickDist( double d )
02295 {
02296   dMaximalKickDist = d;
02297   return ( true );
02298 }
02299 
02303 double ServerSettings::getMaximalKickDist( ) const
02304 {
02305   return ( dMaximalKickDist );
02306 }
02307 
02308 /******************************************************************************/
02309 /********************   CLASS HETEROPLAYERSETTINGS ****************************/
02310 /******************************************************************************/
02311 
02315 void HeteroPlayerSettings::show( ostream &os )
02316 {
02317   os <<        dPlayerSpeedMax << " " << dStaminaIncMax << " " << dPlayerDecay
02318      << " " << dInertiaMoment  << " " << dDashPowerRate << " " << dPlayerSize
02319      << " " << dKickableMargin << " " << dKickRand      << " " << dExtraStamina
02320      << " " << dEffortMax      << " " << dEffortMin     << endl;
02321 
02322 }
02323 
02324 
02325 /********************** TESTING PURPOSES **************************************/
02326 /*
02327 
02328 int main( void )
02329 {
02330   ServerSettings settings;
02331 //  settings.show( cout );
02332   settings.readValues( "server.conf", ":" );
02333 //  printf( "------------\n" );
02334   settings.show( cout );
02335   cout << "player_size: " << settings.getPlayerSize( ) << endl;
02336 }
02337 
02338 */

Generated on Thu Mar 7 00:37:43 2002 for UvA Trilearn 2001 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001