diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a02159.html | 289 |
1 files changed, 289 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02159.html b/docs/doxygen/nel/a02159.html new file mode 100644 index 00000000..a4479f45 --- /dev/null +++ b/docs/doxygen/nel/a02159.html @@ -0,0 +1,289 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NLAINIMAT::CActionResources class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLAINIMAT::CActionResources Class Reference</h1><code>#include <<a class="el" href="a06363.html">sensors_motivations_actions_def.h</a>></code> +<p> +<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02159.html#NLAINIMAT_1_1CActionResourcesa0">CActionResources</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02159.html#NLAINIMAT_1_1CActionResourcesa1">filterMyActions</a> (std::multimap< double, std::pair< <a class="el" href="a05371.html#a13">TTargetId</a>, <a class="el" href="a05371.html#a101">TAction</a> > > &myActionsByPriority)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Let in the map myActionsByPriority all actions with no more actions Resources (thoses actions shouldn't be executed). <a href="#NLAINIMAT_1_1CActionResourcesa1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a02159.html#NLAINIMAT_1_1CActionResourcesa2">~CActionResources</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::multimap< <a class="el" href="a05371.html#a101">TAction</a>, <a class="el" href="a05371.html#a102">TActionResources</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a></td></tr> + +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CActionResourcesa0" doxytag="NLAINIMAT::CActionResources::CActionResources" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLAINIMAT::CActionResources::CActionResources </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> + +<p> +Definition at line <a class="el" href="a06362.html#l00031">31</a> of file <a class="el" href="a06362.html">sensors_motivations_actions_def.cpp</a>. +<p> +References <a class="el" href="a06363.html#l00296">_ActionsResources</a>, <a class="el" href="a05371.html#a101a65">NLAINIMAT::Action_LookAround</a>, <a class="el" href="a05371.html#a101a64">NLAINIMAT::Action_MoveToMyFlagGoal</a>, <a class="el" href="a05371.html#a101a63">NLAINIMAT::Action_MoveToMyFlagStart</a>, <a class="el" href="a05371.html#a101a60">NLAINIMAT::Action_MoveToTargetFlag</a>, <a class="el" href="a05371.html#a101a62">NLAINIMAT::Action_MoveToTargetFlagGoal</a>, <a class="el" href="a05371.html#a101a61">NLAINIMAT::Action_MoveToTargetFlagStart</a>, <a class="el" href="a05371.html#a101a69">NLAINIMAT::Action_SelectClassDemoman</a>, <a class="el" href="a05371.html#a101a74">NLAINIMAT::Action_SelectClassEngineer</a>, <a class="el" href="a05371.html#a101a71">NLAINIMAT::Action_SelectClassHwguy</a>, <a class="el" href="a05371.html#a101a70">NLAINIMAT::Action_SelectClassMedic</a>, <a class="el" href="a05371.html#a101a72">NLAINIMAT::Action_SelectClassPyro</a>, <a class="el" href="a05371.html#a101a66">NLAINIMAT::Action_SelectClassScout</a>, <a class="el" href="a05371.html#a101a67">NLAINIMAT::Action_SelectClassSniper</a>, <a class="el" href="a05371.html#a101a68">NLAINIMAT::Action_SelectClassSoldier</a>, <a class="el" href="a05371.html#a101a73">NLAINIMAT::Action_SelectClassSpy</a>, <a class="el" href="a05371.html#a101a59">NLAINIMAT::Action_Target_Approach</a>, <a class="el" href="a05371.html#a101a57">NLAINIMAT::Action_Target_MoveAway</a>, <a class="el" href="a05371.html#a101a58">NLAINIMAT::Action_Target_ShootTo</a>, <a class="el" href="a05371.html#a102a81">NLAINIMAT::ActionResources_button_attack</a>, <a class="el" href="a05371.html#a102a82">NLAINIMAT::ActionResources_button_attack2</a>, <a class="el" href="a05371.html#a102a83">NLAINIMAT::ActionResources_button_jump</a>, <a class="el" href="a05371.html#a102a79">NLAINIMAT::ActionResources_forwardMove</a>, <a class="el" href="a05371.html#a102a77">NLAINIMAT::ActionResources_pitch</a>, <a class="el" href="a05371.html#a102a92">NLAINIMAT::ActionResources_selectClass</a>, and <a class="el" href="a05371.html#a102a78">NLAINIMAT::ActionResources_yaw</a>. +<p> +<div class="fragment"><pre>00032 { +00033 <span class="comment">// _ActionsResources.insert(std::pair<TAction, TActionResources>(Action_Idle, ActionResources_forwardMove));</span> +00034 +00035 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_Target_MoveAway, ActionResources_forwardMove)); +00036 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_Target_MoveAway, ActionResources_yaw)); +00037 +00038 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_Target_ShootTo, ActionResources_pitch)); +00039 <span class="comment">// _ActionsResources.insert(std::pair<TAction, TActionResources>(Action_Target_ShootTo, ActionResources_yaw));</span> +00040 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_Target_ShootTo, ActionResources_button_attack)); +00041 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_Target_ShootTo, ActionResources_button_attack2)); +00042 +00043 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_Target_Approach, ActionResources_forwardMove)); +00044 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_Target_Approach, ActionResources_yaw)); +00045 +00046 <span class="comment">// _ActionsResources.insert(std::pair<TAction, TActionResources>(Action_Item_Approach, ActionResources_forwardMove));</span> +00047 <span class="comment">// _ActionsResources.insert(std::pair<TAction, TActionResources>(Action_Item_Approach, ActionResources_yaw));</span> +00048 +00049 <span class="comment">// _ActionsResources.insert(std::pair<TAction, TActionResources>(Action_Waypoint_MoveTo, ActionResources_forwardMove));</span> +00050 <span class="comment">// _ActionsResources.insert(std::pair<TAction, TActionResources>(Action_Waypoint_MoveTo, ActionResources_yaw));</span> +00051 <span class="comment">// _ActionsResources.insert(std::pair<TAction, TActionResources>(Action_Waypoint_MoveTo, ActionResources_button_jump));</span> +00052 +00053 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlag, ActionResources_forwardMove)); +00054 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlag, ActionResources_yaw)); +00055 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlag, ActionResources_button_jump)); +00056 +00057 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlagStart, ActionResources_forwardMove)); +00058 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlagStart, ActionResources_yaw)); +00059 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlagStart, ActionResources_button_jump)); +00060 +00061 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlagGoal, ActionResources_forwardMove)); +00062 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlagGoal, ActionResources_yaw)); +00063 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToTargetFlagGoal, ActionResources_button_jump)); +00064 +00065 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToMyFlagStart, ActionResources_forwardMove)); +00066 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToMyFlagStart, ActionResources_yaw)); +00067 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToMyFlagStart, ActionResources_button_jump)); +00068 +00069 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToMyFlagGoal, ActionResources_forwardMove)); +00070 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToMyFlagGoal, ActionResources_yaw)); +00071 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_MoveToMyFlagGoal, ActionResources_button_jump)); +00072 +00073 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_LookAround, ActionResources_forwardMove)); +00074 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_LookAround, ActionResources_yaw)); +00075 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_LookAround, ActionResources_button_jump)); +00076 +00077 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassScout, ActionResources_selectClass)); +00078 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassSniper, ActionResources_selectClass)); +00079 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassSoldier, ActionResources_selectClass)); +00080 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassDemoman, ActionResources_selectClass)); +00081 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassMedic, ActionResources_selectClass)); +00082 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassHwguy, ActionResources_selectClass)); +00083 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassPyro, ActionResources_selectClass)); +00084 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassSpy, ActionResources_selectClass)); +00085 <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.insert(std::pair<TAction, TActionResources>(Action_SelectClassEngineer, ActionResources_selectClass)); +00086 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CActionResourcesa2" doxytag="NLAINIMAT::CActionResources::~CActionResources" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLAINIMAT::CActionResources::~<a class="el" href="a02159.html">CActionResources</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06362.html#l00088">88</a> of file <a class="el" href="a06362.html">sensors_motivations_actions_def.cpp</a>. +<p> +<div class="fragment"><pre>00089 { +00090 ; +00091 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CActionResourcesa1" doxytag="NLAINIMAT::CActionResources::filterMyActions" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLAINIMAT::CActionResources::filterMyActions </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">std::multimap< double, std::pair< <a class="el" href="a05371.html#a13">TTargetId</a>, <a class="el" href="a05371.html#a101">TAction</a> > > & </td> + <td class="mdname1" valign="top" nowrap> <em>myActionsByPriority</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> +Let in the map myActionsByPriority all actions with no more actions Resources (thoses actions shouldn't be executed). +<p> + +<p> +Definition at line <a class="el" href="a06362.html#l00094">94</a> of file <a class="el" href="a06362.html">sensors_motivations_actions_def.cpp</a>. +<p> +References <a class="el" href="a06363.html#l00296">_ActionsResources</a>, <a class="el" href="a06363.html#l00185">NLAINIMAT::TAction</a>, and <a class="el" href="a06363.html#l00257">NLAINIMAT::TActionResources</a>. +<p> +Referenced by <a class="el" href="a06032.html#l01548">NLAINIMAT::CMHiCSagent::selectBehavior()</a>. +<p> +<div class="fragment"><pre>00095 { +00096 <span class="comment">// We build a set of used resources.</span> +00097 std::set<TActionResources> usedActionsResources; +00098 +00099 <span class="comment">// For each wanted action in from the highest priority to the lowest</span> +00100 std::multimap<double, std::pair<TTargetId,TAction> >::reverse_iterator itMyActionsByPriority( myActionsByPriority.end()); +00101 std::multimap<double, std::pair<TTargetId,TAction> >::reverse_iterator itLast(myActionsByPriority.begin()); +00102 std::set<TActionResources>::iterator itUsedActionsResources; +00103 std::multimap<TAction, TActionResources>::iterator itActionsResources, itActionsResources_begin, itActionsResources_last; +00104 <span class="keywordtype">bool</span> actionIsOK = <span class="keyword">false</span>; +00105 std::multimap<double, std::pair<TTargetId,TAction> >::iterator itMyActionsByPriority2Remove; +00106 +00107 <span class="keywordflow">while</span> (itMyActionsByPriority != itLast ) +00108 { +00109 <span class="keywordtype">double</span> priority = (*itMyActionsByPriority).first; +00110 <a class="code" href="a05371.html#a101">TAction</a> action = (*itMyActionsByPriority).second.second; +00111 itMyActionsByPriority++; +00112 +00113 <span class="comment">// if none of the resources are used, the action may be executed and resources are stored as used.</span> +00114 <span class="keywordflow">if</span> (actionIsOK) +00115 { +00116 <span class="keywordflow">for</span> (itActionsResources = itActionsResources_begin; +00117 itActionsResources != itActionsResources_last; +00118 itActionsResources++) +00119 { +00120 <a class="code" href="a05371.html#a102">TActionResources</a> ar = (*itActionsResources).second; +00121 usedActionsResources.insert(ar); +00122 } +00123 myActionsByPriority.erase(itMyActionsByPriority2Remove); +00124 } +00125 +00126 <span class="comment">// We look for all needed action resources.</span> +00127 itActionsResources_begin = <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.lower_bound(action); +00128 itActionsResources_last = <a class="code" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">_ActionsResources</a>.upper_bound(action); +00129 actionIsOK = <span class="keyword">true</span>; +00130 +00131 <span class="comment">// For each of thoses resources we look if it's already used.</span> +00132 <span class="keywordflow">for</span> (itActionsResources = itActionsResources_begin; +00133 itActionsResources != itActionsResources_last; +00134 itActionsResources++) +00135 { +00136 <a class="code" href="a05371.html#a102">TActionResources</a> ar = (*itActionsResources).second; +00137 itUsedActionsResources = usedActionsResources.find(ar); +00138 <span class="keywordflow">if</span>( itUsedActionsResources != usedActionsResources.end()) +00139 { +00140 actionIsOK = <span class="keyword">false</span>; +00141 <span class="keywordflow">break</span>; +00142 } +00143 } +00144 +00145 itMyActionsByPriority2Remove = itMyActionsByPriority.base(); +00146 } +00147 +00148 <span class="keywordflow">if</span> (actionIsOK) +00149 { +00150 <span class="keywordflow">for</span> (itActionsResources = itActionsResources_begin; +00151 itActionsResources != itActionsResources_last; +00152 itActionsResources++) +00153 { +00154 <a class="code" href="a05371.html#a102">TActionResources</a> ar = (*itActionsResources).second; +00155 usedActionsResources.insert(ar); +00156 } +00157 myActionsByPriority.erase(itMyActionsByPriority2Remove); +00158 } +00159 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CActionResourcesr0" doxytag="NLAINIMAT::CActionResources::_ActionsResources" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::multimap<<a class="el" href="a05371.html#a101">TAction</a>, <a class="el" href="a05371.html#a102">TActionResources</a>> <a class="el" href="a02159.html#NLAINIMAT_1_1CActionResourcesr0">NLAINIMAT::CActionResources::_ActionsResources</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06363.html#l00296">296</a> of file <a class="el" href="a06363.html">sensors_motivations_actions_def.h</a>. +<p> +Referenced by <a class="el" href="a06362.html#l00031">CActionResources()</a>, and <a class="el" href="a06362.html#l00094">filterMyActions()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a06363.html">sensors_motivations_actions_def.h</a><li><a class="el" href="a06362.html">sensors_motivations_actions_def.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 11:09:26 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |