classplayer.html

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

HTML
781
字号
<p>This method determine the strategic position for the specified player. This  is done using the <a class="el" href="classFormations.html">Formations</a> class. In this class all information about the current formation, player number in formation and other specific values are stored. The strategic position is based on the position of the ball. If the confidence in the position of the ball is lower than the threshold defined in <a class="el" href="classPlayerSettings.html">PlayerSettings</a>, it is assumed that the ball is at position (0,0). <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>iPlayer</em>&nbsp;</td><td>role in formation for which strategic position should be  returnd. With default value is -1 it is assumed that the strategic position of the agent itself should be returned.  </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd><a class="el" href="classVecPosition.html">VecPosition</a> strategic position for player 'iPlayer' </dl><p>Definition at line <a class="el" href="Player_8C-source.html#l00434">434</a> of file <a class="el" href="Player_8C-source.html">Player.C</a>.<p>References <a class="el" href="Player_8h-source.html#l00056">formations</a>, <a class="el" href="PlayerSettings_8C-source.html#l00149">PlayerSettings::getBallConfThr</a>(), <a class="el" href="WorldModel_8C-source.html#l00620">WorldModel::getBallPos</a>(), <a class="el" href="WorldModel_8C-source.html#l00803">WorldModel::getConfidence</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l00786">WorldModel::getOffsideX</a>(), <a class="el" href="Formations_8C-source.html#l00660">Formations::getPlayerInFormation</a>(), <a class="el" href="Formations_8C-source.html#l00488">Formations::getStrategicPosition</a>(), <a class="el" href="Geometry_8C-source.html#l00542">VecPosition::getX</a>(), <a class="el" href="WorldModel_8C-source.html#l01139">WorldModel::isGoalKickThem</a>(), <a class="el" href="WorldModel_8C-source.html#l01076">WorldModel::isOffsideUs</a>(), <a class="el" href="Geometry_8C-source.html#l00075">min</a>(), <a class="el" href="namespace_3globalScope_4.html#a240a24">OBJECT_BALL</a>, <a class="el" href="SoccerTypes_8h-source.html#l00080">PENALTY_X</a>, <a class="el" href="BasicPlayer_8h-source.html#l00060">BasicPlayer::PS</a>, and <a class="el" href="BasicPlayer_8h-source.html#l00058">BasicPlayer::WM</a>.<p>Referenced by <a class="el" href="Player_8C-source.html#l00182">deMeer5</a>(), and <a class="el" href="Player_8C-source.html#l00278">deMeer5_goalie</a>().    </td>  </tr></table><a name="c0" doxytag="Player::goalieMainLoop"></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"> void Player::goalieMainLoop </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> [private]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This is the main decision loop for the goalkeeper. <p>Definition at line <a class="el" href="Player_8C-source.html#l00149">149</a> of file <a class="el" href="Player_8C-source.html">Player.C</a>.<p>References <a class="el" href="Player_8C-source.html#l00278">deMeer5_goalie</a>().<p>Referenced by <a class="el" href="Player_8C-source.html#l00092">mainLoop</a>().    </td>  </tr></table><a name="a5" doxytag="Player::handleStdin"></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"> void Player::handleStdin </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></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method listens for input from the keyboard and when it receives this input it converts this input to the associated action. See showStringCommands for the possible options. This method is used together with the <a class="el" href="classSenseHandler.html">SenseHandler</a> class that sends an alarm to indicate that a new command can be sent. This conflicts with the method in this method that listens for the user input (fgets) on Linux systems (on Solaris this isn't a problem). The only known method is to use the flag SA_RESTART with this alarm function, but that does not seem to work under Linux. If each time the alarm is sent, this gets function unblocks, it will cause major performance problems. This function should not be called when a whole match is played! <p>Definition at line <a class="el" href="Player_8C-source.html#l00468">468</a> of file <a class="el" href="Player_8C-source.html">Player.C</a>.<p>References <a class="el" href="Player_8C-source.html#l00512">executeStringCommand</a>(), and <a class="el" href="SoccerTypes_8h-source.html#l00068">MAX_MSG</a>.<p>Referenced by <a class="el" href="Player_8C-source.html#l00630">stdin_callback</a>().    </td>  </tr></table><a name="a2" doxytag="Player::mainLoop"></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"> void Player::mainLoop </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></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This is the main loop of the agent. This method calls the update methods of the world model after it is indicated that new information has arrived. After this, the correct main loop of the player type is called, which puts the best soccer command in the queue of the <a class="el" href="classActHandler.html">ActHandler</a>. <p>Definition at line <a class="el" href="Player_8C-source.html#l00092">92</a> of file <a class="el" href="Player_8C-source.html">Player.C</a>.<p>References <a class="el" href="BasicPlayer_8h-source.html#l00057">BasicPlayer::ACT</a>, <a class="el" href="Player_8C-source.html#l00167">attackerMainLoop</a>(), <a class="el" href="Player_8h-source.html#l00057">bContLoop</a>, <a class="el" href="Player_8C-source.html#l00155">defenderMainLoop</a>(), <a class="el" href="Player_8h-source.html#l00056">formations</a>, <a class="el" href="WorldModel_8C-source.html#l00189">WorldModel::getCurrentCycle</a>(), <a class="el" href="WorldModel_8C-source.html#l00177">WorldModel::getCurrentTime</a>(), <a class="el" href="WorldModel_8C-source.html#l00282">WorldModel::getPlayerNumber</a>(), <a class="el" href="Formations_8C-source.html#l00667">Formations::getPlayerType</a>(), <a class="el" href="WorldModel_8C-source.html#l00234">WorldModel::getTimeLastSeeMessage</a>(), <a class="el" href="Player_8C-source.html#l00149">goalieMainLoop</a>(), <a class="el" href="WorldModel_8h-source.html#l00160">WorldModel::iNrHoles</a>, <a class="el" href="WorldModel_8h-source.html#l00161">WorldModel::iNrOpponentsSeen</a>, <a class="el" href="WorldModel_8h-source.html#l00162">WorldModel::iNrTeammatesSeen</a>, <a class="el" href="Player_8h-source.html#l00059">m_lastSay</a>, <a class="el" href="Player_8C-source.html#l00161">midfielderMainLoop</a>(), <a class="el" href="namespace_3globalScope_4.html#a248a199">PT_ATTACKER</a>, <a class="el" href="namespace_3globalScope_4.html#a248a198">PT_ATTACKER_WING</a>, <a class="el" href="namespace_3globalScope_4.html#a248a194">PT_DEFENDER_SWEEPER</a>, <a class="el" href="namespace_3globalScope_4.html#a248a195">PT_DEFENDER_WING</a>, <a class="el" href="namespace_3globalScope_4.html#a248a193">PT_GOALKEEPER</a>, <a class="el" href="namespace_3globalScope_4.html#a248a192">PT_ILLEGAL</a>, <a class="el" href="namespace_3globalScope_4.html#a248a196">PT_MIDFIELDER_CENTER</a>, <a class="el" href="namespace_3globalScope_4.html#a248a197">PT_MIDFIELDER_WING</a>, <a class="el" href="Player_8C-source.html#l00707">sayWorldStatus</a>(), <a class="el" href="ActHandler_8C-source.html#l00233">ActHandler::sendCommandDirect</a>(), <a class="el" href="ActHandler_8C-source.html#l00102">ActHandler::sendCommands</a>(), <a class="el" href="Player_8C-source.html#l00650">shallISaySomething</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l00410">WorldModel::updateAll</a>(), <a class="el" href="WorldModel_8C-source.html#l01234">WorldModel::waitForNewInformation</a>(), and <a class="el" href="BasicPlayer_8h-source.html#l00058">BasicPlayer::WM</a>.<p>Referenced by <a class="el" href="main_8C-source.html#l00059">main</a>().    </td>  </tr></table><a name="c2" doxytag="Player::midfielderMainLoop"></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"> void Player::midfielderMainLoop </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> [private]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This is the main decision loop for a midfielder. <p>Definition at line <a class="el" href="Player_8C-source.html#l00161">161</a> of file <a class="el" href="Player_8C-source.html">Player.C</a>.<p>References <a class="el" href="Player_8C-source.html#l00182">deMeer5</a>().<p>Referenced by <a class="el" href="Player_8C-source.html#l00092">mainLoop</a>().    </td>  </tr></table><a name="a11" doxytag="Player::sayWorldStatus"></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> Player::sayWorldStatus </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></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method says the world status. This message is encoded to make sure the other teammates know which is the cycle of the message, the author of the message and that the message is originated from a teammate and not from an opponent. The world status is the abs pos and velocity of the author of the message and the ball and the global positions of all the known teammates and the opponents. The format is as follows (*=encoding): (say ***** my_x my_y my_vel_x my_vel_y (ball_x ball_y ball_vel_x ball_vel_y ball_conf) (team_nr pos_x pos_y conf ...) (opp_nr pos_x pos_y conf ...)) Some players in the worldmodel are known by player number, some not. Players of which the player number is not sure are located at the end of the message and have the nr -1. <dl compact><dt><b>Returns: </b><dd><a class="el" href="classSoccerCommand.html">SoccerCommand</a> which contains say message with world status </dl><p>Definition at line <a class="el" href="Player_8C-source.html#l00707">707</a> of file <a class="el" href="Player_8C-source.html">Player.C</a>.<p>References <a class="el" href="namespace_3globalScope_4.html#a247a189">CMD_SAY</a>, <a class="el" href="WorldModel_8C-source.html#l00568">WorldModel::getAgentGlobalPosition</a>(), <a class="el" href="WorldModel_8C-source.html#l00554">WorldModel::getAgentGlobalVelocity</a>(), <a class="el" href="PlayerSettings_8C-source.html#l00149">PlayerSettings::getBallConfThr</a>(), <a class="el" href="WorldModel_8C-source.html#l00620">WorldModel::getBallPos</a>(), <a class="el" href="WorldModel_8C-source.html#l00803">WorldModel::getConfidence</a>(), <a class="el" href="WorldModel_8C-source.html#l00189">WorldModel::getCurrentCycle</a>(), <a class="el" href="WorldModel_8C-source.html#l00658">WorldModel::getGlobalPosition</a>(), <a class="el" href="WorldModel_8C-source.html#l00689">WorldModel::getGlobalVelocity</a>(), <a class="el" href="WorldModel_8C-source.html#l00835">WorldModel::getOppGoalieType</a>(), <a class="el" href="WorldModel_8C-source.html#l00282">WorldModel::getPlayerNumber</a>(), <a class="el" href="WorldModel_8C-source.html#l00300">WorldModel::getSide</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="WorldModelHighLevel_8C-source.html#l00712">WorldModel::isConfidenceGood</a>(), <a class="el" href="WorldModel_8C-source.html#l00818">WorldModel::isKnownPlayer</a>(), <a class="el" href="SoccerTypes_8h-source.html#l00062">MAX_OPPONENTS</a>, <a class="el" href="SoccerTypes_8h-source.html#l00069">MAX_SAY_MSG</a>, <a class="el" href="SoccerTypes_8h-source.html#l00061">MAX_TEAMMATES</a>, <a class="el" href="namespace_3globalScope_4.html#a240a24">OBJECT_BALL</a>, <a class="el" href="namespace_3globalScope_4.html#a240a97">OBJECT_OPPONENT_1</a>, <a class="el" href="namespace_3globalScope_4.html#a240a85">OBJECT_TEAMMATE_1</a>, <a class="el" href="SoccerTypes_8h-source.html#l00102">ObjectT</a>, <a class="el" href="BasicPlayer_8h-source.html#l00060">BasicPlayer::PS</a>, <a class="el" href="namespace_3globalScope_4.html#a246a177">SIDE_LEFT</a>, and <a class="el" href="BasicPlayer_8h-source.html#l00058">BasicPlayer::WM</a>.<p>Referenced by <a class="el" href="Player_8C-source.html#l00092">mainLoop</a>().    </td>  </tr></table><a name="a9" doxytag="Player::shallISaySomething"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">

⌨️ 快捷键说明

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