classsensehandler.html
来自「仿真人工智能是指用人工的方法和技术」· HTML 代码 · 共 916 行 · 第 1/4 页
HTML
916 行
This method analyzes a hear message. When the message is from the referee the message is parsed and the new play mode is set or the goal difference is adjusted. When the message comes from another player the method analyzePlayerMessage is called A hear message looks like (hear 0 self|referee|dir message) <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strMsg</em> </td><td>message that should be parsed </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>bool indicating whether the message was parsed correctly. </dl><p>Definition at line <a class="el" href="SenseHandler_8C-source.html#l00428">428</a> of file <a class="el" href="SenseHandler_8C-source.html">SenseHandler.C</a>.<p>References <a class="el" href="WorldModel_8C-source.html#l00363">WorldModel::addOneToGoalDiff</a>(), <a class="el" href="SenseHandler_8C-source.html#l00493">analyzePlayerMessage</a>(), <a class="el" href="WorldModel_8C-source.html#l00177">WorldModel::getCurrentTime</a>(), <a class="el" href="SoccerTypes_8C-source.html#l01511">SoccerTypes::getPlayModeFromRefereeMessage</a>(), <a class="el" href="SoccerTypes_8C-source.html#l01585">SoccerTypes::getRefereeMessageFromStr</a>(), <a class="el" href="SoccerTypes_8C-source.html#l01544">SoccerTypes::getRefereeMessageStr</a>(), <a class="el" href="WorldModel_8C-source.html#l00300">WorldModel::getSide</a>(), <a class="el" href="Parse_8C-source.html#l00058">Parse::gotoFirstNonSpace</a>(), <a class="el" href="Parse_8C-source.html#l00087">Parse::gotoFirstOccurenceOf</a>(), <a class="el" href="namespace_3globalScope_4.html#a240a24">OBJECT_BALL</a>, <a class="el" href="Parse_8C-source.html#l00107">Parse::parseFirstInt</a>(), <a class="el" href="SoccerTypes_8h-source.html#l00211">PlayModeT</a>, <a class="el" href="namespace_3globalScope_4.html#a242a140">PM_ILLEGAL</a>, <a class="el" href="WorldModelUpdate_8C-source.html#l00369">WorldModel::processCatchedBall</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l00063">WorldModel::processSeeGlobalInfo</a>(), <a class="el" href="namespace_3globalScope_4.html#a243a165">REFC_GOAL_LEFT</a>, <a class="el" href="namespace_3globalScope_4.html#a243a166">REFC_GOAL_RIGHT</a>, <a class="el" href="namespace_3globalScope_4.html#a243a168">REFC_GOALIE_CATCH_BALL_LEFT</a>, <a class="el" href="namespace_3globalScope_4.html#a243a169">REFC_GOALIE_CATCH_BALL_RIGHT</a>, <a class="el" href="SoccerTypes_8h-source.html#l00237">RefereeMessageT</a>, <a class="el" href="WorldModel_8C-source.html#l00342">WorldModel::setPlayMode</a>(), <a class="el" href="WorldModel_8C-source.html#l00160">WorldModel::setTimeLastRefereeMessage</a>(), <a class="el" href="namespace_3globalScope_4.html#a246a177">SIDE_LEFT</a>, <a class="el" href="namespace_3globalScope_4.html#a246a178">SIDE_RIGHT</a>, <a class="el" href="WorldModel_8h-source.html#l00167">WorldModel::strLastHearMessage</a>, <a class="el" href="WorldModel_8C-source.html#l00371">WorldModel::subtractOneFromGoalDiff</a>(), and <a class="el" href="SenseHandler_8h-source.html#l00066">WM</a>.<p>Referenced by <a class="el" href="SenseHandler_8C-source.html#l00163">analyzeMessage</a>(). </td> </tr></table><a name="a7" doxytag="SenseHandler::analyzeInitMessage"></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 SenseHandler::analyzeInitMessage </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char * </td> <td class="mdname1" valign="top" nowrap> <em>strMsg</em> </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 analyzes an init message. All information from the initialization is parsed and updated in the <a class="el" href="classWorldModel.html">WorldModel</a>. An init message looks like (init [l|r] 10 before_kick_off) <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strMsg</em> </td><td>message that should be parsed </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>bool indicating whether the message was parsed correctly. </dl><p>Definition at line <a class="el" href="SenseHandler_8C-source.html#l00404">404</a> of file <a class="el" href="SenseHandler_8C-source.html">SenseHandler.C</a>.<p>References <a class="el" href="SoccerTypes_8C-source.html#l01501">SoccerTypes::getPlayModeFromStr</a>(), <a class="el" href="SoccerTypes_8C-source.html#l01772">SoccerTypes::getSideFromStr</a>(), <a class="el" href="SoccerTypes_8C-source.html#l01159">SoccerTypes::getTeammateObjectFromIndex</a>(), <a class="el" href="Parse_8C-source.html#l00107">Parse::parseFirstInt</a>(), <a class="el" href="WorldModel_8C-source.html#l00511">WorldModel::setAgentObjectType</a>(), <a class="el" href="WorldModel_8C-source.html#l00291">WorldModel::setPlayerNumber</a>(), <a class="el" href="WorldModel_8C-source.html#l00342">WorldModel::setPlayMode</a>(), <a class="el" href="WorldModel_8C-source.html#l00308">WorldModel::setSide</a>(), and <a class="el" href="SenseHandler_8h-source.html#l00066">WM</a>.<p>Referenced by <a class="el" href="SenseHandler_8C-source.html#l00163">analyzeMessage</a>(). </td> </tr></table><a name="a3" doxytag="SenseHandler::analyzeMessage"></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 SenseHandler::analyzeMessage </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char * </td> <td class="mdname1" valign="top" nowrap> <em>strMsg</em> </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 analyzes the type of the incoming message and calls the message that corresponds to this message. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strMsg</em> </td><td>message that should be parsed. </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>bool indicating whether the message was parsed or not </dl><p>Definition at line <a class="el" href="SenseHandler_8C-source.html#l00163">163</a> of file <a class="el" href="SenseHandler_8C-source.html">SenseHandler.C</a>.<p>References <a class="el" href="SenseHandler_8C-source.html#l00620">analyzeChangePlayerTypeMessage</a>(), <a class="el" href="SenseHandler_8C-source.html#l00606">analyzeCheckBall</a>(), <a class="el" href="SenseHandler_8C-source.html#l00428">analyzeHearMessage</a>(), <a class="el" href="SenseHandler_8C-source.html#l00404">analyzeInitMessage</a>(), <a class="el" href="SenseHandler_8C-source.html#l00780">analyzePlayerParamMessage</a>(), <a class="el" href="SenseHandler_8C-source.html#l00753">analyzePlayerTypeMessage</a>(), <a class="el" href="SenseHandler_8C-source.html#l00285">analyzeSeeGlobalMessage</a>(), <a class="el" href="SenseHandler_8C-source.html#l00206">analyzeSeeMessage</a>(), <a class="el" href="SenseHandler_8C-source.html#l00345">analyzeSenseMessage</a>(), and <a class="el" href="SenseHandler_8C-source.html#l00637">analyzeServerParamMessage</a>().<p>Referenced by <a class="el" href="SenseHandler_8C-source.html#l00101">handleMessagesFromServer</a>(). </td> </tr></table><a name="a9" doxytag="SenseHandler::analyzePlayerMessage"></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 SenseHandler::analyzePlayerMessage </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char * </td> <td class="mdname1" valign="top" nowrap> <em>strMsg</em> </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 analyzes a player message. Messages from teammates are encoded, so first the message is decoded to see if the message is from a teammate. When this is the case all information (position and velocity from sender and ball and position from all opponents and teammates) are parsed and passed to the <a class="el" href="classWorldModel.html">WorldModel</a>. The format of the received message is: (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 ...)) <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strMsg</em> </td><td>string that contains the player message </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>bool indicating whether the message was succesfully parsed. </dl><p>Definition at line <a class="el" href="SenseHandler_8C-source.html#l00493">493</a> of file <a class="el" href="SenseHandler_8C-source.html">SenseHandler.C</a>.<p>References <a class="el" href="WorldModel_8C-source.html#l00189">WorldModel::getCurrentCycle</a>(), <a class="el" href="SoccerTypes_8C-source.html#l01168">SoccerTypes::getOpponentObjectFromIndex</a>(), <a class="el" href="WorldModel_8C-source.html#l00300">WorldModel::getSide</a>(), <a class="el" href="SoccerTypes_8C-source.html#l01159">SoccerTypes::getTeammateObjectFromIndex</a>(), <a class="el" href="Parse_8C-source.html#l00058">Parse::gotoFirstNonSpace</a>(), <a class="el" href="Parse_8C-source.html#l00087">Parse::gotoFirstOccurenceOf</a>(), <a class="el" href="namespace_3globalScope_4.html#a240a108">OBJECT_OPPONENT_UNKNOWN</a>, <a class="el" href="namespace_3globalScope_4.html#a240a96">OBJECT_TEAMMATE_UNKNOWN</a>, <a class="el" href="SoccerTypes_8h-source.html#l00102">ObjectT</a>, <a class="el" href="Parse_8C-source.html#l00140">Parse::parseFirstDouble</a>(), <a class="el" href="Parse_8C-source.html#l00107">Parse::parseFirstInt</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l00232">WorldModel::processPerfectHearInfo</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l00207">WorldModel::processPerfectHearInfoBall</a>(), <a class="el" href="Geometry_8C-source.html#l00534">VecPosition::setX</a>(), <a class="el" href="Geometry_8C-source.html#l00550">VecPosition::setY</a>(), <a class="el" href="namespace_3globalScope_4.html#a246a177">SIDE_LEFT</a>, <a class="el" href="WorldModel_8h-source.html#l00167">WorldModel::strLastHearMessage</a>, and <a class="el" href="SenseHandler_8h-source.html#l00066">WM</a>.<p>Referenced by <a class="el" href="SenseHandler_8C-source.html#l00428">analyzeHearMessage</a>(). </td> </tr></table><a name="a14" doxytag="SenseHandler::analyzePlayerParamMessage"></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 SenseHandler::analyzePlayerParamMessage </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char * </td> <td class="mdname1" valign="top" nowrap> <em>strMsg</em> </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 analyzes the player_param message that indicates the ranges of the possible values for the heterogeneous player types. Nothing is done with this information. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strMsg</em> </td><td>string that contains the player_param message. \bool will always be true. </td></tr></table></dl><p>Definition at line <a class="el" href="SenseHandler_8C-source.html#l00780">780</a> of file <a class="el" href="SenseHandler_8C-source.html">SenseHandler.C</a>.<p>Referenced by <a class="el" href="SenseHandler_8C-source.html#l00163">analyzeMessage</a>(). </td> </tr></table><a name="a13" doxytag="SenseHandler::analyzePlayerTypeMessage"></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 SenseHandler::analyzePlayerTypeMessage </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char * </td> <td class="mdname1" valign="top" nowrap> <em>strMsg</em> </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 analyze a player type message. This message contains the values associated with a specific heterogeneous player type. The values are parsed from the message and supplied to the <a class="el" href="classWorldModel.html">WorldModel</a> method processNewHeteroPlayer. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strMsg</em> </td><td>string that contains the player type information </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>bool indicating whether the message was parsed correctly. </dl><p>Definition at line <a class="el" href="SenseHandler_8C-source.html#l00753">753</a> of file <a class="el" href="SenseHandler_8C-source.html">SenseHandler.C</a>.<p>References <a class="el" href="Parse_8C-source.html#l00140">Parse::parseFirstDouble</a>(), <a class="el" href="Parse_8C-source.html#l00107">Parse::parseFirstInt</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l00341">WorldModel::processNewHeteroPlayer</a>(), and <a class="el" href="SenseHandler_8h-source.html#l00066">WM</a>.<p>Referenced by <a class="el" href="SenseHandler_8C-source.html#l00163">analyzeMessage</a>(). </td> </tr></table><a name="a4" doxytag="SenseHandler::analyzeSeeGlobalMessage"></a><p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?