classobject.html

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

HTML
1,188
字号
<!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>Object 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>Object  Class Reference</h1><code>#include &lt;<a class="el" href="Objects_8h-source.html">Objects.h</a>&gt;</code><p>Inheritance diagram for Object:<p><center><img src="classObject__inherit__graph.gif" border="0" usemap="#Object__inherit__map" alt="Inheritance graph"></center><map name="Object__inherit__map"><area href="classDynamicObject.html" shape="rect" coords="50,80,146,99" alt=""><area href="classFixedObject.html" shape="rect" coords="170,80,247,99" alt=""><area href="classBallObject.html" shape="rect" coords="14,147,83,166" alt=""><area href="classPlayerObject.html" shape="rect" coords="107,147,190,166" alt=""><area href="classAgentObject.html" shape="rect" coords="109,214,189,232" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Object:<p><center><img src="classObject__coll__graph.gif" border="0" usemap="#Object__coll__map" alt="Collaboration graph"></center><map name="Object__coll__map"><area href="classVecPosition.html" shape="rect" coords="14,14,91,33" alt=""><area href="classTime.html" shape="rect" coords="191,14,231,33" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classObject-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="classObject.html#a0">Object</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a1">show</a> (ostream &amp;os=cout)=0</td></tr><tr><td nowrap align=right valign=top><a class="el" href="Geometry_8h.html#a2">AngDeg</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a2">getRelativeAngle</a> ()</td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a3">getRelativeDistance</a> ()</td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a4">getConfidence</a> (<a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a5">setType</a> (<a class="el" href="SoccerTypes_8h.html#a240">ObjectT</a> o)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="SoccerTypes_8h.html#a240">ObjectT</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a6">getType</a> () const</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a7">setRelativePosition</a> (double dDist, <a class="el" href="Geometry_8h.html#a2">AngDeg</a> dAng, <a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a8">setRelativePosition</a> (<a class="el" href="classVecPosition.html">VecPosition</a> v, <a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a9">getRelativePosition</a> () const</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a10">setTimeRelativePosition</a> (<a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classTime.html">Time</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a11">getTimeRelativePosition</a> () const</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a12">setGlobalPosition</a> (<a class="el" href="classVecPosition.html">VecPosition</a> p, <a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a13">getGlobalPosition</a> () const</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a14">setTimeGlobalPosition</a> (<a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classTime.html">Time</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a15">getTimeGlobalPosition</a> () const</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a16">setGlobalPositionLastSee</a> (<a class="el" href="classVecPosition.html">VecPosition</a> p, <a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a17">getGlobalPositionLastSee</a> () const</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a18">setTimeGlobalPosDerivedFromSee</a> (<a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classTime.html">Time</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a19">getTimeGlobalPosDerivedFromSee</a> () const</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a20">setTimeLastSeen</a> (<a class="el" href="classTime.html">Time</a> time)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classTime.html">Time</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#a21">getTimeLastSeen</a> () const</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="SoccerTypes_8h.html#a240">ObjectT</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#n0">objectType</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classTime.html">Time</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#n1">timeLastSeen</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#n2">posGlobal</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classTime.html">Time</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#n3">timeGlobalPosition</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#n4">posRelative</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classTime.html">Time</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#n5">timeRelativePosition</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#n6">posGlobalLastSee</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classTime.html">Time</a>&nbsp;</td><td valign=bottom><a class="el" href="classObject.html#n7">timeGlobalPosDerivedFromSee</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Class Object contains RoboCup information that is available for all objects in the simulation. All (relative) information is relative to an agent as declared in <a class="el" href="classAgentObject.html">AgentObject</a>. Update of an object (or one of the subclasses) happens by calling the standard get and set methods available in these classes. Calculations on these attributes do not occur in these classes, but in the update methods of the <a class="el" href="classWorldModel.html">WorldModel</a>. <p><p>Definition at line <a class="el" href="Objects_8h-source.html#l00057">57</a> of file <a class="el" href="Objects_8h-source.html">Objects.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2><a name="a0" doxytag="Object::Object"></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"> Object::Object </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 constructor creates an object, all variables are initialized by default (illegal) values <p>Definition at line <a class="el" href="Objects_8C-source.html#l00057">57</a> of file <a class="el" href="Objects_8C-source.html">Objects.C</a>.<p>References <a class="el" href="namespace_3globalScope_4.html#a240a113">OBJECT_ILLEGAL</a>, and <a class="el" href="Objects_8h-source.html#l00060">objectType</a>.    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="a4" doxytag="Object::getConfidence"></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"> double Object::getConfidence </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classTime.html">Time</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>time</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>This method returns the confidence of the information of this object. The confidence is related to the last time this object was seen and the specified time (normally the time of the last received message). <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>time</em>&nbsp;</td><td>current time to compare with time object was last seen </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>confidence factor of this object </dl><p>Definition at line <a class="el" href="Objects_8C-source.html#l00083">83</a> of file <a class="el" href="Objects_8C-source.html">Objects.C</a>.<p>References <a class="el" href="SoccerTypes_8C-source.html#l00106">Time::getTime</a>(), <a class="el" href="SoccerTypes_8C-source.html#l00125">Time::getTimeDifference</a>(), <a class="el" href="Geometry_8C-source.html#l00066">max</a>(), and <a class="el" href="Objects_8h-source.html#l00061">timeLastSeen</a>.<p>Referenced by <a class="el" href="WorldModel_8C-source.html#l00803">WorldModel::getConfidence</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l00232">WorldModel::processPerfectHearInfo</a>(), and <a class="el" href="WorldModelUpdate_8C-source.html#l00207">WorldModel::processPerfectHearInfoBall</a>().    </td>  </tr></table><a name="a13" doxytag="Object::getGlobalPosition"></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="classVecPosition.html">VecPosition</a> Object::getGlobalPosition </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> const</td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method returns the global position of this object. The time of this information is related to the time returned by <a class="el" href="classObject.html#a15">getTimeGlobalPosition</a>(), but is not checked. So if you want to know the relevance of this position use this method. <dl compact><dt><b>Returns: </b><dd>global position of this object </dl><p>Definition at line <a class="el" href="Objects_8C-source.html#l00177">177</a> of file <a class="el" href="Objects_8C-source.html">Objects.C</a>.<p>References <a class="el" href="Objects_8h-source.html#l00063">posGlobal</a>.<p>Referenced by <a class="el" href="WorldModel_8C-source.html#l00568">WorldModel::getAgentGlobalPosition</a>(), <a class="el" href="WorldModel_8C-source.html#l00658">WorldModel::getGlobalPosition</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l00786">WorldModel::getOffsideX</a>(), <a class="el" href="WorldModel_8C-source.html#l00835">WorldModel::getOppGoalieType</a>(), <a class="el" href="WorldModel_8C-source.html#l00873">WorldModel::getOwnGoalieType</a>(), <a class="el" href="WorldModel_8C-source.html#l01185">WorldModel::showObjects</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l00552">WorldModel::updateAgentObjectAfterSee</a>(), and <a class="el" href="WorldModelUpdate_8C-source.html#l00896">WorldModel::updateObjectRelativeFromGlobal</a>().    </td>  </tr></table><a name="a17" doxytag="Object::getGlobalPositionLastSee"></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="classVecPosition.html">VecPosition</a> Object::getGlobalPositionLastSee </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> const</td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method returns the global position of this object at the time of the last see message. The time of this information is related to the time returned by <a class="el" href="classObject.html#a19">getTimeGlobalPosDerivedFromSee</a>(). <dl compact><dt><b>Returns: </b><dd>global position of this object </dl><p>Definition at line <a class="el" href="Objects_8C-source.html#l00217">217</a> of file <a class="el" href="Objects_8C-source.html">Objects.C</a>.<p>References <a class="el" href="Objects_8h-source.html#l00067">posGlobalLastSee</a>.<p>Referenced by <a class="el" href="WorldModelUpdate_8C-source.html#l01254">WorldModel::calculateStateBall</a>(), and <a class="el" href="WorldModelUpdate_8C-source.html#l01947">WorldModel::calculateStateBall2</a>().    </td>  </tr></table><a name="a2" doxytag="Object::getRelativeAngle"></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="Geometry_8h.html#a2">AngDeg</a> Object::getRelativeAngle </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 the relative angle of this object to the agent. This equals the angle of the relative position vector. <dl compact><dt><b>Returns: </b><dd>relative angle to this object </dl><p>Definition at line <a class="el" href="Objects_8C-source.html#l00065">65</a> of file <a class="el" href="Objects_8C-source.html">Objects.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00052">AngDeg</a>, <a class="el" href="Geometry_8C-source.html#l00625">VecPosition::getDirection</a>(), <a class="el" href="Geometry_8C-source.html#l00875">VecPosition::normalizeAngle</a>(), and <a class="el" href="Objects_8h-source.html#l00065">posRelative</a>.<p>Referenced by <a class="el" href="WorldModel_8C-source.html#l00734">WorldModel::getRelativeAngle</a>().    </td>  </tr></table><a name="a3" doxytag="Object::getRelativeDistance"></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"> double Object::getRelativeDistance </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 the relative distance to this object. This equals the magnitude of the relative position vector. <dl compact><dt><b>Returns: </b><dd>relative distance to this object </dl><p>Definition at line <a class="el" href="Objects_8C-source.html#l00073">73</a> of file <a class="el" href="Objects_8C-source.html">Objects.C</a>.<p>References <a class="el" href="Geometry_8C-source.html#l00614">VecPosition::getMagnitude</a>(), and <a class="el" href="Objects_8h-source.html#l00065">posRelative</a>.<p>Referenced by <a class="el" href="WorldModel_8C-source.html#l00703">WorldModel::getRelativeDistance</a>(), and <a class="el" href="WorldModelUpdate_8C-source.html#l01702">WorldModel::mapUnknownPlayers</a>().    </td>  </tr></table><a name="a9" doxytag="Object::getRelativePosition"></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="classVecPosition.html">VecPosition</a> Object::getRelativePosition </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> const</td>        </tr>      </table>

⌨️ 快捷键说明

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