objects_8c-source.html

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

HTML
651
字号
00501 }00502 00508 <font class="keywordtype">bool</font> <a class="code" href="classPlayerObject.html#a13">PlayerObject::setGlobalNeckAngle</a>( <a class="code" href="Geometry_8h.html#a2">AngDeg</a> ang, <a class="code" href="classTime.html">Time</a> time )<a name="l00509"></a><a class="code" href="classPlayerObject.html#a13">00509</a> {00510   <a class="code" href="classPlayerObject.html#n3">angGlobalNeckAngle</a> = ang;00511   <a class="code" href="classPlayerObject.html#a17">setTimeGlobalAngles</a>( time );00512   <font class="keywordflow">return</font> <font class="keyword">true</font>;00513 }00514 00518 <a class="code" href="Geometry_8h.html#a2">AngDeg</a> <a class="code" href="classPlayerObject.html#a14">PlayerObject::getGlobalNeckAngle</a>( )  <font class="keyword">const</font><a name="l00519"></a><a class="code" href="classPlayerObject.html#a14">00519</a> {00520   <font class="keywordflow">return</font> angGlobalNeckAngle;00521 }00522 00526 <font class="keywordtype">bool</font> <a class="code" href="classPlayerObject.html#a15">PlayerObject::setTimeRelativeAngles</a>( <a class="code" href="classTime.html">Time</a> time )<a name="l00527"></a><a class="code" href="classPlayerObject.html#a15">00527</a> {00528   <a class="code" href="classPlayerObject.html#o2">timeRelativeAngles</a> = time;00529   <font class="keywordflow">return</font> <font class="keyword">true</font>;00530 }00531 00535 <a class="code" href="classTime.html">Time</a> <a class="code" href="classPlayerObject.html#a16">PlayerObject::getTimeRelativeAngles</a>( )<font class="keyword"> const</font><a name="l00536"></a><a class="code" href="classPlayerObject.html#a16">00536</a> <font class="keyword"></font>{00537   <font class="keywordflow">return</font> <a class="code" href="classPlayerObject.html#o2">timeRelativeAngles</a> ;00538 }00539 00543 <font class="keywordtype">bool</font> <a class="code" href="classPlayerObject.html#a17">PlayerObject::setTimeGlobalAngles</a>( <a class="code" href="classTime.html">Time</a> time )<a name="l00544"></a><a class="code" href="classPlayerObject.html#a17">00544</a> {00545   <a class="code" href="classPlayerObject.html#n4">timeGlobalAngles</a> = time;00546   <font class="keywordflow">return</font> <font class="keyword">true</font>;00547 }00548 00552 <a class="code" href="classTime.html">Time</a> <a class="code" href="classPlayerObject.html#a18">PlayerObject::getTimeGlobalAngles</a>( )<font class="keyword"> const</font><a name="l00553"></a><a class="code" href="classPlayerObject.html#a18">00553</a> <font class="keyword"></font>{00554   <font class="keywordflow">return</font> <a class="code" href="classPlayerObject.html#n4">timeGlobalAngles</a> ;00555 }00556 00563 <font class="keywordtype">bool</font> <a class="code" href="classPlayerObject.html#a3">PlayerObject::setIsKnownPlayer</a>( <font class="keywordtype">bool</font> b )<a name="l00564"></a><a class="code" href="classPlayerObject.html#a3">00564</a> {00565   <a class="code" href="classPlayerObject.html#n0">isKnownPlayer</a> = b;00566   <font class="keywordflow">return</font> <font class="keyword">true</font>;00567 }00568 00574 <font class="keywordtype">bool</font> <a class="code" href="classPlayerObject.html#a4">PlayerObject::getIsKnownPlayer</a>()<font class="keyword"> const</font><a name="l00575"></a><a class="code" href="classPlayerObject.html#a4">00575</a> <font class="keyword"></font>{00576   <font class="keywordflow">return</font> <a class="code" href="classPlayerObject.html#n0">isKnownPlayer</a>;00577 }00578 00582 <font class="keywordtype">bool</font> <a class="code" href="classPlayerObject.html#a5">PlayerObject::setIsGoalie</a>( <font class="keywordtype">bool</font> b )<a name="l00583"></a><a class="code" href="classPlayerObject.html#a5">00583</a> {00584   <a class="code" href="classPlayerObject.html#n1">isGoalie</a> = b;00585   <font class="keywordflow">return</font> <font class="keyword">true</font>;00586 }00587 00590 <font class="keywordtype">bool</font> <a class="code" href="classPlayerObject.html#a6">PlayerObject::getIsGoalie</a>()<font class="keyword"> const</font><a name="l00591"></a><a class="code" href="classPlayerObject.html#a6">00591</a> <font class="keyword"></font>{00592   <font class="keywordflow">return</font> <a class="code" href="classPlayerObject.html#n1">isGoalie</a>;00593 }00594 00595 00599 <font class="keywordtype">void</font> <a class="code" href="classPlayerObject.html#a1">PlayerObject::show</a>( ostream &amp; os )<a name="l00600"></a><a class="code" href="classPlayerObject.html#a1">00600</a> {00601   <a class="code" href="classPlayerObject.html#a1">show</a>( <a class="code" href="SoccerTypes_8h.html#a11">DEFAULT_TEAM_NAME</a>, os );00602 }00603 00608 <font class="keywordtype">void</font> <a class="code" href="classPlayerObject.html#a1">PlayerObject::show</a>( <font class="keyword">const</font> <font class="keywordtype">char</font>* strTeamName , ostream &amp; os )<a name="l00609"></a><a class="code" href="classPlayerObject.html#a2">00609</a> {00610   <font class="keywordtype">char</font> buf[<a class="code" href="SoccerTypes_8h.html#a8">MAX_TEAM_NAME_LENGTH</a>];00611   <a class="code" href="classSoccerTypes.html#d0">SoccerTypes::getObjectStr</a>( buf, <a class="code" href="classObject.html#n0">objectType</a>, strTeamName );00612   os &lt;&lt; buf &lt;&lt; <font class="stringliteral">"(rel("</font>                &lt;&lt; <a class="code" href="classObject.html#n4">posRelative</a>00613             &lt;&lt; <font class="stringliteral">", "</font>                   &lt;&lt; <a class="code" href="classObject.html#n5">timeRelativePosition</a>00614             &lt;&lt; <font class="stringliteral">") (global("</font>           &lt;&lt; <a class="code" href="classObject.html#n2">posGlobal</a>00615             &lt;&lt; <font class="stringliteral">", "</font>                   &lt;&lt; <a class="code" href="classObject.html#n3">timeGlobalPosition</a>00616             &lt;&lt; <font class="stringliteral">")(vel("</font>               &lt;&lt; <a class="code" href="classDynamicObject.html#n0">vecGlobalVelocity</a>00617             &lt;&lt; <font class="stringliteral">", "</font>                   &lt;&lt; <a class="code" href="classDynamicObject.html#n1">timeGlobalVelocity</a>00618             &lt;&lt; <font class="stringliteral">"(ang(b:"</font>              &lt;&lt; <a class="code" href="classPlayerObject.html#a10">getGlobalBodyAngle</a>()00619             &lt;&lt; <font class="stringliteral">", n:"</font>                 &lt;&lt; <a class="code" href="classPlayerObject.html#n3">angGlobalNeckAngle</a>00620             &lt;&lt; <font class="stringliteral">", "</font>                   &lt;&lt; <a class="code" href="classPlayerObject.html#n4">timeGlobalAngles</a>00621             &lt;&lt; <font class="stringliteral">")(lastseen:"</font>          &lt;&lt; <a class="code" href="classObject.html#n1">timeLastSeen</a>00622             &lt;&lt; <font class="stringliteral">", globalposderived: "</font> &lt;&lt;  <a class="code" href="classObject.html#n7">timeGlobalPosDerivedFromSee</a> &lt;&lt; endl;00623 }00624 00625 <font class="comment">/******************************************************************************/</font>00626 <font class="comment">/********************** CLASS BALLOBJECT **************************************/</font>00627 <font class="comment">/******************************************************************************/</font>00628 00631 <a class="code" href="classBallObject.html#a0">BallObject::BallObject</a>():<a class="code" href="classDynamicObject.html">DynamicObject</a>()<a name="l00632"></a><a class="code" href="classBallObject.html#a0">00632</a> {00633 00634 }00635 00638 <font class="keywordtype">void</font> <a class="code" href="classBallObject.html#a1">BallObject::show</a>( ostream&amp; os)<a name="l00639"></a><a class="code" href="classBallObject.html#a1">00639</a> {00640   <font class="keywordtype">char</font> buf[<a class="code" href="SoccerTypes_8h.html#a8">MAX_TEAM_NAME_LENGTH</a>];00641   <a class="code" href="classSoccerTypes.html#d0">SoccerTypes::getObjectStr</a>( buf, <a class="code" href="classObject.html#n0">objectType</a>, <a class="code" href="SoccerTypes_8h.html#a11">DEFAULT_TEAM_NAME</a> );00642   os &lt;&lt;  buf00643        &lt;&lt; <font class="stringliteral">" rel("</font>               &lt;&lt; <a class="code" href="classObject.html#n4">posRelative</a>00644        &lt;&lt; <font class="stringliteral">",r: "</font>                &lt;&lt; <a class="code" href="classObject.html#n4">posRelative</a>.<a class="code" href="classVecPosition.html#a32">getMagnitude</a>()00645        &lt;&lt; <font class="stringliteral">", phi: "</font>             &lt;&lt; <a class="code" href="classObject.html#n4">posRelative</a>.<a class="code" href="classVecPosition.html#a33">getDirection</a>()00646        &lt;&lt; <font class="stringliteral">", "</font>                  &lt;&lt; <a class="code" href="classObject.html#n5">timeRelativePosition</a>00647        &lt;&lt; <font class="stringliteral">") global("</font>           &lt;&lt; <a class="code" href="classObject.html#n2">posGlobal</a>00648        &lt;&lt; <font class="stringliteral">", "</font>                  &lt;&lt; <a class="code" href="classObject.html#n3">timeGlobalPosition</a>00649        &lt;&lt; <font class="stringliteral">"), vel("</font>             &lt;&lt; <a class="code" href="classDynamicObject.html#n0">vecGlobalVelocity</a>00650        &lt;&lt; <font class="stringliteral">", "</font>                  &lt;&lt; <a class="code" href="classDynamicObject.html#n1">timeGlobalVelocity</a>00651        &lt;&lt; <font class="stringliteral">"), changes("</font>         &lt;&lt; <a class="code" href="classDynamicObject.html#n2">dRelativeDistanceChange</a>00652        &lt;&lt; <font class="stringliteral">", "</font>                  &lt;&lt; <a class="code" href="classDynamicObject.html#n3">dRelativeAngleChange</a>00653        &lt;&lt; <font class="stringliteral">") last seen:"</font>        &lt;&lt; <a class="code" href="classObject.html#n1">timeLastSeen</a>00654        &lt;&lt; <font class="stringliteral">" globalposderived: "</font> &lt;&lt; <a class="code" href="classObject.html#n7">timeGlobalPosDerivedFromSee</a> &lt;&lt; endl;00655 }00656 00657 <font class="comment">/******************************************************************************/</font>00658 <font class="comment">/********************** CLASS AGENTOBJECT *************************************/</font>00659 <font class="comment">/******************************************************************************/</font>00660 00665 <a class="code" href="classAgentObject.html#a0">AgentObject::AgentObject</a>( <font class="keywordtype">double</font> dStaminaMax ):<a class="code" href="classPlayerObject.html">PlayerObject</a>( )<a name="l00666"></a><a class="code" href="classAgentObject.html#a0">00666</a> {00667   <a class="code" href="classAgentObject.html#o0">viewAngle</a>              = <a class="code" href="SoccerTypes_8h.html#a244a173">VA_ILLEGAL</a>;00668   <a class="code" href="classAgentObject.html#o1">viewQuality</a>            = <a class="code" href="SoccerTypes_8h.html#a245a176">VQ_ILLEGAL</a>;00669 00670   <a class="code" href="classAgentObject.html#o2">stamina</a>.<a class="code" href="classStamina.html#a3">setStamina</a> ( dStaminaMax );00671   <a class="code" href="classAgentObject.html#o2">stamina</a>.<a class="code" href="classStamina.html#a5">setEffort</a>  ( 1.0 );00672   <a class="code" href="classAgentObject.html#o2">stamina</a>.<a class="code" href="classStamina.html#a7">setRecovery</a>( 1.0 );00673   <a class="code" href="classAgentObject.html#o3">velSpeedRelToNeck</a>.<a class="code" href="classVecPosition.html#a29">setVecPosition</a>( 0.0, 0.0 );00674 00675   <a class="code" href="classPlayerObject.html#n3">angGlobalNeckAngle</a>   = <a class="code" href="SoccerTypes_8h.html#a20">UnknownAngleValue</a>;00676   <a class="code" href="classAgentObject.html#o4">angBodyAngleRelToNeck</a>  = <a class="code" href="SoccerTypes_8h.html#a20">UnknownAngleValue</a>;00677 }00678 00682 <font class="keywordtype">void</font> <a class="code" href="classAgentObject.html#a1">AgentObject::show</a>( ostream&amp; os )<a name="l00683"></a><a class="code" href="classAgentObject.html#a1">00683</a> {00684   <a class="code" href="classAgentObject.html#a1">show</a>( <a class="code" href="SoccerTypes_8h.html#a11">DEFAULT_TEAM_NAME</a>, os );00685 }00686 00691 <font class="keywordtype">void</font> <a class="code" href="classAgentObject.html#a1">AgentObject::show</a>( <font class="keyword">const</font> <font class="keywordtype">char</font> * strTeamName, ostream &amp; os )<a name="l00692"></a><a class="code" href="classAgentObject.html#a2">00692</a> {00693   <font class="keywordtype">char</font> buf[<a class="code" href="SoccerTypes_8h.html#a8">MAX_TEAM_NAME_LENGTH</a>];00694   <a class="code" href="classSoccerTypes.html#d0">SoccerTypes::getObjectStr</a>( buf, <a class="code" href="classObject.html#n0">objectType</a>, strTeamName );00695   os   &lt;&lt;  buf00696        &lt;&lt; <font class="stringliteral">" (global("</font>    &lt;&lt; <a class="code" href="classObject.html#n2">posGlobal</a>00697        &lt;&lt; <font class="stringliteral">", "</font>           &lt;&lt; <a class="code" href="classObject.html#n3">timeGlobalPosition</a>00698        &lt;&lt; <font class="stringliteral">") (vel("</font>      &lt;&lt; <a class="code" href="classDynamicObject.html#n0">vecGlobalVelocity</a>00699        &lt;&lt; <font class="stringliteral">", "</font>           &lt;&lt; <a class="code" href="classDynamicObject.html#n1">timeGlobalVelocity</a>00700        &lt;&lt; <font class="stringliteral">") (angles(n:"</font> &lt;&lt; <a class="code" href="classPlayerObject.html#n3">angGlobalNeckAngle</a>00701        &lt;&lt; <font class="stringliteral">", b:"</font>         &lt;&lt; <a class="code" href="classAgentObject.html#o4">angBodyAngleRelToNeck</a> &lt;&lt; <font class="stringliteral">") "</font>;00702   <a class="code" href="classAgentObject.html#o2">stamina</a>.<a class="code" href="classStamina.html#a1">show</a>( os );00703 }00704 00708 <a class="code" href="SoccerTypes_8h.html#a244">ViewAngleT</a> <a class="code" href="classAgentObject.html#a5">AgentObject::getViewAngle</a>()<font class="keyword"> const</font><a name="l00709"></a><a class="code" href="classAgentObject.html#a5">00709</a> <font class="keyword"></font>{00710   <font class="keywordflow">return</font> <a class="code" href="classAgentObject.html#o0">viewAngle</a>;00711 }00712 00718 <a class="code" href="classVecPosition.html">VecPosition</a> <a class="code" href="classAgentObject.html#a3">AgentObject::getPositionDifference</a>()<font class="keyword"> const</font><a name="l00719"></a><a class="code" href="classAgentObject.html#a3">00719</a> <font class="keyword"></font>{00720   <font class="keywordflow">return</font> <a class="code" href="classAgentObject.html#o5">posPositionDifference</a>;00721 }00722 00728 <font class="keywordtype">bool</font>  <a class="code" href="classAgentObject.html#a4">AgentObject::setPositionDifference</a>( <a class="code" href="classVecPosition.html">VecPosition</a> p )<a name="l00729"></a><a class="code" href="classAgentObject.html#a4">00729</a> {00730   <a class="code" href="classAgentObject.html#o5">posPositionDifference</a> = p;00731   <font class="keywordflow">return</font> <font class="keyword">true</font>;00732 }00733 00737 <font class="keywordtype">bool</font> <a class="code" href="classAgentObject.html#a6">AgentObject::setViewAngle</a>( <a class="code" href="SoccerTypes_8h.html#a244">ViewAngleT</a> v )

⌨️ 快捷键说明

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