⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classacthandler.html

📁 仿真人工智能是指用人工的方法和技术
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!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>ActHandler 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> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>ActHandler  Class Reference</h1><code>#include &lt;<a class="el" href="ActHandler_8h-source.html">ActHandler.h</a>&gt;</code><p>Collaboration diagram for ActHandler:<p><center><img src="classActHandler__coll__graph.gif" border="0" usemap="#ActHandler__coll__map" alt="Collaboration graph"></center><map name="ActHandler__coll__map"><area href="classWorldModel.html" shape="rect" coords="503,120,586,139" alt=""><area href="classServerSettings.html" shape="rect" coords="25,71,115,89" alt=""><area href="classSoccerCommand.html" shape="rect" coords="194,128,298,147" alt=""><area href="classConnection.html" shape="rect" coords="507,243,582,261" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classActHandler-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>&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a0">ActHandler</a> (<a class="el" href="classConnection.html">Connection</a> *c, <a class="el" href="classWorldModel.html">WorldModel</a> *wm, <a class="el" href="classServerSettings.html">ServerSettings</a> *ss)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a1">putCommandInQueue</a> (<a class="el" href="classSoccerCommand.html">SoccerCommand</a> command)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a2">emptyQueue</a> ()</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a3">isQueueEmpty</a> ()</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a4">sendCommands</a> ()</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a5">sendCommand</a> (<a class="el" href="classSoccerCommand.html">SoccerCommand</a> soc)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a6">sendMessage</a> (char *str)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a7">sendCommandDirect</a> (<a class="el" href="classSoccerCommand.html">SoccerCommand</a> soc)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#a8">sendMessageDirect</a> (char *str)</td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classConnection.html">Connection</a> *&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#o0">connection</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classServerSettings.html">ServerSettings</a> *&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#o1">SS</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classWorldModel.html">WorldModel</a> *&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#o2">WM</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classSoccerCommand.html">SoccerCommand</a>&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#o3">m_queueOneCycleCommand</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classSoccerCommand.html">SoccerCommand</a>&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#o4">m_queueMultipleCommands</a> [MAX_COMMANDS]</td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classActHandler.html#o5">m_iMultipleCommands</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>The ActHandler Class is used in the RoboCup Soccer environment to send the commands to the soccerserver. The ActHandler contains a queue in which the commands are put. When a signal arrives (set by the <a class="el" href="classSenseHandler.html">SenseHandler</a> depending on the time of the sense_body message) the commands that are currently in the queue are converted to text strings and send to the server. The sent commands are also passed to the <a class="el" href="classWorldModel.html">WorldModel</a>, such that the <a class="el" href="classWorldModel.html">WorldModel</a> can update its internal state based on the performed actions. It is possible to send more than one command to the server at each time step, but some type of (primary) commands can only be sent once (kick,dash, move, turn and catch). Therefore internally two queues are stored. One with only one element,namely the last entered primary command. And the other with all the other commands. Each time a command is put into the queue that is already there, the command is updated with the new information. Furthermore it is also possible to directly send commands (or text strings) to the server. These methods can be used when an initialization or move command has to be sent to the server and you're sure this information is final, i.e. the message will not become better when new information arrives from the server. <p><p>Definition at line <a class="el" href="ActHandler_8h-source.html#l00075">75</a> of file <a class="el" href="ActHandler_8h-source.html">ActHandler.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2><a name="a0" doxytag="ActHandler::ActHandler"></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"> ActHandler::ActHandler </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classConnection.html">Connection</a> *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>c</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classWorldModel.html">WorldModel</a> *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>wm</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classServerSettings.html">ServerSettings</a> *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>ss</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This is the constructor for the ActHandler class. All the variables are initialized. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>c</em>&nbsp;</td><td><a class="el" href="classConnection.html">Connection</a> that is connected with the soccerserver </td></tr><tr><td valign=top><em>wm</em>&nbsp;</td><td><a class="el" href="classWorldModel.html">WorldModel</a>, used to set performed commands </td></tr><tr><td valign=top><em>ss</em>&nbsp;</td><td><a class="el" href="classServerSettings.html">ServerSettings</a> in which server settings are defined </td></tr></table></dl><p>Definition at line <a class="el" href="ActHandler_8C-source.html#l00067">67</a> of file <a class="el" href="ActHandler_8C-source.html">ActHandler.C</a>.<p>References <a class="el" href="ActHandler_8h-source.html#l00077">connection</a>, <a class="el" href="ActHandler_8h-source.html#l00083">m_iMultipleCommands</a>, <a class="el" href="ActHandler_8h-source.html#l00078">SS</a>, and <a class="el" href="ActHandler_8h-source.html#l00079">WM</a>.    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="a2" doxytag="ActHandler::emptyQueue"></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 ActHandler::emptyQueue </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 empties the queue in which all the commands are stored. <p>Definition at line <a class="el" href="ActHandler_8C-source.html#l00078">78</a> of file <a class="el" href="ActHandler_8C-source.html">ActHandler.C</a>.<p>References <a class="el" href="namespace_3globalScope_4.html#a247a180">CMD_ILLEGAL</a>, <a class="el" href="SoccerTypes_8h-source.html#l00489">SoccerCommand::commandType</a>, <a class="el" href="ActHandler_8h-source.html#l00083">m_iMultipleCommands</a>, <a class="el" href="ActHandler_8h-source.html#l00082">m_queueMultipleCommands</a>, <a class="el" href="ActHandler_8h-source.html#l00081">m_queueOneCycleCommand</a>, and <a class="el" href="SoccerTypes_8h-source.html#l00067">MAX_COMMANDS</a>.<p>Referenced by <a class="el" href="ActHandler_8C-source.html#l00216">sendMessage</a>().    </td>  </tr></table><a name="a3" doxytag="ActHandler::isQueueEmpty"></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 ActHandler::isQueueEmpty </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 returns whether the current queue contains no commands <dl compact><dt><b>Returns: </b><dd>true when queue is empty, false otherwise </dl><p>Definition at line <a class="el" href="ActHandler_8C-source.html#l00088">88</a> of file <a class="el" href="ActHandler_8C-source.html">ActHandler.C</a>.<p>References <a class="el" href="namespace_3globalScope_4.html#a247a180">CMD_ILLEGAL</a>, <a class="el" href="SoccerTypes_8h-source.html#l00489">SoccerCommand::commandType</a>, <a class="el" href="ActHandler_8h-source.html#l00083">m_iMultipleCommands</a>, and <a class="el" href="ActHandler_8h-source.html#l00081">m_queueOneCycleCommand</a>.    </td>  </tr></table><a name="a1" doxytag="ActHandler::putCommandInQueue"></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 ActHandler::putCommandInQueue </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classSoccerCommand.html">SoccerCommand</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>command</em>          </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>

⌨️ 快捷键说明

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