classbasicplayer.html

来自「仿真人工智能是指用人工的方法和技术」· HTML 代码 · 共 758 行 · 第 1/5 页

HTML
758
字号
<tr><td valign=top><em>ang</em>&nbsp;</td><td>global direction in which should be dribbled </td></tr><tr><td valign=top><em>dribbleT</em>&nbsp;</td><td>type of dribble that should be performed </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd><a class="el" href="classSoccerCommand.html">SoccerCommand</a> to dribble in direction 'ang' </dl><p>Definition at line <a class="el" href="BasicPlayer_8C-source.html#l01070">1070</a> of file <a class="el" href="BasicPlayer_8C-source.html">BasicPlayer.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00052">AngDeg</a>, <a class="el" href="namespace_3globalScope_4.html#a253a232">DRIBBLE_FAST</a>, <a class="el" href="namespace_3globalScope_4.html#a253a231">DRIBBLE_SLOW</a>, <a class="el" href="namespace_3globalScope_4.html#a253a230">DRIBBLE_WITHBALL</a>, <a class="el" href="SoccerTypes_8h-source.html#l00375">DribbleT</a>, <a class="el" href="WorldModel_8C-source.html#l00533">WorldModel::getAgentGlobalBodyAngle</a>(), <a class="el" href="WorldModel_8C-source.html#l00568">WorldModel::getAgentGlobalPosition</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l00825">WorldModel::getOuterPositionInField</a>(), <a class="el" href="PlayerSettings_8C-source.html#l00484">PlayerSettings::getTurnWithBallAngThr</a>(), <a class="el" href="PlayerSettings_8C-source.html#l00505">PlayerSettings::getTurnWithBallFreezeThr</a>(), <a class="el" href="Geometry_8C-source.html#l00542">VecPosition::getX</a>(), <a class="el" href="Geometry_8C-source.html#l00558">VecPosition::getY</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00775">kickTo</a>(), <a class="el" href="Geometry_8C-source.html#l00875">VecPosition::normalizeAngle</a>(), <a class="el" href="SoccerTypes_8h-source.html#l00075">PITCH_LENGTH</a>, <a class="el" href="SoccerTypes_8h-source.html#l00076">PITCH_WIDTH</a>, <a class="el" href="BasicPlayer_8h-source.html#l00060">PS</a>, <a class="el" href="BasicPlayer_8C-source.html#l00871">turnWithBallTo</a>(), and <a class="el" href="BasicPlayer_8h-source.html#l00058">WM</a>.    </td>  </tr></table><a name="b6" doxytag="BasicPlayer::freezeBall"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="classSoccerCommand.html">SoccerCommand</a> BasicPlayer::freezeBall </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This skill enables an agent to freeze a moving ball, i.e. it returns a kick command that stops the ball dead at its current position. Since ball movement in the soccer server is implemented as a vector addition, the ball will stop in the next cycle when it is kicked in such a way that the resulting acceleration vector has the same length and opposite direction to the current ball velocity. The desired speed that should be given to the ball on the kick thus equals the current ball speed. Furthermore, the direction of the kick should equal the direction of the current ball velocity plus 180 degrees. Note that this direction must be made relative to the agent's global body angle before it can be passed as an argument to the kick command. <dl compact><dt><b>Returns: </b><dd><a class="el" href="classSoccerCommand.html">SoccerCommand</a> to freeze the ball. </dl><p>Definition at line <a class="el" href="BasicPlayer_8C-source.html#l00233">233</a> of file <a class="el" href="BasicPlayer_8C-source.html">BasicPlayer.C</a>.<p>References <a class="el" href="namespace_3globalScope_4.html#a247a186">CMD_KICK</a>, <a class="el" href="WorldModel_8C-source.html#l00533">WorldModel::getAgentGlobalBodyAngle</a>(), <a class="el" href="WorldModel_8C-source.html#l00634">WorldModel::getBallDirection</a>(), <a class="el" href="WorldModel_8C-source.html#l00627">WorldModel::getBallSpeed</a>(), <a class="el" href="WorldModel_8C-source.html#l00189">WorldModel::getCurrentCycle</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l01018">WorldModel::getKickPowerForSpeed</a>(), <a class="el" href="ServerSettings_8C-source.html#l01302">ServerSettings::getMaxPower</a>(), <a class="el" href="Geometry_8C-source.html#l00875">VecPosition::normalizeAngle</a>(), <a class="el" href="BasicPlayer_8h-source.html#l00059">SS</a>, and <a class="el" href="BasicPlayer_8h-source.html#l00058">WM</a>.<p>Referenced by <a class="el" href="BasicPlayer_8C-source.html#l00269">kickBallCloseToBody</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00775">kickTo</a>(), and <a class="el" href="BasicPlayer_8C-source.html#l00871">turnWithBallTo</a>().    </td>  </tr></table><a name="b31" doxytag="BasicPlayer::getEndSpeedForPass"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> double BasicPlayer::getEndSpeedForPass </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="SoccerTypes_8h.html#a240">ObjectT</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>o</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>posPass</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method returns the end speed for a pass. This end speed is determined using two parameters, 'o' and 'posPass' which respectively denote the object to which is passed and the position to which is passed. First it is determined how many server cycles 'o' needs to travel to position 'posPass'. Then the starting speed of the ball is determined when it wants to travel to 'posPass' in the same number of cycles. This starting speed is adjusted if the corresponding end speed of the ball in the passing point lies outside the range [MinPassEndSpeed .. MaxPassEndSpeed]. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>o</em>&nbsp;</td><td>object to which the ball will be passed </td></tr><tr><td valign=top><em>posPass</em>&nbsp;</td><td>desired passing point where o can intercept the ball </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>end speed to give to the ball such that player can intercept the ball the best. </dl><p>Definition at line <a class="el" href="BasicPlayer_8C-source.html#l01718">1718</a> of file <a class="el" href="BasicPlayer_8C-source.html">BasicPlayer.C</a>.<p>References <a class="el" href="WorldModel_8C-source.html#l00620">WorldModel::getBallPos</a>(), <a class="el" href="ServerSettings_8C-source.html#l01056">ServerSettings::getBallSpeedMax</a>(), <a class="el" href="Geometry_8C-source.html#l00589">VecPosition::getDistanceTo</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l01081">WorldModel::getEndSpeedFromFirstSpeed</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l01070">WorldModel::getFirstSpeedFromDist</a>(), <a class="el" href="PlayerSettings_8C-source.html#l00323">PlayerSettings::getPassEndSpeed</a>(), <a class="el" href="PlayerSettings_8C-source.html#l00185">PlayerSettings::getPlayerWhenToTurnAngle</a>(), <a class="el" href="SoccerTypes_8h-source.html#l00102">ObjectT</a>, <a class="el" href="WorldModelPredict_8C-source.html#l00256">WorldModel::predictNrCyclesToPoint</a>(), <a class="el" href="BasicPlayer_8h-source.html#l00060">PS</a>, <a class="el" href="BasicPlayer_8h-source.html#l00059">SS</a>, and <a class="el" href="BasicPlayer_8h-source.html#l00058">WM</a>.<p>Referenced by <a class="el" href="BasicPlayer_8C-source.html#l01180">throughPass</a>().    </td>  </tr></table><a name="b29" doxytag="BasicPlayer::getInterceptionPointBall"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="classVecPosition.html">VecPosition</a> BasicPlayer::getInterceptionPointBall </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>iCyclesBall</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>bool&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>isGoalie</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method uses an iterative scheme to compute the optimal interception point of the ball. A loop is executed in which the prediction methods are used to predict the position of the ball a number of cycles, say i, into the future and to predict the number of cycles, say n, that the agent will need to reach this position. This is repeated for increasing values of i until n &lt; i in which case it is assumed thay the agent should be able to reach the predicted ball position before the ball does. This point is chosen as the interception point and the moveToPos skill is used to move towards this point. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>iCyclesToBall</em>&nbsp;</td><td>will be filled with the nr of cycles it will take the ball to reach the returned position. </td></tr><tr><td valign=top><em>isGoalie</em>&nbsp;</td><td>indicates whether the current player is a goalkeeper or not  </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>position to intercept the ball. </dl><p>Definition at line <a class="el" href="BasicPlayer_8C-source.html#l01611">1611</a> of file <a class="el" href="BasicPlayer_8C-source.html">BasicPlayer.C</a>.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?