classplayer.html
来自「仿真人工智能是指用人工的方法和技术」· HTML 代码 · 共 781 行 · 第 1/4 页
HTML
781 行
<!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>Player class Reference</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>Player Class Reference</h1><code>#include <<a class="el" href="Player_8h-source.html">Player.h</a>></code><p>Inheritance diagram for Player:<p><center><img src="classPlayer__inherit__graph.gif" border="0" usemap="#Player__inherit__map" alt="Inheritance graph"></center><map name="Player__inherit__map"><area href="classBasicPlayer.html" shape="rect" coords="14,14,91,33" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Player:<p><center><img src="classPlayer__coll__graph.gif" border="0" usemap="#Player__coll__map" alt="Collaboration graph"></center><map name="Player__coll__map"><area href="classBasicPlayer.html" shape="rect" coords="177,262,254,281" alt=""><area href="classPlayerSettings.html" shape="rect" coords="23,14,114,33" alt=""><area href="classWorldModel.html" shape="rect" coords="93,97,175,115" alt=""><area href="classActHandler.html" shape="rect" coords="178,179,253,198" alt=""><area href="classServerSettings.html" shape="rect" coords="195,14,286,33" alt=""><area href="classFormations.html" shape="rect" coords="327,262,402,281" alt=""><area href="classFormationTypeInfo.html" shape="rect" coords="343,179,461,198" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classPlayer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPlayer.html#a0">Player</a> (<a class="el" href="classActHandler.html">ActHandler</a> *a, <a class="el" href="classWorldModel.html">WorldModel</a> *wm, <a class="el" href="classServerSettings.html">ServerSettings</a> *ss, <a class="el" href="classPlayerSettings.html">PlayerSettings</a> *cs, <a class="el" href="classFormations.html">Formations</a> *fs, char *strTeamName, double dVersion, int iReconnect=-1)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a> </td><td valign=bottom><a class="el" href="classPlayer.html#a1">getStrategicPosition</a> (int iPlayer=-1)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#a2">mainLoop</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#a3">deMeer5</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#a4">deMeer5_goalie</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#a5">handleStdin</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#a6">showStringCommands</a> (ostream &out)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classPlayer.html#a7">executeStringCommand</a> (char *str)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#a8">test_only_update</a> ()</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classPlayer.html#a9">shallISaySomething</a> ()</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classPlayer.html#a10">amIAgentToSaySomething</a> ()</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classSoccerCommand.html">SoccerCommand</a> </td><td valign=bottom><a class="el" href="classPlayer.html#a11">sayWorldStatus</a> ()</td></tr><tr><td colspan=2><br><h2>Private Methods</h2></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#c0">goalieMainLoop</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#c1">defenderMainLoop</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#c2">midfielderMainLoop</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPlayer.html#c3">attackerMainLoop</a> ()</td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classFormations.html">Formations</a> * </td><td valign=bottom><a class="el" href="classPlayer.html#o0">formations</a></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classPlayer.html#o1">bContLoop</a></td></tr><tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classPlayer.html#o2">m_lastSay</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class is a superclass from <a class="el" href="classBasicPlayer.html">BasicPlayer</a> and contains a more sophisticated decision procedure to determine the next action. <p><p>Definition at line <a class="el" href="Player_8h-source.html#l00054">54</a> of file <a class="el" href="Player_8h-source.html">Player.h</a>.<hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="Player::Player"></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"> Player::Player </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classActHandler.html">ActHandler</a> * </td> <td class="mdname" nowrap> <em>act</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classWorldModel.html">WorldModel</a> * </td> <td class="mdname" nowrap> <em>wm</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classServerSettings.html">ServerSettings</a> * </td> <td class="mdname" nowrap> <em>ss</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classPlayerSettings.html">PlayerSettings</a> * </td> <td class="mdname" nowrap> <em>ps</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classFormations.html">Formations</a> * </td> <td class="mdname" nowrap> <em>fs</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>strTeamName</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>double </td> <td class="mdname" nowrap> <em>dVersion</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>iReconnect</em> = -1</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This is the constructor the Player class and calls the constructor of the superclass <a class="el" href="classBasicPlayer.html">BasicPlayer</a>. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>act</em> </td><td><a class="el" href="classActHandler.html">ActHandler</a> to which the actions can be sent </td></tr><tr><td valign=top><em>wm</em> </td><td><a class="el" href="classWorldModel.html">WorldModel</a> which information is used to determine action </td></tr><tr><td valign=top><em>ss</em> </td><td><a class="el" href="classServerSettings.html">ServerSettings</a> that contain parameters used by the server </td></tr><tr><td valign=top><em>ps</em> </td><td><a class="el" href="classPlayerSettings.html">PlayerSettings</a> that contain parameters important for the client </td></tr><tr><td valign=top><em>strTeamName</em> </td><td>team name of this player </td></tr><tr><td valign=top><em>dVersion</em> </td><td>version this basicplayer corresponds to </td></tr><tr><td valign=top><em>iReconnect</em> </td><td>integer that defines player number (-1 when new player) </td></tr></table></dl><p>Definition at line <a class="el" href="Player_8C-source.html#l00058">58</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_8h-source.html#l00057">bContLoop</a>, <a class="el" href="Player_8h-source.html#l00056">formations</a>, <a class="el" href="Formations_8C-source.html#l00660">Formations::getPlayerInFormation</a>(), <a class="el" href="Formations_8C-source.html#l00667">Formations::getPlayerType</a>(), <a class="el" href="Player_8h-source.html#l00059">m_lastSay</a>, <a class="el" href="SoccerTypes_8h-source.html#l00068">MAX_MSG</a>, <a class="el" href="BasicPlayer_8h-source.html#l00060">BasicPlayer::PS</a>, <a class="el" href="namespace_3globalScope_4.html#a248a193">PT_GOALKEEPER</a>, <a class="el" href="ActHandler_8C-source.html#l00216">ActHandler::sendMessage</a>(), <a class="el" href="WorldModel_8C-source.html#l00325">WorldModel::setTeamName</a>(), <a class="el" href="BasicPlayer_8h-source.html#l00059">BasicPlayer::SS</a>, and <a class="el" href="BasicPlayer_8h-source.html#l00058">BasicPlayer::WM</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a10" doxytag="Player::amIAgentToSaySomething"></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"> bool Player::amIAgentToSaySomething </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This method returns a boolean indicating whether I should communicate my world model to the other agents. This depends on the last sent message and a simple utility function that determines whether I am best positioned on the field. <dl compact><dt><b>Returns: </b><dd>boolean indicating whether I should communicate my world model. </dl><p>Definition at line <a class="el" href="Player_8C-source.html#l00665">665</a> of file <a class="el" href="Player_8C-source.html">Player.C</a>.<p>References <a class="el" href="WorldModel_8C-source.html#l00620">WorldModel::getBallPos</a>(), <a class="el" href="WorldModel_8C-source.html#l00282">WorldModel::getPlayerNumber</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="SoccerTypes_8h-source.html#l00075">PITCH_LENGTH</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#l00650">shallISaySomething</a>(). </td> </tr></table><a name="c3" doxytag="Player::attackerMainLoop"></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::attackerMainLoop </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?