📄 playersettings_8c-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>PlayerSettings.C Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.2.12 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>PlayerSettings.C</h1><a href="PlayerSettings_8C.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font>00002 <font class="comment">Copyright (c) 2000,2001, Jelle Kok, University of Amsterdam</font>00003 <font class="comment">All rights reserved.</font>00004 <font class="comment"></font>00005 <font class="comment">Redistribution and use in source and binary forms, with or without </font>00006 <font class="comment">modification, are permitted provided that the following conditions are met:</font>00007 <font class="comment"></font>00008 <font class="comment">1. Redistributions of source code must retain the above copyright notice, this </font>00009 <font class="comment">list of conditions and the following disclaimer. </font>00010 <font class="comment"></font>00011 <font class="comment">2. Redistributions in binary form must reproduce the above copyright notice, </font>00012 <font class="comment">this list of conditions and the following disclaimer in the documentation </font>00013 <font class="comment">and/or other materials provided with the distribution. </font>00014 <font class="comment"></font>00015 <font class="comment">3. Neither the name of the University of Amsterdam nor the names of its </font>00016 <font class="comment">contributors may be used to endorse or promote products derived from this </font>00017 <font class="comment">software without specific prior written permission. </font>00018 <font class="comment"></font>00019 <font class="comment">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" </font>00020 <font class="comment">AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE </font>00021 <font class="comment">IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE </font>00022 <font class="comment">DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE </font>00023 <font class="comment">FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL </font>00024 <font class="comment">DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR </font>00025 <font class="comment">SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER </font>00026 <font class="comment">CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, </font>00027 <font class="comment">OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE </font>00028 <font class="comment">OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</font>00029 <font class="comment">*/</font>00044 <font class="preprocessor">#include "<a class="code" href="PlayerSettings_8h.html">PlayerSettings.h</a>"</font>00045 00046 <font class="comment">/******************************************************************************/</font>00047 <font class="comment">/********************** CLASS PlayerSettings **********************************/</font>00048 <font class="comment">/******************************************************************************/</font>00049 <a name="l00053"></a><a class="code" href="classPlayerSettings.html#a0">00053</a> <a class="code" href="classPlayerSettings.html#a0">PlayerSettings::PlayerSettings</a>( ) : <a class="code" href="classGenericValues.html">GenericValues</a>("<a class="code" href="classPlayerSettings.html">PlayerSettings</a>", 22)00054 {00055 <a class="code" href="classPlayerSettings.html#o0">dPlayerConfThr</a> = 0.90; <font class="comment">// threshold below player info is illegal</font>00056 <a class="code" href="classPlayerSettings.html#o1">dPlayerHighConfThr</a> = 0.97; <font class="comment">// threshold above which player info is high</font>00057 <a class="code" href="classPlayerSettings.html#o2">dBallConfThr</a> = 0.90; <font class="comment">// threshold below which ball info is illegal</font>00058 <a class="code" href="classPlayerSettings.html#o3">dPlayerDistTolerance</a> = 5.0; <font class="comment">// distance when unknownplayer is mapped</font>00059 <a class="code" href="classPlayerSettings.html#o4">dPlayerWhenToTurnAngle</a> = 8.0; <font class="comment">// angle when to turn when moving</font>00060 <a class="code" href="classPlayerSettings.html#o5">dPlayerWhenToKick</a> = 0.85; <font class="comment">// % of kick power rate when kick is performed</font>00061 <a class="code" href="classPlayerSettings.html#o6">iPlayerWhenToIntercept</a> = 30; <font class="comment">// maximum number of interception cycles</font>00062 <a class="code" href="classPlayerSettings.html#o7">dClearBallDist</a> = 4.0; <font class="comment">// dist before penalty area to clear ball to</font>00063 <a class="code" href="classPlayerSettings.html#o8">dClearBallOppMaxDist</a> = 30.0; <font class="comment">// radius in which opp in clear ball has to be</font>00064 <a class="code" href="classPlayerSettings.html#o9">dClearBallToSideAngle</a> = 17.0; <font class="comment">// minimum angle for clear ball to side</font>00065 <a class="code" href="classPlayerSettings.html#o10">dConeWidth</a> = 0.5; <font class="comment">// cone width to check for opponents in pass</font>00066 <a class="code" href="classPlayerSettings.html#o11">dPassEndSpeed</a> = 1.2; <font class="comment">// end speed for ball when passed to teammate</font>00067 <a class="code" href="classPlayerSettings.html#o12">dFastPassEndSpeed</a> = 1.8; <font class="comment">// end speed for ball when passed fast</font>00068 <a class="code" href="classPlayerSettings.html#o13">dPassExtraX</a> = 0.0; <font class="comment">// extra x value added to player passing pos</font>00069 <a class="code" href="classPlayerSettings.html#o14">dFractionWaitNoSee</a> = 0.5; <font class="comment">// % of cycle to wait in cycle with no see</font>00070 <a class="code" href="classPlayerSettings.html#o15">dFractionWaitSeeBegin</a> = 0.70; <font class="comment">// % to wait in cycle with see in begin</font>00071 <a class="code" href="classPlayerSettings.html#o16">dFractionWaitSeeEnd</a> = 0.85; <font class="comment">// % to wait in cycle with see in 2nd half</font>00072 <a class="code" href="classPlayerSettings.html#o17">dMarkDistance</a> = 6.0; <font class="comment">// mark distance to a player</font>00073 <a class="code" href="classPlayerSettings.html#o18">iServerTimeOut</a> = 3; <font class="comment">// seconds before server is assumed dead</font>00074 <a class="code" href="classPlayerSettings.html#o19">dTurnWithBallAngThr</a> = 30.0; <font class="comment">// angle threshold to kick ball</font>00075 <a class="code" href="classPlayerSettings.html#o20">dTurnWithBallFreezeThr</a> = 0.1; <font class="comment">// ball speed threshold to freeze ball</font>00076 00077 00078 <font class="comment">// add all the settings and link text string to variable</font>00079 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"player_conf_thr"</font> , &<a class="code" href="classPlayerSettings.html#o0">dPlayerConfThr</a>, GENERIC_VALUE_DOUBLE );00080 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"player_high_conf_thr"</font>,&<a class="code" href="classPlayerSettings.html#o1">dPlayerHighConfThr</a>,GENERIC_VALUE_DOUBLE );00081 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"ball_conf_thr"</font> , &<a class="code" href="classPlayerSettings.html#o2">dBallConfThr</a>, GENERIC_VALUE_DOUBLE );00082 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"player_dist_tolerance"</font>,&<a class="code" href="classPlayerSettings.html#o3">dPlayerDistTolerance</a>,00083 GENERIC_VALUE_DOUBLE );00084 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"player_when_to_turn"</font> , &<a class="code" href="classPlayerSettings.html#o4">dPlayerWhenToTurnAngle</a>,00085 GENERIC_VALUE_DOUBLE );00086 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"player_when_to_kick"</font> , &<a class="code" href="classPlayerSettings.html#o5">dPlayerWhenToKick</a>,GENERIC_VALUE_DOUBLE );00087 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"player_when_to_intercept"</font>,&<a class="code" href="classPlayerSettings.html#o6">iPlayerWhenToIntercept</a>,00088 GENERIC_VALUE_INTEGER);00089 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"clear_ball_dist"</font> , &<a class="code" href="classPlayerSettings.html#o7">dClearBallDist</a>, GENERIC_VALUE_DOUBLE );00090 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"clear_ball_opp_max_dist"</font>, &<a class="code" href="classPlayerSettings.html#o8">dClearBallOppMaxDist</a>,00091 GENERIC_VALUE_DOUBLE );00092 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"clear_ball_side_angle"</font>, &<a class="code" href="classPlayerSettings.html#o9">dClearBallToSideAngle</a>,00093 GENERIC_VALUE_DOUBLE );00094 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"cone_width"</font> , &<a class="code" href="classPlayerSettings.html#o10">dConeWidth</a>, GENERIC_VALUE_DOUBLE );00095 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"pass_end_speed"</font> , &<a class="code" href="classPlayerSettings.html#o11">dPassEndSpeed</a>, GENERIC_VALUE_DOUBLE );00096 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"fast_pass_end_speed"</font> , &<a class="code" href="classPlayerSettings.html#o12">dFastPassEndSpeed</a>,GENERIC_VALUE_DOUBLE );00097 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"pass_extra_x"</font> , &<a class="code" href="classPlayerSettings.html#o13">dPassExtraX</a>, GENERIC_VALUE_DOUBLE );00098 00099 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"wait_no_see"</font> , &<a class="code" href="classPlayerSettings.html#o14">dFractionWaitNoSee</a>,GENERIC_VALUE_DOUBLE );00100 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"wait_see_begin"</font> , &<a class="code" href="classPlayerSettings.html#o15">dFractionWaitSeeBegin</a>,GENERIC_VALUE_DOUBLE );00101 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"wait_see_end"</font> , &<a class="code" href="classPlayerSettings.html#o16">dFractionWaitSeeEnd</a>, GENERIC_VALUE_DOUBLE );00102 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"mark_distance"</font> , &<a class="code" href="classPlayerSettings.html#o17">dMarkDistance</a>, GENERIC_VALUE_DOUBLE );00103 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"server_time_out"</font> , &<a class="code" href="classPlayerSettings.html#o18">iServerTimeOut</a>, GENERIC_VALUE_INTEGER);00104 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"turn_with_ball_ang_thr"</font> , &<a class="code" href="classPlayerSettings.html#o19">dTurnWithBallAngThr</a>,00105 GENERIC_VALUE_DOUBLE );00106 <a class="code" href="classGenericValues.html#a4">addSetting</a>( <font class="stringliteral">"turn_with_ball_freeze_thr"</font> , &<a class="code" href="classPlayerSettings.html#o20">dTurnWithBallFreezeThr</a>,00107 GENERIC_VALUE_DOUBLE );00108 }00109 <a name="l00113"></a><a class="code" href="classPlayerSettings.html#a1">00113</a> <font class="keywordtype">double</font> <a class="code" href="classPlayerSettings.html#a1">PlayerSettings::getPlayerConfThr</a>( )<font class="keyword"> const</font>00114 <font class="keyword"></font>{00115 <font class="keywordflow">return</font> <a class="code" href="classPlayerSettings.html#o0">dPlayerConfThr</a>;00116 }00117 <a name="l00122"></a><a class="code" href="classPlayerSettings.html#a2">00122</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerSettings.html#a2">PlayerSettings::setPlayerConfThr</a>( <font class="keywordtype">double</font> d )00123 {00124 <a class="code" href="classPlayerSettings.html#o0">dPlayerConfThr</a> = d;00125 <font class="keywordflow">return</font> <font class="keyword">true</font>;00126 }00127 <a name="l00131"></a><a class="code" href="classPlayerSettings.html#a3">00131</a> <font class="keywordtype">double</font> <a class="code" href="classPlayerSettings.html#a3">PlayerSettings::getPlayerHighConfThr</a>( )<font class="keyword"> const</font>00132 <font class="keyword"></font>{00133 <font class="keywordflow">return</font> <a class="code" href="classPlayerSettings.html#o1">dPlayerHighConfThr</a>;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -