diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02926.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a02926.html | 1699 |
1 files changed, 1699 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02926.html b/docs/doxygen/nel/a02926.html new file mode 100644 index 00000000..f65585c5 --- /dev/null +++ b/docs/doxygen/nel/a02926.html @@ -0,0 +1,1699 @@ +<!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::CMHiCSagent 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::CMHiCSagent Class Reference</h1><code>#include <<a class="el" href="a06033.html">mhics.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A Modular Hierarchical Classifier System. This is the agent component where motivations levels and perceptions are stored. <dl compact><dt><b>Author:</b></dt><dd>Gabriel ROBERT <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a06033.html#l00200">200</a> of file <a class="el" href="a06033.html">mhics.h</a>.<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="a02926.html#NLAINIMAT_1_1CMHiCSagenta0">CMHiCSagent</a> (<a class="el" href="a02929.html">CMHiCSbase</a> *pMHiCSbase)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta1">getDebugString</a> (std::string &<a class="el" href="a04223.html#a627">t</a>) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Chaine de debug. <a href="#NLAINIMAT_1_1CMHiCSagenta1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>double </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta2">getExecutionIntensity</a> (<a class="el" href="a05371.html#a101">TAction</a> action, <a class="el" href="a05371.html#a13">TTargetId</a> target) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Retourne l'intensité d'exécution d'une action. <a href="#NLAINIMAT_1_1CMHiCSagenta2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02929.html">CMHiCSbase</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta3">getMHiCSbase</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>double </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta4">getMotivationPP</a> (<a class="el" href="a05371.html#a99">TMotivation</a> motivationName) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Retourne la Puissance Propre d'une Motivation. <a href="#NLAINIMAT_1_1CMHiCSagenta4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>double </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta5">getMotivationValue</a> (<a class="el" href="a05371.html#a99">TMotivation</a> motivationName) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Retourne la valeur d'une motiation. <a href="#NLAINIMAT_1_1CMHiCSagenta5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta6">getTemporaryClassifierPriorityTime</a> (<a class="el" href="a05371.html#a99">TMotivation</a> motivationName, <a class="el" href="a05371.html#a7">TClassifierNumber</a> classifierNumber) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta7">run</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">* if (selectedClassifierNumber < 0) <a href="#NLAINIMAT_1_1CMHiCSagenta7"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const std::map< <a class="el" href="a05371.html#a13">TTargetId</a>,<br> + std::map< <a class="el" href="a05371.html#a101">TAction</a>, <a class="el" href="a02938.html">CMotivationEnergy</a> > > * </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta8">selectBehavior</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the Behavior that must be active. <a href="#NLAINIMAT_1_1CMHiCSagenta8"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta9">setLearning</a> (bool active)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta10">setMotivationPP</a> (<a class="el" href="a05371.html#a99">TMotivation</a> motivationName, double PP)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Donne la Puissance Propre d'une Motivation. <a href="#NLAINIMAT_1_1CMHiCSagenta10"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta11">setMotivationValue</a> (<a class="el" href="a05371.html#a99">TMotivation</a> motivationName, double <a class="el" href="a04223.html#a658">value</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Fixe la valeur d'une motivation. <a href="#NLAINIMAT_1_1CMHiCSagenta11"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta12">setSensors</a> (<a class="el" href="a02422.html">CCSPerception</a> *psensorMap)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the sensor source. <a href="#NLAINIMAT_1_1CMHiCSagenta12"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta13">wasClassifierPreviouslyActive</a> (<a class="el" href="a05371.html#a99">TMotivation</a> motivationName, <a class="el" href="a05371.html#a7">TClassifierNumber</a> classifierNumber) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagenta14">~CMHiCSagent</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentd0">learningComputation</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">If _Learning == true, it will compute new priority for each classifier. <a href="#NLAINIMAT_1_1CMHiCSagentd0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentd1">motivationCompute</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentd2">targetId2String</a> (<a class="el" href="a05371.html#a13">TTargetId</a> <a class="el" href="a04223.html#a564">id</a>) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">function used in debug to change a TTargetId in a string <a href="#NLAINIMAT_1_1CMHiCSagentd2"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::map< <a class="el" href="a05371.html#a99">TMotivation</a>, <a class="el" href="a02938.html">CMotivationEnergy</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr1">_Learning</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::map< <a class="el" href="a05371.html#a99">TMotivation</a>, <a class="el" href="a02938.html">CMotivationEnergy</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr2">_OldClassifiersAndMotivationIntensity</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::map< <a class="el" href="a05371.html#a13">TTargetId</a>, std::map<<br> + <a class="el" href="a05371.html#a101">TAction</a>, <a class="el" href="a02938.html">CMotivationEnergy</a> > > * </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::map< <a class="el" href="a05371.html#a99">TMotivation</a>, std::map<<br> + <a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a02927.html">CClassifierActivityInfo</a> > > * </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr4">_pInfoClassifierActivity</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02929.html">CMHiCSbase</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">_pMHiCSbase</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::map< <a class="el" href="a05371.html#a13">TTargetId</a>, std::map<<br> + <a class="el" href="a05371.html#a101">TAction</a>, <a class="el" href="a02938.html">CMotivationEnergy</a> > > * </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr6">_pOldActionsExecutionIntensityByTarget</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::map< <a class="el" href="a05371.html#a99">TMotivation</a>, std::map<<br> + <a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a02927.html">CClassifierActivityInfo</a> > > * </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr7">_pOldInfoClassifierActivity</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02422.html">CCSPerception</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr8">_pSensorsValues</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::map< <a class="el" href="a05371.html#a99">TMotivation</a>, std::map<<br> + <a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a02928.html">CTemporaryPriority</a> > > </td><td class="memItemRight" valign=bottom><a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a></td></tr> + +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta0" doxytag="NLAINIMAT::CMHiCSagent::CMHiCSagent" ></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::CMHiCSagent::CMHiCSagent </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02929.html">CMHiCSbase</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>pMHiCSbase</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> + +<p> +Definition at line <a class="el" href="a06032.html#l00668">668</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00300">_Learning</a>, <a class="el" href="a06033.html#l00298">_pActionsExecutionIntensityByTarget</a>, <a class="el" href="a06033.html#l00304">_pInfoClassifierActivity</a>, <a class="el" href="a06033.html#l00293">_pMHiCSbase</a>, <a class="el" href="a06033.html#l00299">_pOldActionsExecutionIntensityByTarget</a>, <a class="el" href="a06033.html#l00305">_pOldInfoClassifierActivity</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +<div class="fragment"><pre>00669 { +00670 <a class="code" href="a04199.html#a6">nlassert</a> (pMHiCSbase != NULL); +00671 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">_pMHiCSbase</a> = pMHiCSbase; +00672 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a> = <span class="keyword">new</span> std::map<TTargetId, std::map<TAction, CMotivationEnergy> >(); +00673 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr6">_pOldActionsExecutionIntensityByTarget</a> = <span class="keyword">new</span> std::map<TTargetId, std::map<TAction, CMotivationEnergy> >(); +00674 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr1">_Learning</a> = <span class="keyword">true</span>; +00675 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr4">_pInfoClassifierActivity</a> = <span class="keyword">new</span> std::map<TMotivation, std::map<TClassifierNumber, CClassifierActivityInfo> >(); +00676 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr7">_pOldInfoClassifierActivity</a> = <span class="keyword">new</span> std::map<TMotivation, std::map<TClassifierNumber, CClassifierActivityInfo> >(); +00677 <span class="comment">// _ActionsExecutionIntensity[Action_DoNothing] = CMotivationEnergy();</span> +00678 <span class="comment">// _IdByActions[Action_DoNothing] = NullTargetId;</span> +00679 <span class="comment">// _ItCurrentAction = _IdByActions.find(Action_DoNothing);</span> +00680 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta14" doxytag="NLAINIMAT::CMHiCSagent::~CMHiCSagent" ></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::CMHiCSagent::~<a class="el" href="a02926.html">CMHiCSagent</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="a06032.html#l00682">682</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00298">_pActionsExecutionIntensityByTarget</a>, <a class="el" href="a06033.html#l00304">_pInfoClassifierActivity</a>, <a class="el" href="a06033.html#l00299">_pOldActionsExecutionIntensityByTarget</a>, and <a class="el" href="a06033.html#l00305">_pOldInfoClassifierActivity</a>. +<p> +<div class="fragment"><pre>00683 { +00684 <span class="keyword">delete</span> <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr6">_pOldActionsExecutionIntensityByTarget</a>; +00685 <span class="keyword">delete</span> <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>; +00686 <span class="keyword">delete</span> <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr4">_pInfoClassifierActivity</a>; +00687 <span class="keyword">delete</span> <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr7">_pOldInfoClassifierActivity</a>; +00688 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta1" doxytag="NLAINIMAT::CMHiCSagent::getDebugString" ></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::CMHiCSagent::getDebugString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">std::string & </td> + <td class="mdname1" valign="top" nowrap> <em>t</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Chaine de debug. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l00707">707</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00294">_ClassifiersAndMotivationIntensity</a>, <a class="el" href="a06033.html#l00297">_pSensorsValues</a>, <a class="el" href="a05552.html#l00120">NLAINIMAT::CCSPerception::NoTargetSensors</a>, <a class="el" href="a05646.html#l00985">t</a>, <a class="el" href="a06032.html#l00691">targetId2String()</a>, <a class="el" href="a05552.html#l00122">NLAINIMAT::CCSPerception::TargetSensors</a>, and <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>. +<p> +<div class="fragment"><pre>00708 { +00709 std::string ret = <span class="stringliteral">"\n\n---------------------------\n"</span>; +00710 ret += <span class="stringliteral">"\nPerceptions :"</span>; +00711 ret += <span class="stringliteral">"\n Without target"</span>; +00712 NLAINIMAT::TSensorMap::const_iterator itNoTargetSensors; +00713 <span class="keywordflow">for</span> (itNoTargetSensors = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr8">_pSensorsValues</a>->NoTargetSensors.begin(); +00714 itNoTargetSensors != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr8">_pSensorsValues</a>->NoTargetSensors.end(); +00715 itNoTargetSensors++) +00716 { +00717 ret += <span class="stringliteral">"\n "</span> + conversionSensor.toString((*itNoTargetSensors).first) + <span class="stringliteral">"("</span> + (*itNoTargetSensors).second + <span class="stringliteral">")"</span>; +00718 } +00719 std::map<TTargetId, TSensorMap>::const_iterator itTargetSensors; +00720 <span class="keywordflow">for</span> (itTargetSensors = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr8">_pSensorsValues</a>->TargetSensors.begin(); +00721 itTargetSensors != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr8">_pSensorsValues</a>->TargetSensors.end(); +00722 itTargetSensors++) +00723 { +00724 ret += <span class="stringliteral">"\n On target n#"</span> + <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentd2">targetId2String</a>((*itTargetSensors).first); +00725 <span class="keywordflow">for</span> (itNoTargetSensors = (*itTargetSensors).second.begin(); +00726 itNoTargetSensors != (*itTargetSensors).second.end(); +00727 itNoTargetSensors++) +00728 { +00729 ret += <span class="stringliteral">"\n "</span> + conversionSensor.toString((*itNoTargetSensors).first) + <span class="stringliteral">"("</span> + (*itNoTargetSensors).second + <span class="stringliteral">")"</span>; +00730 } +00731 } +00732 ret += <span class="stringliteral">"\n\nMotivations :"</span>; +00733 std::map<TMotivation, CMotivationEnergy>::const_iterator itClassifiersAndMotivationIntensity; +00734 <span class="keywordflow">for</span> (itClassifiersAndMotivationIntensity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.begin(); +00735 itClassifiersAndMotivationIntensity != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.end(); +00736 itClassifiersAndMotivationIntensity++) +00737 { +00738 ret += <span class="stringliteral">"\n <"</span> + conversionMotivation.toString((*itClassifiersAndMotivationIntensity).first) + <span class="stringliteral">"> "</span>; +00739 ret += <span class="stringliteral">"[MI="</span> + <a class="code" href="a05378.html#a244">NLMISC::toString</a>((*itClassifiersAndMotivationIntensity).second.getSumValue()) + <span class="stringliteral">"] :"</span>; +00740 (*itClassifiersAndMotivationIntensity).second.getDebugString(ret); +00741 <span class="comment">// ret += "\n -> Classifier number " + NLMISC::toString((*itClassifiersAndMotivationIntensity).second.ClassifierNumber); </span> +00742 ret += <span class="stringliteral">"\n"</span>; +00743 } +00744 <span class="comment">// ret += "\nVirtual Actions :";</span> +00745 <span class="comment">// std::map<TAction, CMotivationEnergy>::const_iterator itClassifiersAndVirtualActionIntensity;</span> +00746 <span class="comment">// for (itClassifiersAndVirtualActionIntensity = _ClassifiersAndVirtualActionIntensity.begin();</span> +00747 <span class="comment">// itClassifiersAndVirtualActionIntensity != _ClassifiersAndVirtualActionIntensity.end();</span> +00748 <span class="comment">// itClassifiersAndVirtualActionIntensity++)</span> +00749 <span class="comment">// {</span> +00750 <span class="comment">// ret += "\n <" + conversionAction.toString((*itClassifiersAndVirtualActionIntensity).first) + "> ";</span> +00751 <span class="comment">// ret += "[MI=" + NLMISC::toString((*itClassifiersAndVirtualActionIntensity).second.getSumValue()) + "] :";</span> +00752 <span class="comment">// (*itClassifiersAndVirtualActionIntensity).second.getDebugString(ret);</span> +00757 <span class="comment"></span><span class="comment">// ret += "\n -> Classifier number " + NLMISC::toString((*itClassifiersAndVirtualActionIntensity).second.ClassifierNumber); </span> +00758 <span class="comment">// ret += "\n";</span> +00759 <span class="comment">// }</span> +00760 ret += <span class="stringliteral">"\nACTIONS :"</span>; +00761 std::map<TAction, CMotivationEnergy>::const_iterator itActionsExecutionIntensity; +00762 <span class="comment">// for (itActionsExecutionIntensity = _ActionsExecutionIntensity.begin(); itActionsExecutionIntensity != _ActionsExecutionIntensity.end(); itActionsExecutionIntensity++)</span> +00763 <span class="comment">// {</span> +00764 <span class="comment">// ret += "\n <" + conversionAction.toString((* itActionsExecutionIntensity).first) + "> [EI=" + NLMISC::toString((*itActionsExecutionIntensity).second.getSumValue()) + "] : ";</span> +00765 <span class="comment">// (*itActionsExecutionIntensity).second.getDebugString(ret);</span> +00766 <span class="comment">// std::map<TAction, TTargetId>::const_iterator itIdByActions = _IdByActions.find((*itActionsExecutionIntensity).first);</span> +00767 <span class="comment">// nlassert (itIdByActions != _IdByActions.end());</span> +00769 <span class="comment"></span><span class="comment">// ret += " on target n#" + targetId2String((*itIdByActions).second);</span> +00770 <span class="comment">// }</span> +00771 <span class="comment">// if (_ItCurrentAction != _IdByActions.end())</span> +00772 <span class="comment">// {</span> +00774 <span class="comment"></span><span class="comment">// ret += "\nACTION ACTIVE : " + NLAINIMAT::conversionAction.toString((*_ItCurrentAction).first) + " on " + targetId2String((*_ItCurrentAction).second);</span> +00775 <span class="comment">// }</span> +00776 <a class="code" href="a04223.html#a627">t</a>+=ret; +00777 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta2" doxytag="NLAINIMAT::CMHiCSagent::getExecutionIntensity" ></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"> double NLAINIMAT::CMHiCSagent::getExecutionIntensity </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a101">TAction</a> </td> + <td class="mdname" nowrap> <em>action</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a05371.html#a13">TTargetId</a> </td> + <td class="mdname" nowrap> <em>target</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Retourne l'intensité d'exécution d'une action. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l00855">855</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00298">_pActionsExecutionIntensityByTarget</a>, and <a class="el" href="a06363.html#l00038">NLAINIMAT::TTargetId</a>. +<p> +<div class="fragment"><pre>00856 { +00857 std::map<TTargetId, std::map<TAction, CMotivationEnergy> >::const_iterator itActionsExecutionIntensityByTarget; +00858 itActionsExecutionIntensityByTarget = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->find(target); +00859 <span class="keywordflow">if</span> (itActionsExecutionIntensityByTarget == <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->end()) +00860 { +00861 <span class="keywordflow">return</span> -1; +00862 } +00863 std::map<TAction, CMotivationEnergy>::const_iterator itActionsExecutionIntensity = (*itActionsExecutionIntensityByTarget).second.find(action); +00864 <span class="keywordflow">if</span> (itActionsExecutionIntensity != (*itActionsExecutionIntensityByTarget).second.end()) +00865 { +00866 <span class="keywordflow">return</span> (*itActionsExecutionIntensity).second.getSumValue(); +00867 } +00868 <span class="keywordflow">else</span> +00869 { +00870 <span class="keywordflow">return</span> -1; +00871 } +00872 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta3" doxytag="NLAINIMAT::CMHiCSagent::getMHiCSbase" ></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"> const <a class="el" href="a02929.html">CMHiCSbase</a>* NLAINIMAT::CMHiCSagent::getMHiCSbase </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</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="a06033.html#l00240">240</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +References <a class="el" href="a06033.html#l00293">_pMHiCSbase</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00095">NLAINIMAT::CMotivationEnergy::computeMotivationValue()</a>. +<p> +<div class="fragment"><pre>00240 {<span class="keywordflow">return</span> <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">_pMHiCSbase</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta4" doxytag="NLAINIMAT::CMHiCSagent::getMotivationPP" ></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"> double NLAINIMAT::CMHiCSagent::getMotivationPP </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a99">TMotivation</a> </td> + <td class="mdname1" valign="top" nowrap> <em>motivationName</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Retourne la Puissance Propre d'une Motivation. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l00788">788</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00294">_ClassifiersAndMotivationIntensity</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00095">NLAINIMAT::CMotivationEnergy::computeMotivationValue()</a>. +<p> +<div class="fragment"><pre>00789 { +00790 std::map<TMotivation, CMotivationEnergy>::const_iterator itClassifiersAndMotivationIntensity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.find(motivationName); +00791 <span class="keywordflow">if</span> (itClassifiersAndMotivationIntensity != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.end()) +00792 { +00793 <span class="keywordflow">return</span> (*itClassifiersAndMotivationIntensity).second.getMotivationPP(motivationName); +00794 } +00795 <span class="keywordflow">else</span> +00796 { +00797 <span class="keywordflow">return</span> -1; +00798 } +00799 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta5" doxytag="NLAINIMAT::CMHiCSagent::getMotivationValue" ></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"> double NLAINIMAT::CMHiCSagent::getMotivationValue </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a99">TMotivation</a> </td> + <td class="mdname1" valign="top" nowrap> <em>motivationName</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Retourne la valeur d'une motiation. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l00827">827</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00294">_ClassifiersAndMotivationIntensity</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00095">NLAINIMAT::CMotivationEnergy::computeMotivationValue()</a>. +<p> +<div class="fragment"><pre>00828 { +00829 std::map<TMotivation, CMotivationEnergy>::const_iterator itClassifiersAndMotivationIntensity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.find(motivationName); +00830 <span class="keywordflow">if</span> (itClassifiersAndMotivationIntensity != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.end()) +00831 { +00832 <span class="keywordflow">return</span> (*itClassifiersAndMotivationIntensity).second.getMotivationValue(motivationName); +00833 } +00834 <span class="keywordflow">else</span> +00835 { +00836 <span class="keywordflow">return</span> -1; +00837 } +00838 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta6" doxytag="NLAINIMAT::CMHiCSagent::getTemporaryClassifierPriorityTime" ></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"> <a class="el" href="a04558.html#a11">uint32</a> NLAINIMAT::CMHiCSagent::getTemporaryClassifierPriorityTime </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a99">TMotivation</a> </td> + <td class="mdname" nowrap> <em>motivationName</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a05371.html#a7">TClassifierNumber</a> </td> + <td class="mdname" nowrap> <em>classifierNumber</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const</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="a06032.html#l01608">1608</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00303">_TemporaryPriority</a>, <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00095">NLAINIMAT::CMotivationEnergy::computeMotivationValue()</a>. +<p> +<div class="fragment"><pre>01609 { +01610 std::map<TMotivation, std::map<TClassifierNumber, CTemporaryPriority> >::const_iterator itTemporaryPriority = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>.find(motivationName); +01611 <span class="keywordflow">if</span> (itTemporaryPriority == <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>.end()) +01612 { +01613 <span class="keywordflow">return</span> 0; +01614 } +01615 std::map<TClassifierNumber, CTemporaryPriority>::const_iterator itIteratorBis = (*itTemporaryPriority).second.find(classifierNumber); +01616 <span class="keywordflow">if</span> (itIteratorBis == (*itTemporaryPriority).second.end()) +01617 { +01618 <span class="keywordflow">return</span> 0; +01619 } +01620 <a class="code" href="a04558.html#a11">uint32</a> bibureturn = (*itIteratorBis).second.TemporaryClassifierPriorityTime; +01621 <span class="keywordflow">return</span> bibureturn; +01622 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentd0" doxytag="NLAINIMAT::CMHiCSagent::learningComputation" ></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::CMHiCSagent::learningComputation </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> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +If _Learning == true, it will compute new priority for each classifier. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l01219">1219</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00294">_ClassifiersAndMotivationIntensity</a>, <a class="el" href="a06033.html#l00295">_OldClassifiersAndMotivationIntensity</a>, <a class="el" href="a06033.html#l00298">_pActionsExecutionIntensityByTarget</a>, <a class="el" href="a06033.html#l00293">_pMHiCSbase</a>, <a class="el" href="a06033.html#l00303">_TemporaryPriority</a>, <a class="el" href="a06552.html#l00045">NLMISC::CTime::getSecondsSince1970()</a>, <a class="el" href="a06032.html#l00634">NLAINIMAT::CMHiCSbase::learningUpdatePriorityValueClassifierTime()</a>, <a class="el" href="a06032.html#l00605">NLAINIMAT::CMHiCSbase::learningUpdatePriorityValueTimeToSuccess()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>, <a class="el" href="a06363.html#l00045">NLAINIMAT::TMotivation</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +Referenced by <a class="el" href="a06032.html#l01548">selectBehavior()</a>. +<p> +<div class="fragment"><pre>01220 { +01221 <span class="comment">/*</span> +01222 <span class="comment"> * Le but de l'apprentissage par ajustement des valeurs de priorité :</span> +01223 <span class="comment"> * La valeur de priorité est utilisé pour choisir un classeur lorsque plusieurs classeurs sont activable simultanement</span> +01224 <span class="comment"> * et partagent une même ressource d'action.</span> +01225 <span class="comment"> * On veut la faire évoluer afin que dans une situation donnée, c'est le classeur le plus apte à satisfaire la motivation </span> +01226 <span class="comment"> * qui soit sélectionné.</span> +01227 <span class="comment"> * Celon le principe de bucket brigade, un classeur qui mène à satisfaire une motivation est un bon classeur.</span> +01228 <span class="comment"> * Ensuite un classeur qui a défaut de satisfaire la motivation mène à un classeur pouvant la satisfaire est bon mais un peut moins, etc.</span> +01229 <span class="comment"> */</span> +01230 +01231 +01232 <span class="comment">// std::map<TMotivation, std::set<TClassifierNumber> > oldClassifierByMotivation; // Liste des classeurs actifs au pas précédent.</span> +01233 <span class="comment">// std::map<TMotivation, std::set<TClassifierNumber> > classifierByMotivation; // Liste des classeurs activés</span> +01234 +01235 <span class="comment">// On note les descentes de motivations</span> +01236 <a class="code" href="a04558.html#a11">uint32</a> newTime = <a class="code" href="a02142.html#NLMISC_1_1CTimee2">NLMISC::CTime::getSecondsSince1970</a>(); +01237 std::set<TMotivation> decreasingMotivations; +01238 std::map<TMotivation, CMotivationEnergy>::iterator itOldClassifiersAndMotivationIntensity, itClassifiersAndMotivationIntensity; +01239 <span class="keywordflow">for</span>(itOldClassifiersAndMotivationIntensity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr2">_OldClassifiersAndMotivationIntensity</a>.begin(); +01240 itOldClassifiersAndMotivationIntensity != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr2">_OldClassifiersAndMotivationIntensity</a>.end(); +01241 itOldClassifiersAndMotivationIntensity++) +01242 { +01243 <a class="code" href="a05371.html#a99">TMotivation</a> motivationName = (*itOldClassifiersAndMotivationIntensity).first; +01244 <span class="keywordtype">double</span> oldMV = (*itOldClassifiersAndMotivationIntensity).second.getMotivationValue(motivationName); +01245 itClassifiersAndMotivationIntensity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.find(motivationName); +01246 <a class="code" href="a04199.html#a6">nlassert</a>(itClassifiersAndMotivationIntensity != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.end()); +01247 <span class="keywordtype">double</span> newMV = (*itClassifiersAndMotivationIntensity).second.getMotivationValue(motivationName); +01248 <span class="keywordflow">if</span> (newMV < oldMV) +01249 { +01250 decreasingMotivations.insert(motivationName); +01251 } +01252 } +01253 +01254 <span class="comment">// // On établit la liste des classeurs utilisés précédemment</span> +01255 <span class="comment">// std::map<TMotivation, std::set<TClassifierNumber> >::iterator itOldClassifierByMotivation;</span> +01256 <span class="comment">// std::map<TTargetId, std::map<TAction, CMotivationEnergy> >::iterator itOldActionsExecutionIntensityByTarget;</span> +01257 <span class="comment">// std::map<TAction, CMotivationEnergy>::iterator itOldActionsExecutionIntensity;</span> +01258 <span class="comment">// for(itOldActionsExecutionIntensityByTarget = _pOldActionsExecutionIntensityByTarget->begin();</span> +01259 <span class="comment">// itOldActionsExecutionIntensityByTarget != _pOldActionsExecutionIntensityByTarget->end();</span> +01260 <span class="comment">// itOldActionsExecutionIntensityByTarget++)</span> +01261 <span class="comment">// {</span> +01262 <span class="comment">// for(itOldActionsExecutionIntensity = (*itOldActionsExecutionIntensityByTarget).second.begin();</span> +01263 <span class="comment">// itOldActionsExecutionIntensity != (*itOldActionsExecutionIntensityByTarget).second.end();</span> +01264 <span class="comment">// itOldActionsExecutionIntensity++)</span> +01265 <span class="comment">// {</span> +01266 <span class="comment">// const std::map<TMotivation, std::set<TClassifierNumber> >* provounet = (*itOldActionsExecutionIntensity).second.getProviders();</span> +01267 <span class="comment">// std::map<TMotivation, std::set<TClassifierNumber> >::const_iterator itProvounet;</span> +01268 <span class="comment">// for(itProvounet = provounet->begin();</span> +01269 <span class="comment">// itProvounet != provounet->end();</span> +01270 <span class="comment">// itProvounet++)</span> +01271 <span class="comment">// {</span> +01272 <span class="comment">// TMotivation motivationName = (*itProvounet).first;</span> +01273 <span class="comment">// std::set<TClassifierNumber>::const_iterator itClassifierNumber;</span> +01274 <span class="comment">// for (itClassifierNumber = (*itProvounet).second.begin(); itClassifierNumber != (*itProvounet).second.end(); itClassifierNumber++)</span> +01275 <span class="comment">// {</span> +01276 <span class="comment">// TClassifierNumber classifierNumber = (*itClassifierNumber);</span> +01277 <span class="comment">// // On établit une liste des classeurs ayant été actifs.</span> +01278 <span class="comment">// oldClassifierByMotivation[motivationName].insert(classifierNumber);</span> +01279 <span class="comment">// }</span> +01280 <span class="comment">// }</span> +01281 <span class="comment">// }</span> +01282 <span class="comment">// }</span> +01283 +01284 <span class="comment">// On remet à zero les compteurs de temps pour les actions qui on satisfait une motivation</span> +01285 std::set<TMotivation>::iterator itDecreasingMotivations; +01286 <span class="keywordflow">for</span> (itDecreasingMotivations = decreasingMotivations.begin(); itDecreasingMotivations != decreasingMotivations.end(); itDecreasingMotivations++) +01287 { +01288 <a class="code" href="a05371.html#a99">TMotivation</a> motivationName = (*itDecreasingMotivations); +01289 std::map<TMotivation, std::map<TClassifierNumber, CTemporaryPriority> >::iterator itTemporaryPriority = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>.find(motivationName); +01290 <span class="keywordflow">if</span> (itTemporaryPriority != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>.end()) +01291 { +01292 std::map<TClassifierNumber, CTemporaryPriority>::iterator itPrioByCl; +01293 <span class="keywordflow">for</span> (itPrioByCl = (*itTemporaryPriority).second.begin(); itPrioByCl != (*itTemporaryPriority).second.end(); itPrioByCl++ ) +01294 { +01295 <span class="comment">// Si le temps a été fixé</span> +01296 <span class="comment">// bool aUnFixedStartTime = (*itPrioByCl).second.FixedStartTime;</span> +01297 <span class="comment">// if (aUnFixedStartTime)</span> +01298 <span class="comment">// {</span> +01299 <a class="code" href="a04558.html#a11">uint32</a> startTime = (*itPrioByCl).second.StartTime; +01300 <span class="keywordflow">if</span> (startTime > newTime) +01301 { +01302 newTime = startTime; +01303 } +01304 <a class="code" href="a04558.html#a11">uint32</a> timeToSatisfaction = newTime - startTime; +01305 <a class="code" href="a05371.html#a7">TClassifierNumber</a> classifierNumber = (*itPrioByCl).first; +01306 <span class="comment">// On met à jour la fitness des classeurs ayant été activés.</span> +01307 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">_pMHiCSbase</a>->learningUpdatePriorityValueTimeToSuccess(motivationName, classifierNumber, timeToSatisfaction); +01308 <span class="comment">// }</span> +01309 } +01310 } +01311 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>.erase(motivationName); +01312 } +01313 +01314 <span class="comment">// On établit la liste des classeurs nouveaux utilisés à ce pas ci</span> +01315 std::map<TTargetId, std::map<TAction, CMotivationEnergy> >::iterator itActionsExecutionIntensityByTarget; +01316 std::map<TAction, CMotivationEnergy>::iterator itActionsExecutionIntensity; +01317 <span class="keywordflow">for</span>(itActionsExecutionIntensityByTarget = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->begin(); +01318 itActionsExecutionIntensityByTarget != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->end(); +01319 itActionsExecutionIntensityByTarget++) +01320 { +01321 <span class="keywordflow">for</span>(itActionsExecutionIntensity = (*itActionsExecutionIntensityByTarget).second.begin(); +01322 itActionsExecutionIntensity != (*itActionsExecutionIntensityByTarget).second.end(); +01323 itActionsExecutionIntensity++) +01324 { +01325 <span class="keyword">const</span> std::map<TMotivation, std::set<TClassifierNumber> >* provounet = (*itActionsExecutionIntensity).second.getProviders(); +01326 std::map<TMotivation, std::set<TClassifierNumber> >::const_iterator itProvounet; +01327 <span class="keywordflow">for</span>(itProvounet = provounet->begin(); +01328 itProvounet != provounet->end(); +01329 itProvounet++) +01330 { +01331 <a class="code" href="a05371.html#a99">TMotivation</a> motivationName = (*itProvounet).first; +01332 std::set<TClassifierNumber>::const_iterator itClassifierNumber; +01333 <span class="keywordflow">for</span> (itClassifierNumber = (*itProvounet).second.begin(); itClassifierNumber != (*itProvounet).second.end(); itClassifierNumber++) +01334 { +01335 <a class="code" href="a05371.html#a7">TClassifierNumber</a> classifierNumber = (*itClassifierNumber); +01336 <span class="comment">// itOldClassifierByMotivation = oldClassifierByMotivation.find(motivationName);</span> +01337 <span class="comment">// if (itOldClassifierByMotivation != oldClassifierByMotivation.end() )</span> +01338 <span class="comment">// {</span> +01339 <span class="comment">// ajout du classeur dans la liste des classeurs activés</span> +01340 (*_pInfoClassifierActivity)[motivationName][classifierNumber].IsActive = <span class="keyword">true</span>; +01341 <span class="comment">// classifierByMotivation[motivationName].insert(classifierNumber);</span> +01342 <span class="comment">// }</span> +01343 } +01344 } +01345 } +01346 } +01347 +01348 <span class="comment">// on établit la liste des classeurs qui étaient activables et qui ne le sont plus</span> +01349 std::map<TMotivation, std::map<TClassifierNumber, CClassifierActivityInfo> >::iterator itOldInfoClassifierActivity; +01350 std::map<TMotivation, std::map<TClassifierNumber, CClassifierActivityInfo> >::iterator itInfoClassifierActivity; +01351 <span class="keywordflow">for</span>(itOldInfoClassifierActivity = (*_pOldInfoClassifierActivity).begin(); +01352 itOldInfoClassifierActivity != (*_pOldInfoClassifierActivity).end(); +01353 itOldInfoClassifierActivity++ ) +01354 { +01355 <a class="code" href="a05371.html#a99">TMotivation</a> motivationName = (*itOldInfoClassifierActivity).first; +01356 std::map<TClassifierNumber, CClassifierActivityInfo>::iterator itClassifiers, itClassifiersBis; +01357 <span class="keywordflow">for</span> (itClassifiers = (*itOldInfoClassifierActivity).second.begin(); itClassifiers != (*itOldInfoClassifierActivity).second.end(); itClassifiers++) +01358 { +01359 <span class="comment">// std::set<TClassifierNumber>::iterator itClassifiersBisBis;</span> +01360 <span class="comment">// bool isStillActivable = false;</span> +01361 <a class="code" href="a05371.html#a7">TClassifierNumber</a> classifierNumber = (*itClassifiers).first; +01362 <span class="keywordtype">bool</span> wasActive = (*itClassifiers).second.IsActive; +01363 <span class="keywordtype">bool</span> isActive = (*_pInfoClassifierActivity)[motivationName][classifierNumber].IsActive; +01364 <span class="keywordflow">if</span> (wasActive && !isActive) +01365 { +01366 <span class="comment">// Le classeur vient de finir son activité, je calcule sa nouvelle priorité.</span> +01367 <a class="code" href="a04558.html#a11">uint32</a> diffTime = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>[motivationName][classifierNumber].TemporaryClassifierPriorityTime; +01368 <span class="keywordflow">if</span> (diffTime >0) +01369 { +01370 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">_pMHiCSbase</a>->learningUpdatePriorityValueClassifierTime(motivationName, classifierNumber, diffTime); +01371 <span class="comment">// _TemporaryPriority[motivationName][classifierNumber].FixedStartTime = false;</span> +01372 } +01373 } +01374 +01375 <span class="comment">// bool wasActivable = (*itClassifiers).second.IsActivable;</span> +01376 <span class="comment">// if (wasActivable)</span> +01377 <span class="comment">// {</span> +01378 <span class="comment">// itInfoClassifierActivity = (*_pInfoClassifierActivity).find(motivationName);</span> +01379 <span class="comment">// if (itInfoClassifierActivity != (*_pInfoClassifierActivity).end())</span> +01380 <span class="comment">// {</span> +01381 <span class="comment">// itClassifiersBis = (*itInfoClassifierActivity).second.find(classifierNumber);</span> +01382 <span class="comment">// if ( itClassifiersBis != (*itInfoClassifierActivity).second.end() )</span> +01383 <span class="comment">// {</span> +01384 <span class="comment">// isStillActivable = true;</span> +01385 <span class="comment">// }</span> +01386 <span class="comment">// }</span> +01387 <span class="comment">// if (isStillActivable)</span> +01388 <span class="comment">// {</span> +01389 <span class="comment">// // s'il est activable mais plus activé alors on met à jour son compteur de temps d'execution</span> +01390 <span class="comment">// bool estActif = (*_pInfoClassifierActivity)[motivationName][classifierNumber].IsActive;</span> +01400 <span class="comment"></span><span class="comment">// if (!estActif)</span> +01401 <span class="comment">// {</span> +01402 <span class="comment">// std::map<TMotivation, std::set<TClassifierNumber> >::iterator itOldClassifierByMotivation = oldClassifierByMotivation.find(motivationName);</span> +01403 <span class="comment">// if (itOldClassifierByMotivation != oldClassifierByMotivation.end())</span> +01404 <span class="comment">// {</span> +01405 <span class="comment">// itClassifiersBisBis = (*itOldClassifierByMotivation).second.find(classifierNumber);</span> +01406 <span class="comment">// if ( itClassifiersBisBis != (*itOldClassifierByMotivation).second.end() )</span> +01407 <span class="comment">// {</span> +01408 <span class="comment">// // Le classeur vient de finir son activité, je calcule sa nouvelle priorité.</span> +01409 <span class="comment">// uint32 diffTime = _TemporaryPriority[motivationName][classifierNumber].TemporaryClassifierPriorityTime;</span> +01410 <span class="comment">// if (diffTime >0)</span> +01411 <span class="comment">// {</span> +01412 <span class="comment">// _pMHiCSbase->learningUpdatePriorityValueClassifierTime(motivationName, classifierNumber, diffTime);</span> +01413 <span class="comment">// _TemporaryPriority[motivationName][classifierNumber].FixedStartTime = false;</span> +01414 <span class="comment">// }</span> +01415 <span class="comment">// }</span> +01416 <span class="comment">// }</span> +01417 <span class="comment">// }</span> +01418 <span class="comment">// }</span> +01419 <span class="comment">// else</span> +01420 <span class="comment">// {</span> +01421 <span class="comment">// // Dans tous les cas on met à jour son temps d'activation s'il a été activé par le passé.</span> +01422 <span class="comment">// std::map<TMotivation, std::map<TClassifierNumber, CTemporaryPriority> >::iterator itTemporaryPriority = _TemporaryPriority.find(motivationName);</span> +01423 <span class="comment">// if (itTemporaryPriority != _TemporaryPriority.end())</span> +01424 <span class="comment">// {</span> +01425 <span class="comment">// std::map<TClassifierNumber, CTemporaryPriority>::iterator itClassifiersTerce = (*itTemporaryPriority).second.find(classifierNumber);</span> +01426 <span class="comment">// if (itClassifiersTerce != (*itTemporaryPriority).second.end() )</span> +01427 <span class="comment">// {</span> +01428 <span class="comment">// // Le classeur vient de finir son activité, je calcule sa nouvelle priorité.</span> +01429 <span class="comment">// uint32 diffTime = _TemporaryPriority[motivationName][classifierNumber].TemporaryClassifierPriorityTime;</span> +01430 <span class="comment">// if (diffTime >0)</span> +01431 <span class="comment">// {</span> +01432 <span class="comment">// _pMHiCSbase->learningUpdatePriorityValueClassifierTime(motivationName, classifierNumber, diffTime);</span> +01433 <span class="comment">// _TemporaryPriority[motivationName][classifierNumber].FixedStartTime = false;</span> +01434 <span class="comment">// }</span> +01435 <span class="comment">// }</span> +01436 <span class="comment">// }</span> +01437 <span class="comment">// </span> +01438 <span class="comment">// // S'il n'était pas activé (avant de n'être plus activable), on le retire de la liste des éligibles au T2S</span> +01451 <span class="comment"></span><span class="comment">// _TemporaryPriority[motivationName][classifierNumber].FixedStartTime = false;</span> +01453 <span class="comment"></span><span class="comment">// }</span> +01454 <span class="comment">// }</span> +01455 } +01456 } +01457 +01458 std::map<TClassifierNumber, CClassifierActivityInfo>::iterator itUnChtitClassifierNumberInfo; +01459 <span class="comment">// On regarde quelles sont les nouveaux classeurs activés</span> +01460 <span class="keywordflow">for</span>(itInfoClassifierActivity = (*_pInfoClassifierActivity).begin(); +01461 itInfoClassifierActivity != (*_pInfoClassifierActivity).end(); +01462 itInfoClassifierActivity++) +01463 { +01464 <a class="code" href="a05371.html#a99">TMotivation</a> motivationName = (*itInfoClassifierActivity).first; +01465 +01466 <span class="keywordflow">for</span>(itUnChtitClassifierNumberInfo = (*itInfoClassifierActivity).second.begin(); +01467 itUnChtitClassifierNumberInfo != (*itInfoClassifierActivity).second.end(); +01468 itUnChtitClassifierNumberInfo++) +01469 { +01470 <a class="code" href="a05371.html#a7">TClassifierNumber</a> leNumberDuClasseur = (*itUnChtitClassifierNumberInfo).first; +01471 <span class="keywordtype">bool</span> wasActive = (*_pOldInfoClassifierActivity)[motivationName][leNumberDuClasseur].IsActive; +01472 <span class="keywordtype">bool</span> isActive = (*itUnChtitClassifierNumberInfo).second.IsActive; +01473 <span class="keywordflow">if</span> (isActive) +01474 { +01475 <span class="keywordflow">if</span> (!wasActive) +01476 { +01477 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>[motivationName][leNumberDuClasseur].StartTime = newTime; +01478 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>[motivationName][leNumberDuClasseur].LastTime = newTime; +01479 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>[motivationName][leNumberDuClasseur].FixedStartTime = <span class="keyword">true</span>; +01480 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>[motivationName][leNumberDuClasseur].TemporaryClassifierPriorityTime = 0; +01481 } +01482 <span class="comment">// Je fais progresser le timer</span> +01483 <a class="code" href="a04558.html#a11">uint32</a> lastTime = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">_TemporaryPriority</a>[motivationName][leNumberDuClasseur].LastTime; +01484 <span class="keywordflow">if</span> (lastTime > newTime) +01485 { +01486 newTime = lastTime; +01487 } +01488 <a class="code" href="a04558.html#a11">uint32</a> diffTime = newTime - lastTime; +01489 _TemporaryPriority[motivationName][leNumberDuClasseur].LastTime = newTime; +01490 _TemporaryPriority[motivationName][leNumberDuClasseur].TemporaryClassifierPriorityTime += diffTime; +01491 } +01492 +01493 <span class="comment">// if (isActive)</span> +01494 <span class="comment">// {</span> +01495 <span class="comment">// // Si l'action n'avait pas de startTime fixé, on lui en donne un.</span> +01496 <span class="comment">// bool avaitUnFixedStartTime = false;</span> +01497 <span class="comment">// std::map<TMotivation, std::map<TClassifierNumber, CTemporaryPriority> >::iterator itTemporaryPriority = _TemporaryPriority.find(motivationName);</span> +01498 <span class="comment">// if (itTemporaryPriority != _TemporaryPriority.end() )</span> +01499 <span class="comment">// {</span> +01500 <span class="comment">// std::map<TClassifierNumber, CTemporaryPriority>::iterator itClassifierAndPrio = (*itTemporaryPriority).second.find(leNumberDuClasseur);</span> +01501 <span class="comment">// if (itClassifierAndPrio != (*itTemporaryPriority).second.end() )</span> +01502 <span class="comment">// {</span> +01503 <span class="comment">// avaitUnFixedStartTime = (*itClassifierAndPrio).second.FixedStartTime;</span> +01504 <span class="comment">// }</span> +01505 <span class="comment">// }</span> +01506 <span class="comment">// if (!avaitUnFixedStartTime)</span> +01507 <span class="comment">// {</span> +01508 <span class="comment">// _TemporaryPriority[motivationName][leNumberDuClasseur].StartTime = newTime;</span> +01509 <span class="comment">// _TemporaryPriority[motivationName][leNumberDuClasseur].FixedStartTime = true;</span> +01510 <span class="comment">// _TemporaryPriority[motivationName][leNumberDuClasseur].TemporaryClassifierPriorityTime = 0;</span> +01511 <span class="comment">// }</span> +01512 <span class="comment">// else</span> +01513 <span class="comment">// {</span> +01514 <span class="comment">// // Si elle avait un startime, on regarde si elle était active au tour précédent.</span> +01515 <span class="comment">// bool etaitActifJusteAvant = false;</span> +01516 <span class="comment">// std::map<TMotivation, std::set<TClassifierNumber> >::iterator itOldClassifierByMotivation = oldClassifierByMotivation.find(motivationName);</span> +01517 <span class="comment">// if (itOldClassifierByMotivation != oldClassifierByMotivation.end())</span> +01518 <span class="comment">// {</span> +01519 <span class="comment">// std::set<TClassifierNumber>::iterator itClassifier = (*itOldClassifierByMotivation).second.find(leNumberDuClasseur);</span> +01520 <span class="comment">// if (itClassifier != (*itOldClassifierByMotivation).second.end() )</span> +01521 <span class="comment">// {</span> +01522 <span class="comment">// etaitActifJusteAvant = true;</span> +01523 <span class="comment">// }</span> +01524 <span class="comment">// }</span> +01525 <span class="comment">// if (!etaitActifJusteAvant)</span> +01526 <span class="comment">// {</span> +01527 <span class="comment">// _TemporaryPriority[motivationName][leNumberDuClasseur].LastTime = newTime;</span> +01529 <span class="comment"></span><span class="comment">// }</span> +01530 <span class="comment">// }</span> +01531 <span class="comment">// </span> +01532 <span class="comment">// // Je fais progresser le timer</span> +01533 <span class="comment">// uint32 lastTime = _TemporaryPriority[motivationName][leNumberDuClasseur].LastTime;</span> +01534 <span class="comment">// if (lastTime > newTime)</span> +01535 <span class="comment">// {</span> +01536 <span class="comment">// newTime = lastTime;</span> +01537 <span class="comment">// }</span> +01538 <span class="comment">// uint32 diffTime = newTime - lastTime;</span> +01539 <span class="comment">// _TemporaryPriority[motivationName][leNumberDuClasseur].LastTime = newTime;</span> +01540 <span class="comment">// _TemporaryPriority[motivationName][leNumberDuClasseur].TemporaryClassifierPriorityTime += diffTime;</span> +01541 <span class="comment">// }</span> +01542 +01543 } +01544 } +01545 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentd1" doxytag="NLAINIMAT::CMHiCSagent::motivationCompute" ></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::CMHiCSagent::motivationCompute </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> [private]</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="a06032.html#l00982">982</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00294">_ClassifiersAndMotivationIntensity</a>, <a class="el" href="a06033.html#l00293">_pMHiCSbase</a>, <a class="el" href="a06033.html#l00297">_pSensorsValues</a>, <a class="el" href="a05371.html#a101a56">NLAINIMAT::Action_DoNothing</a>, <a class="el" href="a06032.html#l00285">NLAINIMAT::CMHiCSbase::getActionPart()</a>, <a class="el" href="a06032.html#l00049">NLAINIMAT::CMotivationEnergy::getSumValue()</a>, <a class="el" href="a06032.html#l00256">NLAINIMAT::CMHiCSbase::selectBehavior()</a>, <a class="el" href="a06363.html#l00185">NLAINIMAT::TAction</a>, <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>, <a class="el" href="a06363.html#l00045">NLAINIMAT::TMotivation</a>, and <a class="el" href="a06363.html#l00038">NLAINIMAT::TTargetId</a>. +<p> +Referenced by <a class="el" href="a06032.html#l01159">run()</a>. +<p> +<div class="fragment"><pre>00983 { +00984 <a class="code" href="a05371.html#a101">TAction</a> behav; +00985 +00986 std::map<TMotivation, CMotivationEnergy>::iterator itClassifiersAndMotivationIntensity; +00987 +00988 <span class="comment">// On parcour toutes les motivations.</span> +00989 <span class="keywordflow">for</span> (itClassifiersAndMotivationIntensity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.begin(); +00990 itClassifiersAndMotivationIntensity != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.end(); +00991 itClassifiersAndMotivationIntensity++) +00992 { +00993 CMotivationEnergy* pCSselection = &((*itClassifiersAndMotivationIntensity).second); +00994 <a class="code" href="a05371.html#a99">TMotivation</a> selectionName = (*itClassifiersAndMotivationIntensity).first; +00995 <span class="keywordtype">double</span> energy = pCSselection->getSumValue(); +00996 <span class="comment">// Si une motivation est active (une energie >0 ) on actionne ses règles.</span> +00997 <span class="keywordflow">if</span> (energy > 0) +00998 { +00999 <span class="comment">// On fait calculer le CS</span> +01000 std::multimap<CClassifierPriority, std::pair<TClassifierNumber, TTargetId> > mapActivableCS; +01001 std::multimap<CClassifierPriority, std::pair<TClassifierNumber, TTargetId> >::iterator itMapActivableCS; +01002 +01003 <span class="comment">// On fait la liste des classeurs activables.</span> +01004 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">_pMHiCSbase</a>->selectBehavior(selectionName,_pSensorsValues, mapActivableCS); +01005 +01006 <span class="comment">// Pour chaque classeur activable, on transmet la valeur de motivation à l'action selectionnée.</span> +01007 <span class="keywordflow">for</span> (itMapActivableCS = mapActivableCS.begin(); itMapActivableCS != mapActivableCS.end(); itMapActivableCS++) +01008 { +01009 <a class="code" href="a05371.html#a7">TClassifierNumber</a> selectedClassifierNumber = (*itMapActivableCS).second.first; +01010 <a class="code" href="a05371.html#a13">TTargetId</a> currentTargetId = (*itMapActivableCS).second.second; +01011 behav = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">_pMHiCSbase</a>->getActionPart(selectionName, selectedClassifierNumber); +01012 +01013 (*_pInfoClassifierActivity)[selectionName][selectedClassifierNumber].IsActivable = <span class="keyword">true</span>; +01014 +01015 <span class="comment">// We add the current motivation energy to the selected action.</span> +01016 <span class="keywordflow">if</span> (behav != <a class="code" href="a05371.html#a101a56">Action_DoNothing</a>) +01017 { +01018 <span class="comment">// std::map<TTargetId, std::map<TAction, CMotivationEnergy> >::const_iterator itOldActionsExecutionIntensityByTarget = (*_pOldActionsExecutionIntensityByTarget).find(currentTargetId);</span> +01019 <span class="comment">// if (itOldActionsExecutionIntensityByTarget != (*_pOldActionsExecutionIntensityByTarget).end() )</span> +01020 <span class="comment">// {</span> +01021 <span class="comment">// std::map<TAction, CMotivationEnergy>::const_iterator itIntensityByTarget = (*itOldActionsExecutionIntensityByTarget).second.find(behav);</span> +01022 <span class="comment">// if (itIntensityByTarget != (*itOldActionsExecutionIntensityByTarget).second.end())</span> +01023 <span class="comment">// {</span> +01024 <span class="comment">// (*_pActionsExecutionIntensityByTarget)[currentTargetId][behav].setWasPreviouslyActived(true);</span> +01025 <span class="comment">// }</span> +01026 <span class="comment">// }</span> +01027 (*_pActionsExecutionIntensityByTarget)[currentTargetId][behav].setMHiCSagent(<span class="keyword">this</span>); +01028 (*_pActionsExecutionIntensityByTarget)[currentTargetId][behav].addProvider(selectionName, selectedClassifierNumber); +01029 } +01030 } +01031 } +01032 } +01033 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta7" doxytag="NLAINIMAT::CMHiCSagent::run" ></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::CMHiCSagent::run </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> +* if (selectedClassifierNumber < 0) +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l01159">1159</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00298">_pActionsExecutionIntensityByTarget</a>, <a class="el" href="a06033.html#l00304">_pInfoClassifierActivity</a>, <a class="el" href="a06033.html#l00299">_pOldActionsExecutionIntensityByTarget</a>, <a class="el" href="a06033.html#l00305">_pOldInfoClassifierActivity</a>, and <a class="el" href="a06032.html#l00982">motivationCompute()</a>. +<p> +<div class="fragment"><pre>01160 { +01161 std::map<TTargetId, std::map<TAction, CMotivationEnergy> > *bibu = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr6">_pOldActionsExecutionIntensityByTarget</a>; +01162 _pOldActionsExecutionIntensityByTarget = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>; +01163 _pActionsExecutionIntensityByTarget = bibu; +01164 _pActionsExecutionIntensityByTarget->clear(); +01165 +01166 std::map<TMotivation, std::map<TClassifierNumber, CClassifierActivityInfo> > *biba = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr7">_pOldInfoClassifierActivity</a>; +01167 _pOldInfoClassifierActivity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr4">_pInfoClassifierActivity</a>; +01168 _pInfoClassifierActivity = biba; +01169 _pInfoClassifierActivity->clear(); +01170 +01171 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentd1">motivationCompute</a>(); +01172 <span class="comment">// virtualActionCompute();</span> +01173 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta8" doxytag="NLAINIMAT::CMHiCSagent::selectBehavior" ></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"> const std::map< <a class="el" href="a05371.html#a13">TTargetId</a>, std::map< <a class="el" href="a05371.html#a101">TAction</a>, <a class="el" href="a02938.html">CMotivationEnergy</a> > > * NLAINIMAT::CMHiCSagent::selectBehavior </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> +Return the Behavior that must be active. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l01548">1548</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00294">_ClassifiersAndMotivationIntensity</a>, <a class="el" href="a06033.html#l00300">_Learning</a>, <a class="el" href="a06033.html#l00295">_OldClassifiersAndMotivationIntensity</a>, <a class="el" href="a06033.html#l00298">_pActionsExecutionIntensityByTarget</a>, <a class="el" href="a06033.html#l00293">_pMHiCSbase</a>, <a class="el" href="a06362.html#l00094">NLAINIMAT::CActionResources::filterMyActions()</a>, <a class="el" href="a06032.html#l01219">learningComputation()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06033.html#l00185">NLAINIMAT::CMHiCSbase::pActionResources</a>, <a class="el" href="a06363.html#l00185">NLAINIMAT::TAction</a>, and <a class="el" href="a06363.html#l00038">NLAINIMAT::TTargetId</a>. +<p> +<div class="fragment"><pre>01549 { +01550 <span class="comment">//We sort actions by priority</span> +01551 <span class="keywordtype">double</span> priority; +01552 <a class="code" href="a05371.html#a101">TAction</a> action; +01553 <a class="code" href="a05371.html#a13">TTargetId</a> target; +01554 std::multimap<double, std::pair<TTargetId,TAction> > actionsToRemove; +01555 +01556 std::map<TTargetId, std::map<TAction, CMotivationEnergy> >::iterator itActionsExecutionIntensityByTarget; +01557 std::map<TAction, CMotivationEnergy>::const_iterator itMotiveByAction; +01558 <span class="keywordflow">for</span> (itActionsExecutionIntensityByTarget = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->begin(); +01559 itActionsExecutionIntensityByTarget != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->end(); +01560 itActionsExecutionIntensityByTarget++) +01561 { +01562 <span class="keywordflow">for</span> (itMotiveByAction = (*itActionsExecutionIntensityByTarget).second.begin(); +01563 itMotiveByAction != (*itActionsExecutionIntensityByTarget).second.end(); +01564 itMotiveByAction++) +01565 { +01566 priority = (*itMotiveByAction).second.getSumValue(); +01567 action = (*itMotiveByAction).first; +01568 target = (*itActionsExecutionIntensityByTarget).first; +01569 +01570 <span class="comment">// on rajoute du bruit sur les priorité afin d'avoir une diversité si des priorités sont proches</span> +01571 <span class="comment">// double randomeNumber = ((rand()%5)*priority)/100;</span> +01572 <span class="comment">// priority += randomeNumber;</span> +01573 +01574 actionsToRemove.insert(std::make_pair(priority, std::make_pair(target,action))); +01575 } +01576 } +01577 +01578 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">_pMHiCSbase</a>->pActionResources->filterMyActions(actionsToRemove); +01579 +01580 std::multimap<double, std::pair<TTargetId,TAction> >::iterator itActionsToRemove; +01581 <span class="keywordflow">for</span> (itActionsToRemove = actionsToRemove.begin(); +01582 itActionsToRemove != actionsToRemove.end(); +01583 itActionsToRemove++) +01584 { +01585 target = (*itActionsToRemove).second.first; +01586 action = (*itActionsToRemove).second.second; +01587 itActionsExecutionIntensityByTarget = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->find(target); +01588 <a class="code" href="a04199.html#a6">nlassert</a> (itActionsExecutionIntensityByTarget != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->end()); +01589 itMotiveByAction = (*itActionsExecutionIntensityByTarget).second.find(action); +01590 <a class="code" href="a04199.html#a6">nlassert</a> (itMotiveByAction != (*itActionsExecutionIntensityByTarget).second.end()); +01591 (*itActionsExecutionIntensityByTarget).second.erase(action); +01592 <span class="keywordflow">if</span> ( (*itActionsExecutionIntensityByTarget).second.begin() == (*itActionsExecutionIntensityByTarget).second.end() ) +01593 { +01594 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>->erase(target); +01595 } +01596 } +01597 +01598 <span class="keywordflow">if</span> (<a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr1">_Learning</a>) +01599 { +01600 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentd0">learningComputation</a>(); +01601 +01602 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr2">_OldClassifiersAndMotivationIntensity</a> = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>; +01603 } +01604 +01605 <span class="keywordflow">return</span> <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">_pActionsExecutionIntensityByTarget</a>; +01606 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta9" doxytag="NLAINIMAT::CMHiCSagent::setLearning" ></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::CMHiCSagent::setLearning </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">bool </td> + <td class="mdname1" valign="top" nowrap> <em>active</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> + +<p> +Definition at line <a class="el" href="a06032.html#l01181">1181</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00300">_Learning</a>. +<p> +<div class="fragment"><pre>01182 { +01183 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr1">_Learning</a> = active; +01184 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta10" doxytag="NLAINIMAT::CMHiCSagent::setMotivationPP" ></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::CMHiCSagent::setMotivationPP </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a99">TMotivation</a> </td> + <td class="mdname" nowrap> <em>motivationName</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>double </td> + <td class="mdname" nowrap> <em>PP</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Donne la Puissance Propre d'une Motivation. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l00780">780</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00294">_ClassifiersAndMotivationIntensity</a>. +<p> +<div class="fragment"><pre>00781 { +00782 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>[motivationName].setMHiCSagent(<span class="keyword">this</span>); +00783 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>[motivationName].setMotivationPP(motivationName, PP); +00784 <span class="comment">// spreadMotivationReckon(motivationName);</span> +00785 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta11" doxytag="NLAINIMAT::CMHiCSagent::setMotivationValue" ></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::CMHiCSagent::setMotivationValue </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a99">TMotivation</a> </td> + <td class="mdname" nowrap> <em>motivationName</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>double </td> + <td class="mdname" nowrap> <em>value</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Fixe la valeur d'une motivation. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l00802">802</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00294">_ClassifiersAndMotivationIntensity</a>, and <a class="el" href="a05646.html#l01132">value</a>. +<p> +<div class="fragment"><pre>00803 { +00804 <span class="comment">// if (_Learning)</span> +00805 <span class="comment">// {</span> +00806 <span class="comment">// double lastMotiveValue = _ClassifiersAndMotivationIntensity[motivationName].getMotivationValue(motivationName);</span> +00807 <span class="comment">// // Si la valeur de motivation a diminuée, il est temps d'apprendre</span> +00808 <span class="comment">// if (lastMotiveValue > value)</span> +00809 <span class="comment">// {</span> +00810 <span class="comment">// learningComputationMotivationDecrease(motivationName);</span> +00811 <span class="comment">// }</span> +00812 <span class="comment">// }</span> +00813 +00814 std::map<TMotivation, CMotivationEnergy>::iterator itClassifiersAndMotivationIntensity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.find(motivationName); +00815 <span class="keywordflow">if</span> (itClassifiersAndMotivationIntensity == <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.end()) +00816 { +00817 itClassifiersAndMotivationIntensity = <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">_ClassifiersAndMotivationIntensity</a>.insert(std::make_pair(motivationName,CMotivationEnergy())).first; +00818 +00819 <span class="comment">// On en profite pour mettre à zero la date de la première réponse positive d'une motivation</span> +00820 <span class="comment">// _TimeOfLastMotivationValueDecrease[motivationName] = NLMISC::CTime::getSecondsSince1970();</span> +00821 } +00822 (*itClassifiersAndMotivationIntensity).second.setMHiCSagent(<span class="keyword">this</span>); +00823 (*itClassifiersAndMotivationIntensity).second.setMotivationValue(motivationName, value); +00824 <span class="comment">// spreadMotivationReckon(motivationName);</span> +00825 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta12" doxytag="NLAINIMAT::CMHiCSagent::setSensors" ></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::CMHiCSagent::setSensors </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02422.html">CCSPerception</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>psensorMap</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> +Set the sensor source. +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l01176">1176</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00297">_pSensorsValues</a>. +<p> +<div class="fragment"><pre>01177 { +01178 <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr8">_pSensorsValues</a> = psensorMap; +01179 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentd2" doxytag="NLAINIMAT::CMHiCSagent::targetId2String" ></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::string NLAINIMAT::CMHiCSagent::targetId2String </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a13">TTargetId</a> </td> + <td class="mdname1" valign="top" nowrap> <em>id</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +function used in debug to change a TTargetId in a string +<p> + +<p> +Definition at line <a class="el" href="a06032.html#l00691">691</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>, and <a class="el" href="a06363.html#l00038">NLAINIMAT::TTargetId</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00707">getDebugString()</a>. +<p> +<div class="fragment"><pre>00692 { +00693 <span class="comment">/* // Le format est celui pour afficher en debug le Nb comme dans Ryzom.</span> +00694 <span class="comment"> uint32 aiBoteId = id;</span> +00695 <span class="comment"> uint32 managerID = (aiBoteId>>(8+12))&( (1<<10)-1 );</span> +00696 <span class="comment"> uint32 groupeID = (aiBoteId>>8)&( (1<<12)-1 );</span> +00697 <span class="comment"> uint32 boteID = aiBoteId&( (1<<8)-1 );</span> +00698 <span class="comment"> char result[30];</span> +00699 <span class="comment"> sprintf(result,"AI:%04x:BOT:%04x:%04x:%04x",aiBoteId,managerID,groupeID,boteID);</span> +00700 <span class="comment"> return result;</span> +00701 <span class="comment">*/</span> +00702 std::string ret = <a class="code" href="a05378.html#a244">NLMISC::toString</a>(<span class="keywordtype">id</span>); +00703 <span class="keywordflow">return</span> ret; +00704 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagenta13" doxytag="NLAINIMAT::CMHiCSagent::wasClassifierPreviouslyActive" ></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"> bool NLAINIMAT::CMHiCSagent::wasClassifierPreviouslyActive </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a99">TMotivation</a> </td> + <td class="mdname" nowrap> <em>motivationName</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a05371.html#a7">TClassifierNumber</a> </td> + <td class="mdname" nowrap> <em>classifierNumber</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const</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="a06032.html#l01624">1624</a> of file <a class="el" href="a06032.html">mhics.cpp</a>. +<p> +References <a class="el" href="a06033.html#l00305">_pOldInfoClassifierActivity</a>, and <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00095">NLAINIMAT::CMotivationEnergy::computeMotivationValue()</a>. +<p> +<div class="fragment"><pre>01625 { +01626 <span class="keywordtype">bool</span> wasPreviouslyActived = <span class="keyword">false</span>; +01627 +01628 std::map<TMotivation, std::map<TClassifierNumber, CClassifierActivityInfo> >::const_iterator itOldInfoClassifierActivity; +01629 itOldInfoClassifierActivity = (*_pOldInfoClassifierActivity).find(motivationName); +01630 <span class="keywordflow">if</span> (itOldInfoClassifierActivity != <a class="code" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr7">_pOldInfoClassifierActivity</a>->end()) +01631 { +01632 std::map<TClassifierNumber, CClassifierActivityInfo>::const_iterator itClassifierInfo = (*itOldInfoClassifierActivity).second.find(classifierNumber); +01633 <span class="keywordflow">if</span> (itClassifierInfo != (*itOldInfoClassifierActivity).second.end() ) +01634 { +01635 wasPreviouslyActived = (*itClassifierInfo).second.IsActive; +01636 } +01637 } +01638 <span class="keywordflow">return</span> wasPreviouslyActived; +01639 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr0" doxytag="NLAINIMAT::CMHiCSagent::_ClassifiersAndMotivationIntensity" ></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::map<<a class="el" href="a05371.html#a99">TMotivation</a>, <a class="el" href="a02938.html">CMotivationEnergy</a>> <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr0">NLAINIMAT::CMHiCSagent::_ClassifiersAndMotivationIntensity</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="a06033.html#l00294">294</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00707">getDebugString()</a>, <a class="el" href="a06032.html#l00788">getMotivationPP()</a>, <a class="el" href="a06032.html#l00827">getMotivationValue()</a>, <a class="el" href="a06032.html#l01219">learningComputation()</a>, <a class="el" href="a06032.html#l00982">motivationCompute()</a>, <a class="el" href="a06032.html#l01548">selectBehavior()</a>, <a class="el" href="a06032.html#l00780">setMotivationPP()</a>, and <a class="el" href="a06032.html#l00802">setMotivationValue()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr1" doxytag="NLAINIMAT::CMHiCSagent::_Learning" ></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"> bool <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr1">NLAINIMAT::CMHiCSagent::_Learning</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="a06033.html#l00300">300</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00668">CMHiCSagent()</a>, <a class="el" href="a06032.html#l01548">selectBehavior()</a>, and <a class="el" href="a06032.html#l01181">setLearning()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr2" doxytag="NLAINIMAT::CMHiCSagent::_OldClassifiersAndMotivationIntensity" ></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::map<<a class="el" href="a05371.html#a99">TMotivation</a>, <a class="el" href="a02938.html">CMotivationEnergy</a>> <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr2">NLAINIMAT::CMHiCSagent::_OldClassifiersAndMotivationIntensity</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="a06033.html#l00295">295</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l01219">learningComputation()</a>, and <a class="el" href="a06032.html#l01548">selectBehavior()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr3" doxytag="NLAINIMAT::CMHiCSagent::_pActionsExecutionIntensityByTarget" ></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::map<<a class="el" href="a05371.html#a13">TTargetId</a>, std::map<<a class="el" href="a05371.html#a101">TAction</a>, <a class="el" href="a02938.html">CMotivationEnergy</a>> >* <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr3">NLAINIMAT::CMHiCSagent::_pActionsExecutionIntensityByTarget</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="a06033.html#l00298">298</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00668">CMHiCSagent()</a>, <a class="el" href="a06032.html#l00855">getExecutionIntensity()</a>, <a class="el" href="a06032.html#l01219">learningComputation()</a>, <a class="el" href="a06032.html#l01159">run()</a>, <a class="el" href="a06032.html#l01548">selectBehavior()</a>, and <a class="el" href="a06032.html#l00682">~CMHiCSagent()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr4" doxytag="NLAINIMAT::CMHiCSagent::_pInfoClassifierActivity" ></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::map<<a class="el" href="a05371.html#a99">TMotivation</a>, std::map<<a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a02927.html">CClassifierActivityInfo</a>> >* <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr4">NLAINIMAT::CMHiCSagent::_pInfoClassifierActivity</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="a06033.html#l00304">304</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00668">CMHiCSagent()</a>, <a class="el" href="a06032.html#l01159">run()</a>, and <a class="el" href="a06032.html#l00682">~CMHiCSagent()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr5" doxytag="NLAINIMAT::CMHiCSagent::_pMHiCSbase" ></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"> <a class="el" href="a02929.html">CMHiCSbase</a>* <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr5">NLAINIMAT::CMHiCSagent::_pMHiCSbase</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="a06033.html#l00293">293</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00668">CMHiCSagent()</a>, <a class="el" href="a06033.html#l00240">getMHiCSbase()</a>, <a class="el" href="a06032.html#l01219">learningComputation()</a>, <a class="el" href="a06032.html#l00982">motivationCompute()</a>, and <a class="el" href="a06032.html#l01548">selectBehavior()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr6" doxytag="NLAINIMAT::CMHiCSagent::_pOldActionsExecutionIntensityByTarget" ></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::map<<a class="el" href="a05371.html#a13">TTargetId</a>, std::map<<a class="el" href="a05371.html#a101">TAction</a>, <a class="el" href="a02938.html">CMotivationEnergy</a>> >* <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr6">NLAINIMAT::CMHiCSagent::_pOldActionsExecutionIntensityByTarget</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="a06033.html#l00299">299</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00668">CMHiCSagent()</a>, <a class="el" href="a06032.html#l01159">run()</a>, and <a class="el" href="a06032.html#l00682">~CMHiCSagent()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr7" doxytag="NLAINIMAT::CMHiCSagent::_pOldInfoClassifierActivity" ></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::map<<a class="el" href="a05371.html#a99">TMotivation</a>, std::map<<a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a02927.html">CClassifierActivityInfo</a>> >* <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr7">NLAINIMAT::CMHiCSagent::_pOldInfoClassifierActivity</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="a06033.html#l00305">305</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00668">CMHiCSagent()</a>, <a class="el" href="a06032.html#l01159">run()</a>, <a class="el" href="a06032.html#l01624">wasClassifierPreviouslyActive()</a>, and <a class="el" href="a06032.html#l00682">~CMHiCSagent()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr8" doxytag="NLAINIMAT::CMHiCSagent::_pSensorsValues" ></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"> <a class="el" href="a02422.html">CCSPerception</a>* <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr8">NLAINIMAT::CMHiCSagent::_pSensorsValues</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="a06033.html#l00297">297</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00707">getDebugString()</a>, <a class="el" href="a06032.html#l00982">motivationCompute()</a>, and <a class="el" href="a06032.html#l01176">setSensors()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CMHiCSagentr9" doxytag="NLAINIMAT::CMHiCSagent::_TemporaryPriority" ></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::map<<a class="el" href="a05371.html#a99">TMotivation</a>, std::map<<a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a02928.html">CTemporaryPriority</a>> > <a class="el" href="a02926.html#NLAINIMAT_1_1CMHiCSagentr9">NLAINIMAT::CMHiCSagent::_TemporaryPriority</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="a06033.html#l00303">303</a> of file <a class="el" href="a06033.html">mhics.h</a>. +<p> +Referenced by <a class="el" href="a06032.html#l01608">getTemporaryClassifierPriorityTime()</a>, and <a class="el" href="a06032.html#l01219">learningComputation()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a06033.html">mhics.h</a><li><a class="el" href="a06032.html">mhics.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 11:10:17 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> |