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

ServerSettings.cpp

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2000-2003, 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 */
00030 
00057 #include "ServerSettings.h"
00058 #include <stdio.h>
00059 #include <string.h>           // needed for 'strcpy'
00060 
00061 /*****************************************************************************/
00062 /*******************   CLASS SERVERSETTINGS   ********************************/
00063 /*****************************************************************************/
00064 
00070 ServerSettings::ServerSettings( ):GenericValues( "ServerSettings", 121 )
00071 {
00072   // goal-related parameters
00073   dGoalWidth         = 14.02; // goal_width: the width of the goal
00074 
00075   // player-related parameters
00076   dPlayerSize        = 0.3;   // player_size: the size (=radius) of a player
00077   dPlayerDecay       = 0.4;   // player_decay: player speed decay per cycle
00078   dPlayerRand        = 0.1;   // player_rand: random error in player movement
00079   dPlayerWeight      = 60.0;  // player_weight: weight of a player (for wind)
00080   dPlayerSpeedMax    = 1.2;   // player_speed_max: maximum speed of a player
00081   dPlayerAccelMax    = 1.0;   // player_accel_max: maximum acceleration of a
00082                               // player per cycle
00083 
00084   // stamina-related parameters
00085   dStaminaMax        = 4000.0;// stamina_max: maximum stamina of a player
00086   dStaminaIncMax     = 45.0;  // stamina_inc_max: maximum stamina increase of a
00087                               // player per cycle
00088   dRecoverDecThr     = 0.3;   // recover_dec_thr: percentage of stamina_max
00089                               // below which player recovery decreases
00090   dRecoverDec        = 0.002; // recover_dec: decrement step per cycle for
00091                               // player recovery
00092   dRecoverMin        = 0.5;   // recover_min: minimum player recovery
00093   dEffortDecThr      = 0.3;   // effort_dec_thr: % of stamina_max below
00094                               // which player effort capacity decreases
00095   dEffortDec         = 0.005; // effort_dec: decrement step per cycle for
00096                               // player effort capacity
00097   dEffortIncThr      = 0.6;   // effort_incr_thr: percentage of stamina_max
00098                               // above which player effort capacity increases
00099   dEffortInc         = 0.01;  // effort_inc: increment step per cycle for
00100                               // player effort capacity
00101   dEffortMin         = 0.6;   // effort_min: minimum value for player effort
00102 
00103   // parameters related to auditory perception
00104   iHearMax           = 2;     // hear_max: max hearing capacity of a player;
00105                               // a player can hear hear_inc messages in
00106                               // hear_decay simulation cycles
00107   iHearInc           = 1;     // hear_inc: min hearing capacity of a player,
00108                               // i.e. the number of messages a player can hear
00109                               // in hear_decay simulation cycles
00110   iHearDecay         = 2;     // hear_decay: decay rate of player hearing
00111                               // capacity, i.e. minimum number of cycles for
00112                               // hear_inc messages
00113 
00114   // parameters related to player turn actions
00115   dInertiaMoment     = 5.0;   // inertia_moment: inertia moment of a player;
00116                               // affects actual turn angle depending on speed
00117 
00118   // parameters related to sense_body information
00119   iSenseBodyStep     = 100;   // sense_body_step: length of the interval (ms)
00120                               // between sense_body information messages
00121 
00122   // goalkeeper-related parameters
00123   dCatchableAreaL    = 2.0;   // catchable_area_l: length of area around
00124                               // goalkeeper in which he can catch the ball
00125   dCatchableAreaW    = 1.0;   // catchable_area_w: width of area around
00126                               // goalkeeper in which he can catch the ball
00127   dCatchProbability  = 1.0;   // catch_probability: the probability for a
00128                               // goalkeeper to catch the ball
00129   iCatchBanCycle     = 5 ;    // catch_ban_cycle: number of cycles after catch
00130                               // in which goalkeeper cannot catch again
00131   iGoalieMaxMoves    = 2;     // goalie_max_moves: maximum number of 'move'
00132                               // actions allowed for goalkeeper after catch
00133 
00134   // ball-related parameters
00135   dBallSize          = 0.085; // ball_size: the size (=radius) of the ball
00136   dBallDecay         = 0.94;  // ball_decay: ball speed decay per cycle
00137   dBallRand          = 0.05;  // ball_rand: random error in ball movement
00138   dBallWeight        = 0.2;   // ball_weight: weight of the ball (for wind)
00139   dBallSpeedMax      = 2.7;   // ball_speed_max: maximum speed of the ball
00140   dBallAccelMax      = 2.7;   // ball_accel_max: maximum acceleration of the
00141                               // ball per cycle
00142 
00143   // wind-related parameters
00144   dWindForce         = 0.0;   // wind_force: the force of the wind
00145   dWindDir           = 0.0;   // wind_dir: the direction of the wind
00146   dWindRand          = 0.0;   // wind_rand: random error in wind direction
00147   bWindRandom        = false; // wind_random: is wind force and dir random
00148 
00149   // parameters related to 'dash' and 'kick' commands
00150   dKickableMargin    = 0.7;   // kickable_margin: margin around player in which
00151                               // ball is kickable; kickable area thus equals
00152                               // kickable_margin + ball_size + player_size
00153   dCkickMargin       = 1.0;   // ckick_margin: corner kick margin, i.e. the
00154                               // minimum distance to the ball for offending
00155                               // players when a corner kick is taken
00156 
00157   dDashPowerRate     = 0.006; // dash_power_rate: rate by which the 'Power'
00158                               // argument in a 'dash' command is multiplied
00159                               // (thus determining the amount of displacement
00160                               // of the player as a result of the 'dash')
00161   dKickPowerRate     = 0.027; // kick_power_rate: rate by which the 'Power'
00162                               // argument in a 'kick' command is multiplied
00163                               // (thus determining the amount of displacement 
00164                               // of the ball as a result of the 'kick')
00165   dKickRand          = 0.0;   // kick_rand: random error in kick direction
00166 
00167   // parameters related to visual and auditory perception range
00168   dVisibleAngle      = 90.0;  // visible_angle: angle of the view cone of a
00169                               // player in the standard view mode
00170   dAudioCutDist      = 50.0;  // audio_cut_dist: maximum distance over which a
00171                               // spoken message can be heard
00172 
00173   // quantization parameters
00174   dQuantizeStep      = 0.1;   // quantize_step: quantization step for distance
00175                               // of moving objects
00176   dQuantizeStepL     = 0.01;  // quantize_step_l: quantization step for dist
00177                               // of landmarks
00178 
00179   // range parameters for basic actuator commands
00180   iMaxPower          = 100;   // maxpower: maximum power for dash/kick
00181   iMinPower          = -100;  // minpower: minimum power for dash/kick
00182   iMaxMoment         = 180;   // maxmoment: maximum angle for turn/kick
00183   iMinMoment         = -180;  // minmoment: minimum angle for turn/kick
00184   iMaxNeckMoment     = 180;   // maxneckmoment: maximum angle for turnneck
00185   iMinNeckMoment     = -180;  // minneckmoment: minimum angle for turnneck
00186   iMaxNeckAng        = 90;    // maxneckang: maximum neck angle rel to body
00187   iMinNeckAng        = -90;   // minneckang: minimum neck angle rel to body
00188 
00189   // port-related parameters
00190   iPort              = 6000;  // port: port number for player connection
00191   iCoachPort         = 6001;  // coach_port: port number for coach connection
00192   iOlCoachPort       = 6002;  // ol_coach_port: port number for online coach
00193 
00194   // coach-related parameters
00195   iSayCoachCntMax    = 128;   // say_coach_cnt_max: maximum number of coach
00196                               // messages possible
00197   iSayCoachMsgSize   = 128;   // say_coach_msg_size: maximum size of coach
00198                               // messages
00199   iClangWinSize      = 300;   // clang_win_size: time window which controls how
00200                               // many coach messages can be sent
00201   iClangDefineWin    = 1;     // clang_define_win: number of define messages by
00202                               // coach per time window
00203   iClangMetaWin      = 1;     // clang_meta_win: number of meta messages by
00204                               // coach per time window
00205   iClangAdviceWin    = 1;     // clang_advice_win: number of advice messages by
00206                               // coach per time window
00207   iClangInfoWin      = 1;     // clang_info_win: number of info messages by
00208                               // coach per time window
00209   iClangMessDelay    = 50;    // clang_mess_delay: delay of coach messages, ie
00210                               // the number of cycles between send to player 
00211                               // and receival of message
00212   iClangMessPerCycle = 1;     // clang_mess_per_cycle: number of coach messages
00213                               // per cycle
00214   iSendViStep        = 100;   // send_vi_step: interval of coach's look, i.e.
00215                               // the length of the interval (in ms) between
00216                               // visual messages to the coach
00217 
00218   // time-related parameters
00219   iSimulatorStep     = 100;   // simulator_step: the length (in ms) of a
00220                               // simulator cycle
00221   iSendStep          = 150;   // send_step: the length of the interval (in ms)
00222                               // between visual messages to a player in the
00223                               // standard view mode
00224   iRecvStep          = 10;    // recv_step: the length of the interval (in ms)
00225                               // for accepting commands from a player
00226   iHalfTime          = 300;   // half_time: the length (in seconds) of a single
00227                               // game half
00228   iDropBallTime      = 200;   // drop_ball_time: the number of cycles to wait
00229                               // until dropping the ball automatically for free
00230                               // kicks, corner kicks, etc.
00231 
00232   // speech-related parameters
00233   iSayMsgSize        = 512;   // say_msg_size: the maximum length (in bytes) of
00234                               // a spoken message
00235 
00236   // offside-related parameters
00237   bUseOffside            = true; // use_offside: a boolean flag indicating
00238                                  // whether the offside rule should be applied
00239                                  // or not
00240   dOffsideActiveAreaSize = 5.0;  // offside_active_area_size: offside active
00241                                  // area size, i.e. radius of circle around
00242                                  // the ball in which player can be offside
00243   bForbidKickOffOffside  = true; // forbid_kick_off_offside: a boolean flag
00244                                  // indicating whether a kick from offside
00245                                  // position is allowed
00246   dOffsideKickMargin     = 9.15; // offside_kick_margin: offside kick margin
00247                                  // i.e. the minimum distance to the ball for
00248                                  // offending players when a free kick for
00249                                  // offside is taken
00250 
00251   // log-related parameters
00252   bVerbose           = false; // verbose: flag indicating whether verbose mode
00253                               // is active or not; in verbose mode server sends
00254                               // extra error-information
00255   iRecordVersion     = 3;     // record_version: the type of log record
00256   bRecordLog         = true;  // record_log: flag indicating whether log record
00257                               // for game should be created
00258   bSendLog           = true;  // send_log: flag indicating whether send client
00259                               // command log for game should be created
00260   bLogTimes          = false; // log_times: flag indicating whether ms should 
00261                               // be written between cycles in log file
00262   strcpy( strLogFile, "server.log" );// server log to store all actions receiv
00263   bSynchMode         = false; // synch_mode: in synchronization mode?
00264   bFullStateL        = false; // fullstate_l, full information left team
00265   bFullStateR        = false; // fulstate_r, full information right team
00266   
00267   // heterogeneous player parameters from player.conf
00268   iPlayerTypes              = 7;     // player_types: the number of player type
00269                                      // including the default player type
00270   iSubsMax                  = 3;     // subs_max: the maximum number of
00271                                      // substitutions allowed during a game the
00272                                      // value also indicates the maximum number
00273                                      // of players allowed for each type
00274   dPlayerSpeedMaxDeltaMin   = 0.0;   // player_speed_max_delta_min: minimum
00275                                      // delta for adjusting player_speed_max
00276   dPlayerSpeedMaxDeltaMax   = 0.0;   // player_speed_max_delta_max: maximum
00277                                      // delta for adjusting player_speed_max
00278   dStaminaIncMaxDeltaFactor = 0.0;   // stamina_inc_max_delta_factor: amount by
00279                                      // which delta is multiplied for
00280                                      // stamina_inc_max
00281   dPlayerDecayDeltaMin      = 0.0;   // player_decay_delta_min: minimum delta
00282                                      // for adjusting player_decay
00283   dPlayerDecayDeltaMax      = 0.2;   // player_decay_delta_max: maximum delta
00284                                      // for adjusting player_decay
00285   dInertiaMomentDeltaFactor = 25.0;  // inertia_moment_delta_factor: amount by
00286                                      // which delta is multiplied for
00287                                      // inertia_moment
00288   dDashPowerRateDeltaMin    = 0.0;   // dash_power_rate_delta_min: min delta
00289                                      // for adjusting dash_power_rate
00290   dDashPowerRateDeltaMax    = 0.0;   // dash_power_rate_delta_max: max delta
00291                                      // for adjusting dash_power_rate
00292   dPlayerSizeDeltaFactor    = -100.0;// player_size_delta_factor: amount delta
00293                                      // is multiplied by for player_size
00294   dKickableMarginDeltaMin   = 0.0;   // kickable_margin_delta_min: min delta
00295                                      // for adjusting kickable_margin
00296   dKickableMarginDeltaMax   = 0.2;   // kickable_margin_delta_max: max delta
00297                                      // for adjusting kickable_margin
00298   dKickRandDeltaFactor      = 0.5;   // kick_rand_delta_factor: amount delta is
00299                                      // multiplied by for kick_rand
00300   dExtraStaminaDeltaMin     = 0.0;   // extra_stamina_delta_min: minimum delta
00301                                      // for adjusting extra_stamina
00302   dExtraStaminaDeltaMax     = 100.0; // extra_stamina_delta_max: maximum delta
00303                                      // for adjusting extra_stamina
00304   dEffortMaxDeltaFactor     = -0.002;// effort_max_delta_factor: amount delta 
00305                                      // is multiplied by for effort_max
00306   dEffortMinDeltaFactor     = -0.002;// effort_min_delta_factor: amount delta
00307                                      // is multiplied by for effort_min
00308   dNewDashPowerRateDeltaMin = 0.0;   // dash_power_rate_delta_min: minimum 
00309                                      // delta for adjusting dash_power_rate
00310   dNewDashPowerRateDeltaMax = 0.002; // dash_power_rate_delta_max: maximum 
00311                                      // delta for adjusting dash_power_rate
00312   dNewStaminaIncMaxDeltaFactor=-100000.0;// stamina_inc_max_delta_factor: 
00313                                // amount by which delta is multiplied for
00314                                      // stamina_inc_max
00315 
00316   // important server parameters not in server.conf or player.conf
00317   dEffortMax         = 1.0; // effort_max: maximum player effort capacity
00318   iSlowDownFactor    = 1;   // slow_down_factor: factor to slow down simulator
00319                             // and send intervals
00320   dVisibleDistance   = 3.0; // visible_distance: distance within which objects
00321                             // are always 'visible' even when not in view cone)
00322   dExtraStamina      = 0.0; // extra_stamina: extra stamina for heterogeneous
00323                             // player
00324 
00325   // penalty parameters
00326   dPenDistX          = 11.0;         // pen_dist_x: distance ball from goal
00327   dPenMaxGoalieDistX = 4.0;          // pen_goalie_max_dist_x: maximum distance
00328                                      // for goalie during penalties
00329   bPenAllowMultKicks = false;        // pen_allow_mult_kicks: can penalty 
00330                                      // kicker kick multiple times
00331 
00332   // tackle parameters
00333   dTackleDist        = 2.0;          // tackle_dist: allowed distance in front 
00334   dTackleBackDist    = 0.5;          // tackle_back_dist: allowed distance back
00335   dTackleWidth       = 1.0;          // tackle_width: allowed distance side
00336   dTackleExponent    = 6;            // tackle_exponent: exponent need 
00337   iTackleCycles      = 10;           // tackle_cycles: cycles immobile 
00338   dTacklePowerRate   = 0.027;        // tackle_power_rate: power rate tackle
00339 
00340   // parameters which depend on other values
00341   dMaximalKickDist = dKickableMargin +   // the maximum distance from a player
00342                      dPlayerSize +       // for which the ball is kickable
00343                      dBallSize;
00344 
00345   // add all the settings, i.e. each parameter
00346   // becomes a new generic value for the class
00347 
00348   // goal-related parameters
00349   addSetting( "goal_width"        , &dGoalWidth       , GENERIC_VALUE_DOUBLE );
00350 
00351   // player-related parameters
00352   addSetting( "player_size"       , &dPlayerSize      , GENERIC_VALUE_DOUBLE );
00353   addSetting( "player_decay"      , &dPlayerDecay     , GENERIC_VALUE_DOUBLE );
00354   addSetting( "player_rand"       , &dPlayerRand      , GENERIC_VALUE_DOUBLE );
00355   addSetting( "player_weight"     , &dPlayerWeight    , GENERIC_VALUE_DOUBLE );
00356   addSetting( "player_speed_max"  , &dPlayerSpeedMax  , GENERIC_VALUE_DOUBLE );
00357   addSetting( "player_accel_max"  , &dPlayerAccelMax  , GENERIC_VALUE_DOUBLE );
00358 
00359   // stamina-related parameters
00360   addSetting( "stamina_max"       , &dStaminaMax      , GENERIC_VALUE_DOUBLE );
00361   addSetting( "stamina_inc_max"   , &dStaminaIncMax   , GENERIC_VALUE_DOUBLE );
00362   addSetting( "recover_dec_thr"   , &dRecoverDecThr   , GENERIC_VALUE_DOUBLE );
00363   addSetting( "recover_dec"       , &dRecoverDec      , GENERIC_VALUE_DOUBLE );
00364   addSetting( "recover_min"       , &dRecoverMin      , GENERIC_VALUE_DOUBLE );
00365   addSetting( "effort_dec_thr"    , &dEffortDecThr    , GENERIC_VALUE_DOUBLE );
00366   addSetting( "effort_dec"        , &dEffortDec       , GENERIC_VALUE_DOUBLE );
00367   addSetting( "effort_inc_thr"    , &dEffortIncThr    , GENERIC_VALUE_DOUBLE );
00368   addSetting( "effort_inc"        , &dEffortInc       , GENERIC_VALUE_DOUBLE );
00369   addSetting( "effort_min"        , &dEffortMin       , GENERIC_VALUE_DOUBLE );
00370 
00371   // parameters related to auditory perception
00372   addSetting( "hear_max"          , &iHearMax         , GENERIC_VALUE_INTEGER);
00373   addSetting( "hear_inc"          , &iHearInc         , GENERIC_VALUE_INTEGER);
00374   addSetting( "hear_decay"        , &iHearDecay       , GENERIC_VALUE_INTEGER);
00375 
00376   // parameters related to player turn actions
00377   addSetting( "inertia_moment"    , &dInertiaMoment   , GENERIC_VALUE_DOUBLE );
00378 
00379   // parameters related to sense_body information
00380   addSetting( "sense_body_step"   , &iSenseBodyStep   , GENERIC_VALUE_INTEGER);
00381 
00382   // goalkeeper-related parameters
00383   addSetting( "catchable_area_l"  , &dCatchableAreaL  , GENERIC_VALUE_DOUBLE );
00384   addSetting( "catchable_area_w"  , &dCatchableAreaW  , GENERIC_VALUE_DOUBLE );
00385   addSetting( "catch_probability" , &dCatchProbability, GENERIC_VALUE_DOUBLE );
00386   addSetting( "catch_ban_cycle"   , &iCatchBanCycle   , GENERIC_VALUE_INTEGER);
00387   addSetting( "goalie_max_moves"  , &iGoalieMaxMoves  , GENERIC_VALUE_INTEGER);
00388 
00389   // ball-related parameters
00390   addSetting( "ball_size"         , &dBallSize        , GENERIC_VALUE_DOUBLE );
00391   addSetting( "ball_decay"        , &dBallDecay       , GENERIC_VALUE_DOUBLE );
00392   addSetting( "ball_rand"         , &dBallRand        , GENERIC_VALUE_DOUBLE );
00393   addSetting( "ball_weight"       , &dBallWeight      , GENERIC_VALUE_DOUBLE );
00394   addSetting( "ball_speed_max"    , &dBallSpeedMax    , GENERIC_VALUE_DOUBLE );
00395   addSetting( "ball_accel_max"    , &dBallAccelMax    , GENERIC_VALUE_DOUBLE );
00396 
00397   // wind-related parameters
00398   addSetting( "wind_force"        , &dWindForce       , GENERIC_VALUE_DOUBLE );
00399   addSetting( "wind_dir"          , &dWindDir         , GENERIC_VALUE_DOUBLE );
00400   addSetting( "wind_rand"         , &dWindRand        , GENERIC_VALUE_DOUBLE );
00401   addSetting( "wind_random"       , &bWindRandom      , GENERIC_VALUE_BOOLEAN);
00402   // parameters related to 'dash' and 'kick' commands
00403   addSetting( "kickable_margin"   , &dKickableMargin  , GENERIC_VALUE_DOUBLE );
00404   addSetting( "ckick_margin"      , &dCkickMargin     , GENERIC_VALUE_DOUBLE );
00405   addSetting( "dash_power_rate"   , &dDashPowerRate   , GENERIC_VALUE_DOUBLE );
00406   addSetting( "kick_power_rate"   , &dKickPowerRate   , GENERIC_VALUE_DOUBLE );
00407   addSetting( "kick_rand"         , &dKickRand        , GENERIC_VALUE_DOUBLE );
00408 
00409   // parameters related to visual and auditory perception range
00410   addSetting( "visible_angle"     , &dVisibleAngle    , GENERIC_VALUE_DOUBLE );
00411   addSetting( "audio_cut_dist"    , &dAudioCutDist    , GENERIC_VALUE_DOUBLE );
00412 
00413   // quantization parameters
00414   addSetting( "quantize_step"     , &dQuantizeStep    , GENERIC_VALUE_DOUBLE );
00415   addSetting( "quantize_step_l"   , &dQuantizeStepL   , GENERIC_VALUE_DOUBLE );
00416 
00417   // range parameters for basic actuator commands
00418   addSetting( "maxpower"          , &iMaxPower        , GENERIC_VALUE_INTEGER);
00419   addSetting( "minpower"          , &iMinPower        , GENERIC_VALUE_INTEGER);
00420   addSetting( "maxmoment"         , &iMaxMoment       , GENERIC_VALUE_INTEGER);
00421   addSetting( "minmoment"         , &iMinMoment       , GENERIC_VALUE_INTEGER);
00422   addSetting( "maxneckmoment"     , &iMaxNeckMoment   , GENERIC_VALUE_INTEGER);
00423   addSetting( "minneckmoment"     , &iMinNeckMoment   , GENERIC_VALUE_INTEGER);
00424   addSetting( "maxneckang"        , &iMaxNeckAng      , GENERIC_VALUE_INTEGER);
00425   addSetting( "minneckang"        , &iMinNeckAng      , GENERIC_VALUE_INTEGER);
00426 
00427   // port-related parameters
00428   addSetting( "port"              , &iPort            , GENERIC_VALUE_INTEGER);
00429   addSetting( "coach_port"        , &iCoachPort       , GENERIC_VALUE_INTEGER);
00430   addSetting( "ol_coach_port"     , &iOlCoachPort     , GENERIC_VALUE_INTEGER);
00431 
00432   // coach-related parameters
00433   addSetting( "say_coach_cnt_max" , &iSayCoachCntMax  , GENERIC_VALUE_INTEGER);
00434   addSetting( "say_coach_msg_size", &iSayCoachMsgSize , GENERIC_VALUE_INTEGER);
00435   addSetting( "clang_win_size"    , &iClangWinSize    , GENERIC_VALUE_INTEGER);
00436   addSetting( "clang_define_win"  , &iClangDefineWin  , GENERIC_VALUE_INTEGER);
00437   addSetting( "clang_meta_win"    , &iClangMetaWin    , GENERIC_VALUE_INTEGER);
00438   addSetting( "clang_advice_win"  , &iClangAdviceWin  , GENERIC_VALUE_INTEGER);
00439   addSetting( "clang_info_win"    , &iClangInfoWin    , GENERIC_VALUE_INTEGER);
00440   addSetting( "clang_mess_delay"  , &iClangMessDelay  , GENERIC_VALUE_INTEGER);
00441   addSetting("clang_mess_per_cycle",&iClangMessPerCycle,GENERIC_VALUE_INTEGER);
00442   addSetting( "send_vi_step"      , &iSendViStep      , GENERIC_VALUE_INTEGER);
00443 
00444   // time-related parameters
00445   addSetting( "simulator_step"    , &iSimulatorStep   , GENERIC_VALUE_INTEGER);
00446   addSetting( "send_step"         , &iSendStep        , GENERIC_VALUE_INTEGER);
00447   addSetting( "recv_step"         , &iRecvStep        , GENERIC_VALUE_INTEGER);
00448   addSetting( "half_time"         , &iHalfTime        , GENERIC_VALUE_INTEGER);
00449   addSetting( "drop_ball_time"    , &iDropBallTime    , GENERIC_VALUE_INTEGER);
00450 
00451   // speech-related parameters
00452   addSetting( "say_msg_size"      , &iSayMsgSize      , GENERIC_VALUE_INTEGER);
00453 
00454   // offside-related parameters
00455   addSetting( "use_offside"       , &bUseOffside      , GENERIC_VALUE_BOOLEAN);
00456   addSetting( "offside_active_area_size", &dOffsideActiveAreaSize,
00457                                                         GENERIC_VALUE_DOUBLE );
00458   addSetting( "forbid_kick_off_offside" , &bForbidKickOffOffside ,
00459                                                         GENERIC_VALUE_BOOLEAN);
00460   addSetting( "offside_kick_margin",&dOffsideKickMargin,GENERIC_VALUE_DOUBLE );
00461 
00462   // log-related parameters
00463   addSetting( "verbose"           , &bVerbose         , GENERIC_VALUE_BOOLEAN);
00464   addSetting( "record_version"    , &iRecordVersion   , GENERIC_VALUE_INTEGER);
00465   addSetting( "record_log"        , &bRecordLog       , GENERIC_VALUE_BOOLEAN);
00466   addSetting( "send_log"          , &bSendLog         , GENERIC_VALUE_BOOLEAN);
00467   addSetting( "log_times"         , &bLogTimes        , GENERIC_VALUE_BOOLEAN);
00468   addSetting( "log_file"          , &strLogFile       , GENERIC_VALUE_STRING );
00469   addSetting( "synch_mode"        , &bSynchMode       , GENERIC_VALUE_BOOLEAN);
00470   addSetting( "fullstate_l"       , &bFullStateL      , GENERIC_VALUE_BOOLEAN);
00471   addSetting( "fullstate_r"       , &bFullStateR      , GENERIC_VALUE_BOOLEAN);
00472  
00473   // heterogeneous player parameters from player.conf
00474   addSetting( "player_types"      , &iPlayerTypes     , GENERIC_VALUE_INTEGER);
00475   addSetting( "subs_max"          , &iSubsMax         , GENERIC_VALUE_INTEGER);
00476   addSetting( "player_speed_max_delta_min"  , &dPlayerSpeedMaxDeltaMin  ,
00477                                                         GENERIC_VALUE_DOUBLE );
00478   addSetting( "player_speed_max_delta_max"  , &dPlayerSpeedMaxDeltaMax  ,
00479                                                         GENERIC_VALUE_DOUBLE );
00480   addSetting( "stamina_inc_max_delta_factor", &dStaminaIncMaxDeltaFactor,
00481                                                         GENERIC_VALUE_DOUBLE );
00482   addSetting( "player_decay_delta_min"      , &dPlayerDecayDeltaMin     ,
00483                                                         GENERIC_VALUE_DOUBLE );
00484   addSetting( "player_decay_delta_max"      , &dPlayerDecayDeltaMax     ,
00485                                                         GENERIC_VALUE_DOUBLE );
00486   addSetting( "inertia_moment_delta_factor" , &dInertiaMomentDeltaFactor,
00487                                                         GENERIC_VALUE_DOUBLE );
00488   addSetting( "dash_power_rate_delta_min"   , &dDashPowerRateDeltaMin   ,
00489                                                         GENERIC_VALUE_DOUBLE );
00490   addSetting( "dash_power_rate_delta_max"   , &dDashPowerRateDeltaMax   ,
00491                                                         GENERIC_VALUE_DOUBLE );
00492   addSetting( "player_size_delta_factor"    , &dPlayerSizeDeltaFactor   ,
00493                                                         GENERIC_VALUE_DOUBLE );
00494   addSetting( "kickable_margin_delta_min"   , &dKickableMarginDeltaMin  ,
00495                                                         GENERIC_VALUE_DOUBLE );
00496   addSetting( "kickable_margin_delta_max"   , &dKickableMarginDeltaMax  ,
00497                                                         GENERIC_VALUE_DOUBLE );
00498   addSetting( "kick_rand_delta_factor"      , &dKickRandDeltaFactor     ,
00499                                                         GENERIC_VALUE_DOUBLE );
00500   addSetting( "extra_stamina_delta_min"     , &dExtraStaminaDeltaMin    ,
00501                                                         GENERIC_VALUE_DOUBLE );
00502   addSetting( "extra_stamina_delta_max"     , &dExtraStaminaDeltaMax    ,
00503                                                         GENERIC_VALUE_DOUBLE );
00504   addSetting( "effort_max_delta_factor"     , &dEffortMaxDeltaFactor    ,
00505                                                         GENERIC_VALUE_DOUBLE );
00506   addSetting( "effort_min_delta_factor"     , &dEffortMinDeltaFactor    ,
00507                                                         GENERIC_VALUE_DOUBLE );
00508   addSetting( "new_dash_power_rate_delta_min", &dNewDashPowerRateDeltaMin   ,
00509                                                         GENERIC_VALUE_DOUBLE );
00510   addSetting( "new_dash_power_rate_delta_max", &dNewDashPowerRateDeltaMax   ,
00511                                                         GENERIC_VALUE_DOUBLE );
00512   addSetting( "new_stamina_inc_max_delta_factor", &dNewStaminaIncMaxDeltaFactor
00513                                                       ,GENERIC_VALUE_DOUBLE  );
00514   
00515   // penalty parameters
00516   addSetting( "pen_dist_x"        , &dPenDistX        , GENERIC_VALUE_DOUBLE );
00517   addSetting("pen_goalie_max_dist_x",&dPenMaxGoalieDistX,GENERIC_VALUE_DOUBLE);
00518   addSetting("pen_allow_mult_kicks",&bPenAllowMultKicks,GENERIC_VALUE_BOOLEAN);
00519 
00520   // tackle parameters
00521   addSetting( "tackle_dist"       , &dTackleDist      , GENERIC_VALUE_DOUBLE );
00522   addSetting( "tackle_back_dist"  , &dTackleBackDist  , GENERIC_VALUE_DOUBLE );
00523   addSetting( "tackle_width"      , &dTackleWidth     , GENERIC_VALUE_DOUBLE );
00524   addSetting( "tackle_exponent"   , &dTackleExponent  , GENERIC_VALUE_DOUBLE );
00525   addSetting( "tackle_cycles"     , &iTackleCycles    , GENERIC_VALUE_INTEGER);
00526   addSetting( "tackle_power_rate" , &dTacklePowerRate , GENERIC_VALUE_DOUBLE );
00527  
00528   // important server parameters not in server.conf or player.conf - are now
00529   addSetting( "effort_max"        , &dEffortMax       , GENERIC_VALUE_DOUBLE );
00530   addSetting( "slow_down_factor"  , &iSlowDownFactor  , GENERIC_VALUE_INTEGER);
00531   addSetting( "visible_distance"  , &dVisibleDistance , GENERIC_VALUE_DOUBLE );
00532   addSetting( "extra_stamina"     , &dExtraStamina    , GENERIC_VALUE_DOUBLE );
00533 
00534   // parameters which depend on other values
00535   addSetting( "dMaximalKickDist"  , &dMaximalKickDist , GENERIC_VALUE_DOUBLE );
00536 }
00537 
00546 bool ServerSettings::setValue( const char *strName, const char *strValue )
00547 {
00548   // call to the superclass method
00549   bool bReturn = GenericValues::setValue( strName, strValue );
00550   // compute values for parameters which depend on others (reason for override)
00551   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00552 
00553   return ( bReturn );
00554 }
00555 
00563 bool ServerSettings::readValues( const char *strFileName, 
00564                                  const char *strSeparator )
00565 {
00566   // call to the superclass method
00567   bool bReturn = GenericValues::readValues( strFileName, strSeparator );
00568   // compute values for parameters which depend on others (reason for override)
00569   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00570 
00571   return ( bReturn );
00572 }
00573 
00577 bool ServerSettings::setGoalWidth( double d )
00578 {
00579   dGoalWidth = d;
00580   return ( true );
00581 }
00582 
00585 double ServerSettings::getGoalWidth( ) const
00586 {
00587   return ( dGoalWidth );
00588 }
00589 
00593 bool ServerSettings::setPlayerSize( double d )
00594 {
00595   dPlayerSize = d;
00596   // NOTE: also update parameters for which the value depends on this variable
00597   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
00598 
00599   return ( true );
00600 }
00601 
00604 double ServerSettings::getPlayerSize( ) const
00605 {
00606   return ( dPlayerSize );
00607 }
00608 
00612 bool ServerSettings::setPlayerDecay( double d )
00613 {
00614   dPlayerDecay = d;
00615   return ( true );
00616 }
00617 
00620 double ServerSettings::getPlayerDecay( ) const
00621 {
00622   return ( dPlayerDecay );
00623 }
00624 
00628 bool ServerSettings::setPlayerRand( double d )
00629 {
00630   dPlayerRand = d;
00631   return ( true );
00632 }
00633 
00636 double ServerSettings::getPlayerRand( ) const
00637 {
00638   return ( dPlayerRand );
00639 }
00640 
00644 bool ServerSettings::setPlayerWeight( double d )
00645 {
00646   dPlayerWeight = d;
00647   return ( true );
00648 }
00649 
00652 double ServerSettings::getPlayerWeight( ) const
00653 {
00654   return ( dPlayerWeight );
00655 }
00656 
00660 bool ServerSettings::setPlayerSpeedMax( double d )
00661 {
00662   dPlayerSpeedMax = d;
00663   return ( true );
00664 }
00665 
00668 double ServerSettings::getPlayerSpeedMax( ) const
00669 {
00670   return ( dPlayerSpeedMax );
00671 }
00672 
00677 bool ServerSettings::setPlayerAccelMax( double d )
00678 {
00679   dPlayerAccelMax = d;
00680   return ( true );
00681 }
00682 
00685 double ServerSettings::getPlayerAccelMax( ) const
00686 {
00687   return ( dPlayerAccelMax );
00688 }
00689 
00693 bool ServerSettings::setStaminaMax( double d )
00694 {
00695   dStaminaMax = d;
00696   return ( true );
00697 }
00698 
00701 double ServerSettings::getStaminaMax( ) const
00702 {
00703   return ( dStaminaMax );
00704 }
00705 
00710 bool ServerSettings::setStaminaIncMax( double d )
00711 {
00712   dStaminaIncMax = d;
00713   return ( true );
00714 }
00715 
00718 double ServerSettings::getStaminaIncMax( ) const
00719 {
00720   return ( dStaminaIncMax );
00721 }
00722 
00727 bool ServerSettings::setRecoverDecThr( double d )
00728 {
00729   dRecoverDecThr = d;
00730   return ( true );
00731 }
00732 
00735 double ServerSettings::getRecoverDecThr( ) const
00736 {
00737   return ( dRecoverDecThr );
00738 }
00739 
00744 bool ServerSettings::setRecoverDec( double d )
00745 {
00746   dRecoverDec = d;
00747   return ( true );
00748 }
00749 
00752 double ServerSettings::getRecoverDec( ) const
00753 {
00754   return ( dRecoverDec );
00755 }
00756 
00760 bool ServerSettings::setRecoverMin( double d )
00761 {
00762   dRecoverMin = d;
00763   return ( true );
00764 }
00765 
00768 double ServerSettings::getRecoverMin( ) const
00769 {
00770   return ( dRecoverMin );
00771 }
00772 
00777 bool ServerSettings::setEffortDecThr( double d )
00778 {
00779   dEffortDecThr = d;
00780   return ( true );
00781 }
00782 
00786 double ServerSettings::getEffortDecThr( ) const
00787 {
00788   return ( dEffortDecThr );
00789 }
00790 
00795 bool ServerSettings::setEffortDec( double d )
00796 {
00797   dEffortDec = d;
00798   return ( true );
00799 }
00800 
00803 double ServerSettings::getEffortDec( ) const
00804 {
00805   return ( dEffortDec );
00806 }
00807 
00812 bool ServerSettings::setEffortIncThr( double d )
00813 {
00814   dEffortIncThr = d;
00815   return ( true );
00816 }
00817 
00821 double ServerSettings::getEffortIncThr( ) const
00822 {
00823   return ( dEffortIncThr );
00824 }
00825 
00830 bool ServerSettings::setEffortInc( double d )
00831 {
00832   dEffortInc = d;
00833   return ( true );
00834 }
00835 
00838 double ServerSettings::getEffortInc( ) const
00839 {
00840   return ( dEffortInc );
00841 }
00842 
00846 bool ServerSettings::setEffortMin( double d )
00847 {
00848   dEffortMin = d;
00849   return ( true );
00850 }
00851 
00854 double ServerSettings::getEffortMin( ) const
00855 {
00856   return ( dEffortMin );
00857 }
00858 
00866 bool ServerSettings::setHearMax( int i )
00867 {
00868   iHearMax = i;
00869   return ( true );
00870 }
00871 
00876 int ServerSettings::getHearMax( ) const
00877 {
00878   return ( iHearMax );
00879 }
00880 
00886 bool ServerSettings::setHearInc( int i )
00887 {
00888   iHearInc = i;
00889   return ( true );
00890 }
00891 
00895 int ServerSettings::getHearInc( ) const
00896 {
00897   return ( iHearInc );
00898 }
00899 
00904 bool ServerSettings::setHearDecay( int i )
00905 {
00906   iHearDecay = i;
00907   return ( true );
00908 }
00909 
00913 int ServerSettings::getHearDecay( ) const
00914 {
00915   return ( iHearDecay );
00916 }
00917 
00922 bool ServerSettings::setInertiaMoment( double d )
00923 {
00924   dInertiaMoment = d;
00925   return ( true );
00926 }
00927 
00931 double ServerSettings::getInertiaMoment( ) const
00932 {
00933   return ( dInertiaMoment );
00934 }
00935 
00940 bool ServerSettings::setSenseBodyStep( int i )
00941 {
00942   iSenseBodyStep = i;
00943   return ( true );
00944 }
00945 
00949 int ServerSettings::getSenseBodyStep( ) const
00950 {
00951   // NOTE: do not take slow down factor into account for send intervals
00952   // already done by server
00953   return iSenseBodyStep ; // * iSlowDownFactor );
00954 }
00955 
00960 bool ServerSettings::setCatchableAreaL( double d )
00961 {
00962   dCatchableAreaL = d;
00963   return ( true );
00964 }
00965 
00969 double ServerSettings::getCatchableAreaL( ) const
00970 {
00971   return ( dCatchableAreaL );
00972 }
00973 
00978 bool ServerSettings::setCatchableAreaW( double d )
00979 {
00980   dCatchableAreaW = d;
00981   return ( true );
00982 }
00983 
00987 double ServerSettings::getCatchableAreaW( ) const
00988 {
00989   return ( dCatchableAreaW );
00990 }
00991 
00996 bool ServerSettings::setCatchProbability( double d )
00997 {
00998   dCatchProbability = d;
00999   return ( true );
01000 }
01001 
01004 double ServerSettings::getCatchProbability( ) const
01005 {
01006   return ( dCatchProbability );
01007 }
01008 
01013 bool ServerSettings::setCatchBanCycle( int i )
01014 {
01015   iCatchBanCycle = i;
01016   return ( true );
01017 }
01018 
01022 int ServerSettings::getCatchBanCycle( ) const
01023 {
01024   return ( iCatchBanCycle );
01025 }
01026 
01031 bool ServerSettings::setGoalieMaxMoves( int i )
01032 {
01033   iGoalieMaxMoves = i;
01034   return ( true );
01035 }
01036 
01040 int ServerSettings::getGoalieMaxMoves( ) const
01041 {
01042   return ( iGoalieMaxMoves );
01043 }
01044 
01048 bool ServerSettings::setBallSize( double d )
01049 {
01050   dBallSize = d;
01051   // NOTE: also update parameters for which the value depends on this variable
01052   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
01053 
01054   return ( true );
01055 }
01056 
01059 double ServerSettings::getBallSize( ) const
01060 {
01061   return ( dBallSize );
01062 }
01063 
01067 bool ServerSettings::setBallDecay( double d )
01068 {
01069   dBallDecay = d;
01070   return ( true );
01071 }
01072 
01075 double ServerSettings::getBallDecay( ) const
01076 {
01077   return ( dBallDecay );
01078 }
01079 
01086 bool ServerSettings::setBallRand( double d )
01087 {
01088   dBallRand = d;
01089   return ( true );
01090 }
01091 
01094 double ServerSettings::getBallRand( ) const
01095 {
01096   return ( dBallRand );
01097 }
01098 
01102 bool ServerSettings::setBallWeight( double d )
01103 {
01104   dBallWeight = d;
01105   return ( true );
01106 }
01107 
01110 double ServerSettings::getBallWeight( ) const
01111 {
01112   return ( dBallWeight );
01113 }
01114 
01118 bool ServerSettings::setBallSpeedMax( double d )
01119 {
01120   dBallSpeedMax = d;
01121   return ( true );
01122 }
01123 
01126 double ServerSettings::getBallSpeedMax( ) const
01127 {
01128   return ( dBallSpeedMax );
01129 }
01130 
01135 bool ServerSettings::setBallAccelMax( double d )
01136 {
01137   dBallAccelMax = d;
01138   return ( true );
01139 }
01140 
01143 double ServerSettings::getBallAccelMax( ) const
01144 {
01145   return ( dBallAccelMax );
01146 }
01147 
01151 bool ServerSettings::setWindForce( double d )
01152 {
01153   dWindForce = d;
01154   return ( true );
01155 }
01156 
01159 double ServerSettings::getWindForce( ) const
01160 {
01161   return ( dWindForce );
01162 }
01163 
01167 bool ServerSettings::setWindDir( double d )
01168 {
01169   dWindDir = d;
01170   return ( true );
01171 }
01172 
01175 double ServerSettings::getWindDir( ) const
01176 {
01177   return ( dWindDir );
01178 }
01179 
01183 bool ServerSettings::setWindRand( double d )
01184 {
01185   dWindRand = d;
01186   return ( true );
01187 }
01188 
01191 double ServerSettings::getWindRand( ) const
01192 {
01193   return ( dWindRand );
01194 }
01195 
01199 bool ServerSettings::setWindRandom( bool b )
01200 {
01201   bWindRandom = b;
01202   return ( true );
01203 }
01204 
01207 bool ServerSettings::getWindRandom( ) const
01208 {
01209   return bWindRandom;
01210 }
01211 
01217 bool ServerSettings::setKickableMargin( double d )
01218 {
01219   dKickableMargin = d;
01220   // NOTE: also update parameters for which the value depends on this variable
01221   dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
01222 
01223   return ( true );
01224 }
01225 
01229 double ServerSettings::getKickableMargin( ) const
01230 {
01231   return ( dKickableMargin );
01232 }
01233 
01239 bool ServerSettings::setCkickMargin( double d )
01240 {
01241   dCkickMargin = d;
01242   return ( true );
01243 }
01244 
01248 double ServerSettings::getCkickMargin( ) const
01249 {
01250   return ( dCkickMargin );
01251 }
01252 
01258 bool ServerSettings::setDashPowerRate( double d )
01259 {
01260   dDashPowerRate = d;
01261   return ( true );
01262 }
01263 
01268 double ServerSettings::getDashPowerRate( ) const
01269 {
01270   return ( dDashPowerRate );
01271 }
01272 
01278 bool ServerSettings::setKickPowerRate( double d )
01279 {
01280   dKickPowerRate = d;
01281   return ( true );
01282 }
01283 
01288 double ServerSettings::getKickPowerRate( ) const
01289 {
01290   return ( dKickPowerRate );
01291 }
01292 
01296 bool ServerSettings::setKickRand( double d )
01297 {
01298   dKickRand = d;
01299   return ( true );
01300 }
01301 
01304 double ServerSettings::getKickRand( ) const
01305 {
01306   return ( dKickRand );
01307 }
01308 
01313 bool ServerSettings::setVisibleAngle( double d )
01314 {
01315   dVisibleAngle = d;
01316   return ( true );
01317 }
01318 
01321 double ServerSettings::getVisibleAngle( ) const
01322 {
01323   return ( dVisibleAngle );
01324 }
01325 
01330 bool ServerSettings::setAudioCutDist( double d )
01331 {
01332   dAudioCutDist = d;
01333   return ( true );
01334 }
01335 
01338 double ServerSettings::getAudioCutDist( ) const
01339 {
01340   return ( dAudioCutDist );
01341 }
01342 
01347 bool ServerSettings::setQuantizeStep( double d )
01348 {
01349   dQuantizeStep = d;
01350   return ( true );
01351 }
01352 
01355 double ServerSettings::getQuantizeStep( ) const
01356 {
01357   return ( dQuantizeStep );
01358 }
01359 
01364 bool ServerSettings::setQuantizeStepL( double d )
01365 {
01366   dQuantizeStepL = d;
01367   return ( true );
01368 }
01369 
01372 double ServerSettings::getQuantizeStepL( ) const
01373 {
01374   return ( dQuantizeStepL );
01375 }
01376 
01380 bool ServerSettings::setMaxPower( int i )
01381 {
01382   iMaxPower = i;
01383   return ( true );
01384 }
01385 
01388 int ServerSettings::getMaxPower( ) const
01389 {
01390   return ( iMaxPower );
01391 }
01392 
01396 bool ServerSettings::setMinPower( int i )
01397 {
01398   iMinPower = i;
01399   return ( true );
01400 }
01401 
01404 int ServerSettings::getMinPower( ) const
01405 {
01406   return ( iMinPower );
01407 }
01408 
01412 bool ServerSettings::setMaxMoment( int i )
01413 {
01414   iMaxMoment = i;
01415   return ( true );
01416 }
01417 
01420 int ServerSettings::getMaxMoment( ) const
01421 {
01422   return ( iMaxMoment );
01423 }
01424 
01428 bool ServerSettings::setMinMoment( int i )
01429 {
01430   iMinMoment = i;
01431   return ( true );
01432 }
01433 
01436 int ServerSettings::getMinMoment( ) const
01437 {
01438   return ( iMinMoment );
01439 }
01440 
01444 bool ServerSettings::setMaxNeckMoment( int i )
01445 {
01446   iMaxNeckMoment = i;
01447   return ( true );
01448 }
01449 
01452 int ServerSettings::getMaxNeckMoment( ) const
01453 {
01454   return ( iMaxNeckMoment );
01455 }
01456 
01460 bool ServerSettings::setMinNeckMoment( int i )
01461 {
01462   iMinNeckMoment = i;
01463   return ( true );
01464 }
01465 
01468 int ServerSettings::getMinNeckMoment( ) const
01469 {
01470   return ( iMinNeckMoment );
01471 }
01472 
01479 bool ServerSettings::setMaxNeckAng( int i )
01480 {
01481   iMaxNeckAng = i;
01482   return ( true );
01483 }
01484 
01487 int ServerSettings::getMaxNeckAng( ) const
01488 {
01489   return ( iMaxNeckAng );
01490 }
01491 
01498 bool ServerSettings::setMinNeckAng( int i )
01499 {
01500   iMinNeckAng = i;
01501   return ( true );
01502 }
01503 
01506 int ServerSettings::getMinNeckAng( ) const
01507 {
01508   return ( iMinNeckAng );
01509 }
01510 
01515 bool ServerSettings::setPort( int i )
01516 {
01517   iPort = i;
01518   return ( true );
01519 }
01520 
01523 int ServerSettings::getPort( ) const
01524 {
01525   return ( iPort );
01526 }
01527 
01532 bool ServerSettings::setCoachPort( int i )
01533 {
01534   iCoachPort = i;
01535   return ( true );
01536 }
01537 
01540 int ServerSettings::getCoachPort( ) const
01541 {
01542   return ( iCoachPort );
01543 }
01544 
01549 bool ServerSettings::setOlCoachPort( int i )
01550 {
01551   iOlCoachPort = i;
01552   return ( true );
01553 }
01554 
01557 int ServerSettings::getOlCoachPort( ) const
01558 {
01559   return ( iOlCoachPort );
01560 }
01561 
01566 bool ServerSettings::setSayCoachCntMax( int i )
01567 {
01568   iSayCoachCntMax = i;
01569   return ( true );
01570 }
01571 
01574 int ServerSettings::getSayCoachCntMax( ) const
01575 {
01576   return ( iSayCoachCntMax );
01577 }
01578 
01582 bool ServerSettings::setSayCoachMsgSize( int i )
01583 {
01584   iSayCoachMsgSize = i;
01585   return ( true );
01586 }
01587 
01590 int ServerSettings::getSayCoachMsgSize( ) const
01591 {
01592   return ( iSayCoachMsgSize );
01593 }
01594 
01599 bool ServerSettings::setClangWinSize( int i )
01600 {
01601   iClangWinSize = i;
01602   return ( true );
01603 }
01604 
01607 int ServerSettings::getClangWinSize( ) const
01608 {
01609   return ( iClangWinSize );
01610 }
01611 
01616 bool ServerSettings::setClangDefineWin( int i )
01617 {
01618   iClangDefineWin = i;
01619   return ( true );
01620 }
01621 
01624 int ServerSettings::getClangDefineWin( ) const
01625 {
01626   return ( iClangDefineWin );
01627 }
01628 
01633 bool ServerSettings::setClangMetaWin( int i )
01634 {
01635   iClangMetaWin = i;
01636   return ( true );
01637 }
01638 
01641 int ServerSettings::getClangMetaWin( ) const
01642 {
01643   return ( iClangMetaWin );
01644 }
01645 
01650 bool ServerSettings::setClangAdviceWin( int i )
01651 {
01652   iClangAdviceWin = i;
01653   return ( true );
01654 }
01655 
01658 int ServerSettings::getClangAdviceWin( ) const
01659 {
01660   return ( iClangAdviceWin );
01661 }
01662 
01667 bool ServerSettings::setClangInfoWin( int i )
01668 {
01669   iClangInfoWin = i;
01670   return ( true );
01671 }
01672 
01675 int ServerSettings::getClangInfoWin( ) const
01676 {
01677   return ( iClangInfoWin );
01678 }
01679 
01685 bool ServerSettings::setClangMessDelay( int i )
01686 {
01687   iClangMessDelay = i;
01688   return ( true );
01689 }
01690 
01694 int ServerSettings::getClangMessDelay( ) const
01695 {
01696   return ( iClangMessDelay );
01697 }
01698 
01703 bool ServerSettings::setClangMessPerCycle( int i )
01704 {
01705   iClangMessPerCycle = i;
01706   return ( true );
01707 }
01708 
01711 int ServerSettings::getClangMessPerCycle( ) const
01712 {
01713   return ( iClangMessPerCycle );
01714 }
01715 
01721 bool ServerSettings::setSendViStep( int i )
01722 {
01723   iSendViStep = i;
01724   return ( true );
01725 }
01726 
01730 int ServerSettings::getSendViStep( ) const
01731 {
01732   // NOTE: do not take slow down factor into account for send intervals
01733   // already done by server
01734   return iSendViStep ; // * iSlowDownFactor );
01735 }
01736 
01741 bool ServerSettings::setSimulatorStep( int i )
01742 {
01743   iSimulatorStep = i;
01744   return ( true );
01745 }
01746 
01749 int ServerSettings::getSimulatorStep( ) const
01750 {
01751   // NOTE: do not take slow down factor into account for send intervals ->
01752   // already done in supplied server values
01753     return iSimulatorStep ; //  * iSlowDownFactor ;
01754 }
01755 
01760 bool ServerSettings::setSendStep( int i )
01761 {
01762   iSendStep = i;
01763   return ( true );
01764 }
01765 
01769 int ServerSettings::getSendStep( ) const
01770 {
01771   // NOTE: do not take slow down factor into account for send intervals,
01772   // already done by server
01773   return  iSendStep ; // * iSlowDownFactor );
01774 }
01775 
01780 bool ServerSettings::setRecvStep( int i )
01781 {
01782   iRecvStep = i;
01783   return ( true );
01784 }
01785 
01789 int ServerSettings::getRecvStep( ) const
01790 {
01791   return ( iRecvStep );
01792 }
01793 
01800 bool ServerSettings::setHalfTime( int i )
01801 {
01802   iHalfTime = i;
01803   return ( true );
01804 }
01805 
01808 int ServerSettings::getHalfTime( ) const
01809 {
01810   return ( iHalfTime );
01811 }
01812 
01817 bool ServerSettings::setDropBallTime( int i )
01818 {
01819   iDropBallTime = i;
01820   return ( true );
01821 }
01822 
01826 int ServerSettings::getDropBallTime( ) const
01827 {
01828   return ( iDropBallTime );
01829 }
01830 
01835 bool ServerSettings::setSayMsgSize( int i )
01836 {
01837   iSayMsgSize = i;
01838   return ( true );
01839 }
01840 
01843 int ServerSettings::getSayMsgSize( ) const
01844 {
01845   return ( iSayMsgSize );
01846 }
01847 
01852 bool ServerSettings::setUseOffside( bool b )
01853 {
01854   bUseOffside = b;
01855   return ( true );
01856 }
01857 
01862 bool ServerSettings::getUseOffside( ) const
01863 {
01864   return ( bUseOffside );
01865 }
01866 
01871 bool ServerSettings::setOffsideActiveAreaSize( double d )
01872 {
01873   dOffsideActiveAreaSize = d;
01874   return ( true );
01875 }
01876 
01880 double ServerSettings::getOffsideActiveAreaSize( ) const
01881 {
01882   return ( dOffsideActiveAreaSize );
01883 }
01884 
01889 bool ServerSettings::setForbidKickOffOffside( bool b )
01890 {
01891   bForbidKickOffOffside = b;
01892   return ( true );
01893 }
01894 
01898 bool ServerSettings::getForbidKickOffOffside( ) const
01899 {
01900   return ( bForbidKickOffOffside );
01901 }
01902 
01908 bool ServerSettings::setOffsideKickMargin( double d )
01909 {
01910   dOffsideKickMargin = d;
01911   return ( true );
01912 }
01913 
01917 double ServerSettings::getOffsideKickMargin( ) const
01918 {
01919   return ( dOffsideKickMargin );
01920 }
01921 
01926 bool ServerSettings::setVerbose( bool b )
01927 {
01928   bVerbose = b;
01929   return ( true );
01930 }
01931 
01935 bool ServerSettings::getVerbose( ) const
01936 {
01937   return ( bVerbose );
01938 }
01939 
01943 bool ServerSettings::setRecordVersion( int i )
01944 {
01945   iRecordVersion = i;
01946   return ( true );
01947 }
01948 
01951 int ServerSettings::getRecordVersion( ) const
01952 {
01953   return ( iRecordVersion );
01954 }
01955 
01960 bool ServerSettings::setRecordLog( bool b )
01961 {
01962   bRecordLog = b;
01963   return ( true );
01964 }
01965 
01969 bool ServerSettings::getRecordLog( ) const
01970 {
01971   return ( bRecordLog );
01972 }
01973 
01978 bool ServerSettings::setSendLog( bool b )
01979 {
01980   bSendLog = b;
01981   return ( true );
01982 }
01983 
01987 bool ServerSettings::getSendLog( ) const
01988 {
01989   return ( bSendLog );
01990 }
01991 
01996 bool ServerSettings::setLogTimes( bool b )
01997 {
01998   bLogTimes = b;
01999   return ( true );
02000 }
02001 
02005 bool ServerSettings::getLogTimes( ) const
02006 {
02007   return ( bLogTimes );
02008 }
02009 
02014 bool ServerSettings::setLogFile( char *str )
02015 {
02016   strcpy( strLogFile, str );
02017   return ( true );
02018 }
02019 
02022 char* ServerSettings::getLogFile( )
02023 {
02024   return ( strLogFile );
02025 }
02026 
02030 bool ServerSettings::setSynchMode( bool b )
02031 {
02032   bSynchMode = b;
02033   return ( true );
02034 }
02035 
02038 bool ServerSettings::getSynchMode( ) const
02039 {
02040   return ( bSynchMode );
02041 }
02042 
02045 bool ServerSettings::getFullStateRight( ) const
02046 {  
02047   return bFullStateR;
02048 }
02049 
02053 bool ServerSettings::setFullStateRight( bool b ) 
02054 {
02055   bFullStateR = b;
02056   return true; 
02057 }
02058 
02062 bool ServerSettings::setFullStateLeft( bool b ) 
02063 {
02064   bFullStateL = b;
02065   return true; 
02066 }
02067 
02070 bool ServerSettings::getFullStateLeft( ) const
02071 {  
02072   return bFullStateL;
02073 }
02074 
02075 
02076 
02077 
02082 bool ServerSettings::setPlayerTypes( int i )
02083 {
02084   iPlayerTypes = i;
02085   return ( true );
02086 }
02087 
02090 int ServerSettings::getPlayerTypes( ) const
02091 {
02092   return ( iPlayerTypes );
02093 }
02094 
02102 bool ServerSettings::setSubsMax( int i )
02103 {
02104   iSubsMax = i;
02105   return ( true );
02106 }
02107 
02113 int ServerSettings::getSubsMax( ) const
02114 {
02115   return ( iSubsMax );
02116 }
02117 
02122 bool ServerSettings::setPlayerSpeedMaxDeltaMin( double d )
02123 {
02124   dPlayerSpeedMaxDeltaMin = d;
02125   return ( true );
02126 }
02127 
02130 double ServerSettings::getPlayerSpeedMaxDeltaMin( ) const
02131 {
02132   return ( dPlayerSpeedMaxDeltaMin );
02133 }
02134 
02139 bool ServerSettings::setPlayerSpeedMaxDeltaMax( double d )
02140 {
02141   dPlayerSpeedMaxDeltaMax = d;
02142   return ( true );
02143 }
02144 
02147 double ServerSettings::getPlayerSpeedMaxDeltaMax( ) const
02148 {
02149   return ( dPlayerSpeedMaxDeltaMax );
02150 }
02151 
02156 bool ServerSettings::setStaminaIncMaxDeltaFactor( double d )
02157 {
02158   dStaminaIncMaxDeltaFactor = d;
02159   return ( true );
02160 }
02161 
02164 double ServerSettings::getStaminaIncMaxDeltaFactor( ) const
02165 {
02166   return ( dStaminaIncMaxDeltaFactor );
02167 }
02168 
02173 bool ServerSettings::setPlayerDecayDeltaMin( double d )
02174 {
02175   dPlayerDecayDeltaMin = d;
02176   return ( true );
02177 }
02178 
02181 double ServerSettings::getPlayerDecayDeltaMin( ) const
02182 {
02183   return ( dPlayerDecayDeltaMin );
02184 }
02185 
02190 bool ServerSettings::setPlayerDecayDeltaMax( double d )
02191 {
02192   dPlayerDecayDeltaMax = d;
02193   return ( true );
02194 }
02195 
02198 double ServerSettings::getPlayerDecayDeltaMax( ) const
02199 {
02200   return ( dPlayerDecayDeltaMax );
02201 }
02202 
02207 bool ServerSettings::setInertiaMomentDeltaFactor( double d )
02208 {
02209   dInertiaMomentDeltaFactor = d;
02210   return ( true );
02211 }
02212 
02215 double ServerSettings::getInertiaMomentDeltaFactor( ) const
02216 {
02217   return ( dInertiaMomentDeltaFactor );
02218 }
02219 
02224 bool ServerSettings::setDashPowerRateDeltaMin( double d )
02225 {
02226   dDashPowerRateDeltaMin = d;
02227   return ( true );
02228 }
02229 
02232 double ServerSettings::getDashPowerRateDeltaMin( ) const
02233 {
02234   return ( dDashPowerRateDeltaMin );
02235 }
02236 
02241 bool ServerSettings::setDashPowerRateDeltaMax( double d )
02242 {
02243   dDashPowerRateDeltaMax = d;
02244   return ( true );
02245 }
02246 
02249 double ServerSettings::getDashPowerRateDeltaMax( ) const
02250 {
02251   return ( dDashPowerRateDeltaMax );
02252 }
02253 
02258 bool ServerSettings::setPlayerSizeDeltaFactor( double d )
02259 {
02260   dPlayerSizeDeltaFactor = d;
02261   return ( true );
02262 }
02263 
02266 double ServerSettings::getPlayerSizeDeltaFactor( ) const
02267 {
02268   return ( dPlayerSizeDeltaFactor );
02269 }
02270 
02275 bool ServerSettings::setKickableMarginDeltaMin( double d )
02276 {
02277   dKickableMarginDeltaMin = d;
02278   return ( true );
02279 }
02280 
02283 double ServerSettings::getKickableMarginDeltaMin( ) const
02284 {
02285   return ( dKickableMarginDeltaMin );
02286 }
02287 
02292 bool ServerSettings::setKickableMarginDeltaMax( double d )
02293 {
02294   dKickableMarginDeltaMax = d;
02295   return ( true );
02296 }
02297 
02300 double ServerSettings::getKickableMarginDeltaMax( ) const
02301 {
02302   return ( dKickableMarginDeltaMax );
02303 }
02304 
02309 bool ServerSettings::setKickRandDeltaFactor( double d )
02310 {
02311   dKickRandDeltaFactor = d;
02312   return ( true );
02313 }
02314 
02317 double ServerSettings::getKickRandDeltaFactor( ) const
02318 {
02319   return ( dKickRandDeltaFactor );
02320 }
02321 
02326 bool ServerSettings::setExtraStaminaDeltaMin( double d )
02327 {
02328   dExtraStaminaDeltaMin = d;
02329   return ( true );
02330 }
02331 
02334 double ServerSettings::getExtraStaminaDeltaMin( ) const
02335 {
02336   return ( dExtraStaminaDeltaMin );
02337 }
02338 
02343 bool ServerSettings::setExtraStaminaDeltaMax( double d )
02344 {
02345   dExtraStaminaDeltaMax = d;
02346   return ( true );
02347 }
02348 
02351 double ServerSettings::getExtraStaminaDeltaMax( ) const
02352 {
02353   return ( dExtraStaminaDeltaMax );
02354 }
02355 
02360 bool ServerSettings::setEffortMaxDeltaFactor( double d )
02361 {
02362   dEffortMaxDeltaFactor = d;
02363   return ( true );
02364 }
02365 
02368 double ServerSettings::getEffortMaxDeltaFactor( ) const
02369 {
02370   return ( dEffortMaxDeltaFactor );
02371 }
02372 
02377 bool ServerSettings::setEffortMinDeltaFactor( double d )
02378 {
02379   dEffortMinDeltaFactor = d;
02380   return ( true );
02381 }
02382 
02385 double ServerSettings::getEffortMinDeltaFactor( ) const
02386 {
02387   return ( dEffortMinDeltaFactor );
02388 }
02389 
02394 bool ServerSettings::setNewDashPowerRateDeltaMin( double d )
02395 {
02396   dNewDashPowerRateDeltaMin = d;
02397   return ( true );
02398 }
02399 
02402 double ServerSettings::getNewDashPowerRateDeltaMin( ) const
02403 {
02404   return ( dNewDashPowerRateDeltaMin );
02405 }
02406 
02411 bool ServerSettings::setNewDashPowerRateDeltaMax( double d )
02412 {
02413   dNewDashPowerRateDeltaMax = d;
02414   return ( true );
02415 }
02416 
02419 double ServerSettings::getNewDashPowerRateDeltaMax( ) const
02420 {
02421   return ( dNewDashPowerRateDeltaMax );
02422 }
02423 
02428 bool ServerSettings::setNewStaminaIncMaxDeltaFactor( double d )
02429 {
02430   dNewStaminaIncMaxDeltaFactor = d;
02431   return ( true );
02432 }
02433 
02436 double ServerSettings::getNewStaminaIncMaxDeltaFactor( ) const
02437 {
02438   return ( dNewStaminaIncMaxDeltaFactor );
02439 }
02440 
02443 bool ServerSettings::setPenDistX( double d )
02444 {
02445   dPenDistX = d;
02446   return true;
02447 }
02448 
02451 double ServerSettings::getPenDistX( ) const
02452 {
02453   return dPenDistX;
02454 }
02455 
02459 bool ServerSettings::setPenMaxGoalieDistX( double d )
02460 {
02461   dPenMaxGoalieDistX = d;
02462   return true;
02463 }
02464 
02468 double ServerSettings::getPenMaxGoalieDistX( ) const
02469 {
02470   return dPenMaxGoalieDistX;
02471 }
02472 
02475 bool ServerSettings::setPenAllowMultKicks( bool b )
02476 {
02477   bPenAllowMultKicks = b;
02478   return true;
02479 }
02480 
02483 bool ServerSettings::getPenAllowMultKicks( ) const
02484 {
02485   return bPenAllowMultKicks;
02486 }
02487 
02491 bool ServerSettings::setTackleDist( double d )
02492 {
02493   dTackleDist = d;
02494   return true;
02495 }
02496 
02500 double ServerSettings::getTackleDist( ) const
02501 {
02502   return dTackleDist;
02503 } 
02504 
02508 bool ServerSettings::setTackleBackDist( double d )
02509 {
02510   dTackleBackDist = d;
02511   return true;
02512 }
02513 
02517 double ServerSettings::getTackleBackDist( ) const
02518 {
02519   return dTackleBackDist;
02520 } 
02521 
02525 bool ServerSettings::setTackleWidth( double d )
02526 {
02527   dTackleWidth = d;
02528   return true;
02529 }
02530 
02534 double ServerSettings::getTackleWidth( ) const
02535 {
02536   return dTackleWidth;
02537 } 
02538 
02541 bool ServerSettings::setTackleExponent( double d )
02542 {
02543   dTackleExponent = d;
02544   return true;
02545 }
02546 
02549 double ServerSettings::getTackleExponent( ) const
02550 {
02551   return dTackleExponent;
02552 } 
02553 
02556 bool ServerSettings::setTackleCycles( int i )
02557 {
02558   iTackleCycles = i;
02559   return true;
02560 }
02561 
02564 int ServerSettings::getTackleCycles( ) const
02565 {
02566   return iTackleCycles;
02567 } 
02568 
02571 bool ServerSettings::setTacklePowerRate( double d )
02572 {
02573   dTacklePowerRate = d;
02574   return true;
02575 }
02576 
02579 double ServerSettings::getTacklePowerRate( ) const
02580 {
02581   return dTacklePowerRate;
02582 } 
02583 
02587 bool ServerSettings::setEffortMax( double d )
02588 {
02589   dEffortMax = d;
02590   return ( true );
02591 }
02592 
02595 double ServerSettings::getEffortMax(  ) const
02596 {
02597   return ( dEffortMax );
02598 }
02599 
02604 bool ServerSettings::setSlowDownFactor( int i )
02605 {
02606   iSlowDownFactor = i;
02607   return ( true );
02608 }
02609 
02612 int ServerSettings::getSlowDownFactor( ) const
02613 {
02614   return ( iSlowDownFactor );
02615 }
02616 
02623 bool ServerSettings::setVisibleDistance( double d )
02624 {
02625   dVisibleDistance = d;
02626   return ( true );
02627 }
02628 
02632 double ServerSettings::getVisibleDistance( ) const
02633 {
02634   return ( dVisibleDistance );
02635 }
02636 
02642 bool ServerSettings::setExtraStamina( double d )
02643 {
02644   dExtraStamina = d;
02645   return ( true );
02646 }
02647 
02652 double ServerSettings::getExtraStamina( ) const
02653 {
02654   return ( dExtraStamina );
02655 }
02656 
02661 bool ServerSettings::setMaximalKickDist( double d )
02662 {
02663   dMaximalKickDist = d;
02664   return ( true );
02665 }
02666 
02670 double ServerSettings::getMaximalKickDist( ) const
02671 {
02672   return ( dMaximalKickDist );
02673 }
02674 
02675 /*****************************************************************************/
02676 /*******************   CLASS HETEROPLAYERSETTINGS ****************************/
02677 /*****************************************************************************/
02678 
02682 void HeteroPlayerSettings::show( ostream &os )
02683 {
02684   os.setf( ios::left );
02685   os << dPlayerSpeedMax << " ";
02686   os.width( 5 );
02687   os.precision( 4 );
02688   os.setf( ios::left );
02689   os << dStaminaIncMax << " " ;
02690   os.width( 6 );
02691   os.precision( 4 );
02692   os.setf( ios::left );
02693   os << dPlayerDecay  << " ";
02694   os.width( 5 );
02695   os.precision( 4 );
02696   os.setf( ios::left );
02697   os << dInertiaMoment  << " " ;
02698   os.width( 8 );
02699   os.precision( 4 );
02700   os.setf( ios::left );
02701   os << dDashPowerRate << " " ;
02702   os.width( 3 );
02703   os.precision( 4 );
02704   os.setf( ios::left );
02705   os << dPlayerSize     << " " ;
02706   os.width( 6 );
02707   os.precision( 4 );
02708   os.setf( ios::left );
02709   os << dKickableMargin << " " ;
02710   os.width( 6 );
02711   os.precision( 4 );
02712   os.setf( ios::left );
02713   os << dKickRand      << " " ;
02714   os.width( 5 );
02715   os.precision( 3 );
02716   os.setf( ios::left );
02717   os << dExtraStamina    << " " ;
02718   os.width( 6 );
02719   os.precision( 4 );
02720   os.setf( ios::left );
02721   os << dEffortMin     << " " ;
02722   os.width( 6 );
02723   os.setf( ios::left );
02724   os.precision( 4 );
02725   os << dEffortMax      << endl ;
02726 /*
02727   os <<        dPlayerSpeedMax << " " << dStaminaIncMax << " " << dPlayerDecay
02728      << " " << dInertiaMoment  << " " << dDashPowerRate << " " << dPlayerSize
02729      << " " << dKickableMargin << " " << dKickRand      << " " << dExtraStamina
02730      << " " << dEffortMax      << " " << dEffortMin     << endl;
02731 */
02732 }
02733 
02734 
02735 /********************* TESTING PURPOSES **************************************/
02736 /*
02737 
02738 int main( void )
02739 {
02740   ServerSettings settings;
02741 //  settings.show( cout );
02742   settings.readValues( "server.conf", ":" );
02743 //  printf( "------------\n" );
02744   settings.show( cout );
02745   cout << "player_size: " << settings.getPlayerSize( ) << endl;
02746 }
02747 
02748 */

Generated on Fri Nov 7 11:45:40 2003 for UvA Trilearn 2003 Base Code by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001