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/a02343.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/a02343.html | 1102 |
1 files changed, 1102 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02343.html b/docs/doxygen/nel/a02343.html new file mode 100644 index 00000000..f076028b --- /dev/null +++ b/docs/doxygen/nel/a02343.html @@ -0,0 +1,1102 @@ +<!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::CClassifierSystem 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::CClassifierSystem Class Reference</h1><code>#include <<a class="el" href="a05552.html">classifier.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A simple and minimal version of a Classifier System. <dl compact><dt><b>Author:</b></dt><dd>Gabriel ROBERT <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05552.html#l00165">165</a> of file <a class="el" href="a05552.html">classifier.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>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema0">addClassifier</a> (const <a class="el" href="a02399.html">CConditionMap</a> &conditionsMap, <a class="el" href="a02342.html">CClassifierPriority</a> priority, <a class="el" href="a05371.html#a101">TAction</a> behavior)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema1">addClassifierSystem</a> (const <a class="el" href="a02343.html">CClassifierSystem</a> &cs)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Merge two CS. <a href="#NLAINIMAT_1_1CClassifierSystema1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema2">CClassifierSystem</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#NLAINIMAT_1_1CClassifierSystema2"></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="a02343.html#NLAINIMAT_1_1CClassifierSystema3">dividePriorityByTheMinPriorityPart</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05371.html#a101">TAction</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema4">getActionPart</a> (<a class="el" href="a05371.html#a7">TClassifierNumber</a> classifierNumber) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05371.html#a7">TClassifierNumber</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema5">getClassifierNumber</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the number of classifiers. <a href="#NLAINIMAT_1_1CClassifierSystema5"></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="a02343.html#NLAINIMAT_1_1CClassifierSystema6">getDebugString</a> (<a class="el" href="a05371.html#a7">TClassifierNumber</a> classifierNumber, std::string &<a class="el" href="a04223.html#a627">t</a>) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema7">getDebugString</a> (std::string &<a class="el" href="a04223.html#a627">t</a>) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02342.html">CClassifierPriority</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema8">getPriorityPart</a> (<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="a02343.html#NLAINIMAT_1_1CClassifierSystema9">selectBehavior</a> (const <a class="el" href="a02422.html">CCSPerception</a> *psensorMap, std::multimap< <a class="el" href="a02342.html">CClassifierPriority</a>, std::pair< <a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a05371.html#a13">TTargetId</a> > > &mapActivableCS)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema10">setPriorityPart</a> (<a class="el" href="a05371.html#a7">TClassifierNumber</a> classifierNumber, <a class="el" href="a02342.html">CClassifierPriority</a> priority)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystema11">~CClassifierSystem</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Private Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< <a class="el" href="a05371.html#a7">TClassifierNumber</a>,<br> + <a class="el" href="a02344.html">CClassifier</a> * >::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemy0">TitClassifiers</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="a02343.html#NLAINIMAT_1_1CClassifierSystemd0">RAZNoTargetSensors</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemd1">RAZTargetSensors</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemd2">updateNoTargetSensors</a> (const <a class="el" href="a02422.html">CCSPerception</a> *psensorMap)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemd3">updateTargetSensors</a> (const <a class="el" href="a02422.html">CCSPerception</a> *psensorMap, <a class="el" href="a05371.html#a13">TTargetId</a> target)</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05371.html#a7">TClassifierNumber</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr0">_ClassifierNumber</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::map< <a class="el" href="a05371.html#a7">TClassifierNumber</a>,<br> + <a class="el" href="a02344.html">CClassifier</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05371.html#a6">TSensorMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a></td></tr> + +</table> +<hr><h2>Member Typedef Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystemy0" doxytag="NLAINIMAT::CClassifierSystem::TitClassifiers" ></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"> typedef std::map<<a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a02344.html">CClassifier</a>*>::iterator <a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemy0">NLAINIMAT::CClassifierSystem::TitClassifiers</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="a05552.html#l00200">200</a> of file <a class="el" href="a05552.html">classifier.h</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00357">selectBehavior()</a>. </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema2" doxytag="NLAINIMAT::CClassifierSystem::CClassifierSystem" ></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::CClassifierSystem::CClassifierSystem </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> +Destructor. +<p> + +<p> +Definition at line <a class="el" href="a05551.html#l00079">79</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00222">_ClassifierNumber</a>. +<p> +<div class="fragment"><pre>00080 { +00081 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr0">_ClassifierNumber</a> = 0; +00082 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema11" doxytag="NLAINIMAT::CClassifierSystem::~CClassifierSystem" ></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::CClassifierSystem::~<a class="el" href="a02343.html">CClassifierSystem</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="a05551.html#l00084">84</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00221">_Classifiers</a>. +<p> +<div class="fragment"><pre>00085 { +00086 std::map<TClassifierNumber, CClassifier*>::iterator itClassifiers = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.begin(); +00087 <span class="keywordflow">while</span> (itClassifiers != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.end()) +00088 { +00089 <span class="keyword">delete</span> (*itClassifiers).second; +00090 itClassifiers++; +00091 } +00092 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema0" doxytag="NLAINIMAT::CClassifierSystem::addClassifier" ></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::CClassifierSystem::addClassifier </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02399.html">CConditionMap</a> & </td> + <td class="mdname" nowrap> <em>conditionsMap</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02342.html">CClassifierPriority</a> </td> + <td class="mdname" nowrap> <em>priority</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a05371.html#a101">TAction</a> </td> + <td class="mdname" nowrap> <em>behavior</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> +Add a new classifier in the classifier system. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>conditionsMap</em> </td><td>is a map whose key is the sensor name and value the sensor value. </td></tr> + <tr><td valign=top><em>priority</em> </td><td>is the importance of this rule. The value should be between 0 an 1. </td></tr> + <tr><td valign=top><em>behavior</em> </td><td>is the action to execute if this classifier is selected.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05551.html#l00094">94</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00222">_ClassifierNumber</a>, <a class="el" href="a05552.html#l00221">_Classifiers</a>, <a class="el" href="a05552.html#l00220">_Sensors</a>, <a class="el" href="a05552.html#l00150">NLAINIMAT::CConditionMap::begin()</a>, <a class="el" href="a05552.html#l00197">NLAINIMAT::CClassifierSystem::CClassifier::Behavior</a>, <a class="el" href="a05552.html#l00195">NLAINIMAT::CClassifierSystem::CClassifier::ConditionWithoutTarget</a>, <a class="el" href="a05552.html#l00194">NLAINIMAT::CClassifierSystem::CClassifier::ConditionWithTarget</a>, <a class="el" href="a05552.html#l00151">NLAINIMAT::CConditionMap::end()</a>, <a class="el" href="a05552.html#l00196">NLAINIMAT::CClassifierSystem::CClassifier::Priority</a>, and <a class="el" href="a06363.html#l00071">NLAINIMAT::TSensor</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00128">addClassifierSystem()</a>, <a class="el" href="a05551.html#l00699">NLAINIMAT::CActionClassifiers::addMotivationRule()</a>, and <a class="el" href="a05551.html#l00707">NLAINIMAT::CActionClassifiers::addVirtualActionRule()</a>. +<p> +<div class="fragment"><pre>00095 { +00096 <span class="comment">// We build a new classifier.</span> +00097 CClassifier* classifier = <span class="keyword">new</span> CClassifier(); +00098 classifier->Behavior = behavior; +00099 classifier->Priority = priority; +00100 +00101 CClassifierConditionCell* condCell; +00102 std::map<TSensor, CConditionMap::CSensor >::const_iterator itCondition; +00103 <span class="keywordflow">for</span> (itCondition = conditionsMap.begin(); itCondition != conditionsMap.end(); itCondition++) +00104 { +00105 <span class="comment">// We add the new sensor in the sensor map and init it with a joker value '#'</span> +00106 <a class="code" href="a05371.html#a100">TSensor</a> bibu = (*itCondition).first; +00107 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>[(*itCondition).first] = <span class="charliteral">'#'</span>; +00108 +00109 <span class="comment">// A new condition cell is added to the classifier condition.</span> +00110 condCell = <span class="keyword">new</span> CClassifierConditionCell(<a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.find((*itCondition).first), +00111 (*itCondition).second.SensorValue, +00112 (*itCondition).second.TruthValue); +00113 <span class="keywordflow">if</span> ((*itCondition).second.NeedTarget) +00114 { +00115 classifier->ConditionWithTarget.push_back(condCell); +00116 } +00117 <span class="keywordflow">else</span> +00118 { +00119 classifier->ConditionWithoutTarget.push_back(condCell); +00120 } +00121 } +00122 +00123 <span class="comment">// The new classifier is added to the classifier list.</span> +00124 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>[<a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr0">_ClassifierNumber</a>++] = classifier; +00125 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema1" doxytag="NLAINIMAT::CClassifierSystem::addClassifierSystem" ></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::CClassifierSystem::addClassifierSystem </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02343.html">CClassifierSystem</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>cs</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> +Merge two CS. +<p> + +<p> +Definition at line <a class="el" href="a05551.html#l00128">128</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00221">_Classifiers</a>, <a class="el" href="a05551.html#l00094">addClassifier()</a>, <a class="el" href="a05551.html#l00666">NLAINIMAT::CConditionMap::addSensorCondition()</a>, <a class="el" href="a05551.html#l00637">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getSensorIsTrue()</a>, <a class="el" href="a05551.html#l00627">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getSensorName()</a>, and <a class="el" href="a05551.html#l00632">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getValue()</a>. +<p> +Referenced by <a class="el" href="a06032.html#l00222">NLAINIMAT::CMHiCSbase::addVirtualActionCS()</a>. +<p> +<div class="fragment"><pre>00129 { +00130 std::map<TClassifierNumber, CClassifier*>::const_iterator itCSClassifiers; +00131 +00132 <span class="comment">// Pour chacun des classeurs de cs</span> +00133 <span class="keywordflow">for</span> (itCSClassifiers = cs._Classifiers.begin(); itCSClassifiers != cs._Classifiers.end(); itCSClassifiers++) +00134 { +00135 CConditionMap conditionsMap; +00136 std::list<CClassifierConditionCell*>::const_iterator itCondCell; +00137 +00138 <span class="comment">// Pour chacune des condition sans cible d'un de ces classeur</span> +00139 <span class="keywordflow">for</span> (itCondCell = (*itCSClassifiers).second->ConditionWithoutTarget.begin(); +00140 itCondCell !=(*itCSClassifiers).second->ConditionWithoutTarget.end(); +00141 itCondCell++) +00142 { +00143 CClassifierConditionCell* pCondCell = (*itCondCell); +00144 <span class="comment">// Je construit une liste de condition</span> +00145 conditionsMap.addSensorCondition(pCondCell->getSensorName(), pCondCell->getValue(),pCondCell->getSensorIsTrue()); +00146 } +00147 +00148 <span class="comment">// Pour chacune des condition avec cible d'un de ces classeur</span> +00149 <span class="keywordflow">for</span> (itCondCell = (*itCSClassifiers).second->ConditionWithTarget.begin(); +00150 itCondCell !=(*itCSClassifiers).second->ConditionWithTarget.end(); +00151 itCondCell++) +00152 { +00153 CClassifierConditionCell* pCondCell = (*itCondCell); +00154 <span class="comment">// Je construit une liste de condition</span> +00155 conditionsMap.addSensorCondition(pCondCell->getSensorName(), pCondCell->getValue(),pCondCell->getSensorIsTrue()); +00156 } +00157 +00158 <span class="comment">// je rajoute dans mon cs un nouveau classeur avec ces conditions, la priorité et le comportement du classeur</span> +00159 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystema0">addClassifier</a>(conditionsMap, (*itCSClassifiers).second->Priority, (*itCSClassifiers).second->Behavior); +00160 } +00161 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema3" doxytag="NLAINIMAT::CClassifierSystem::dividePriorityByTheMinPriorityPart" ></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::CClassifierSystem::dividePriorityByTheMinPriorityPart </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> + </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema4" doxytag="NLAINIMAT::CClassifierSystem::getActionPart" ></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="a05371.html#a101">TAction</a> NLAINIMAT::CClassifierSystem::getActionPart </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a7">TClassifierNumber</a> </td> + <td class="mdname1" valign="top" nowrap> <em>classifierNumber</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> +Give the action part of a given Classifier. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>classifierNumber</em> </td><td>is the number of the classifier. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>is the condition part of the wanted Classifier.</dd></dl> + +<p> +Definition at line <a class="el" href="a05551.html#l00413">413</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00221">_Classifiers</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06363.html#l00185">NLAINIMAT::TAction</a>, and <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>. +<p> +<div class="fragment"><pre>00414 { +00415 std::map<TClassifierNumber, CClassifier*>::const_iterator itClassifiers = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.find(classifierNumber); +00416 <a class="code" href="a04199.html#a6">nlassert</a>(itClassifiers != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.end()); +00417 <span class="keywordflow">return</span> (*itClassifiers).second->Behavior; +00418 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema5" doxytag="NLAINIMAT::CClassifierSystem::getClassifierNumber" ></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="a05371.html#a7">TClassifierNumber</a> NLAINIMAT::CClassifierSystem::getClassifierNumber </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> +Return the number of classifiers. +<p> + +<p> +Definition at line <a class="el" href="a05552.html#l00262">262</a> of file <a class="el" href="a05552.html">classifier.h</a>. +<p> +References <a class="el" href="a05552.html#l00222">_ClassifierNumber</a>, and <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>. +<p> +<div class="fragment"><pre>00262 {<span class="keywordflow">return</span> <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr0">_ClassifierNumber</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema6" doxytag="NLAINIMAT::CClassifierSystem::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::CClassifierSystem::getDebugString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a7">TClassifierNumber</a> </td> + <td class="mdname" nowrap> <em>classifierNumber</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::string & </td> + <td class="mdname" nowrap> <em>t</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="a05551.html#l00505">505</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00221">_Classifiers</a>, <a class="el" href="a05551.html#l00044">NLAINIMAT::CClassifierPriority::getPriority()</a>, <a class="el" href="a05551.html#l00637">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getSensorIsTrue()</a>, <a class="el" href="a05551.html#l00627">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getSensorName()</a>, <a class="el" href="a05551.html#l00632">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getValue()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05646.html#l00985">t</a>, <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>, and <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>. +<p> +<div class="fragment"><pre>00506 { +00507 std::string dbg = <span class="stringliteral">""</span>; +00508 std::map<TClassifierNumber, CClassifier*>::const_iterator itClassifiers = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.find(classifierNumber); +00509 <a class="code" href="a04199.html#a6">nlassert</a> (itClassifiers != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.end()); +00510 +00511 dbg += <span class="stringliteral">"<"</span> + <a class="code" href="a05378.html#a244">NLMISC::toString</a>(classifierNumber) + <span class="stringliteral">"> "</span>; +00512 std::list<CClassifierConditionCell*>::const_iterator itConditions; +00513 <span class="comment">// On parcour la liste de sensor indépendant d'une cible</span> +00514 <span class="keywordflow">for</span> (itConditions = (*itClassifiers).second->ConditionWithoutTarget.begin(); +00515 itConditions != (*itClassifiers).second->ConditionWithoutTarget.end(); +00516 itConditions++) +00517 { +00518 CClassifierConditionCell* condCell = (*itConditions); +00519 <span class="keywordflow">if</span> (condCell->getSensorIsTrue()) +00520 { +00521 dbg += <span class="stringliteral">" ("</span> + conversionSensor.toString(condCell->getSensorName()) + <span class="stringliteral">"= "</span> + condCell->getValue() + <span class="stringliteral">") +"</span>; +00522 } +00523 <span class="keywordflow">else</span> +00524 { +00525 dbg += <span class="stringliteral">" ("</span> + conversionSensor.toString(condCell->getSensorName()) + <span class="stringliteral">"=!"</span> + condCell->getValue() + <span class="stringliteral">") +"</span>; +00526 } +00527 } +00528 <span class="comment">// On parcour la liste de sensor dépendant d'une cible</span> +00529 <span class="keywordflow">for</span> (itConditions = (*itClassifiers).second->ConditionWithTarget.begin(); +00530 itConditions != (*itClassifiers).second->ConditionWithTarget.end(); +00531 itConditions++) +00532 { +00533 CClassifierConditionCell* condCell = (*itConditions); +00534 <span class="keywordflow">if</span> (condCell->getSensorIsTrue()) +00535 { +00536 dbg += <span class="stringliteral">" ("</span> + conversionSensor.toString(condCell->getSensorName()) + <span class="stringliteral">"(x)= "</span> + condCell->getValue() + <span class="stringliteral">") +"</span>; +00537 } +00538 <span class="keywordflow">else</span> +00539 { +00540 dbg += <span class="stringliteral">" ("</span> + conversionSensor.toString(condCell->getSensorName()) + <span class="stringliteral">"(x)=!"</span> + condCell->getValue() + <span class="stringliteral">") +"</span>; +00541 } +00542 } +00543 std::string actionName = conversionAction.toString((*itClassifiers).second->Behavior); +00544 CClassifierPriority prio = (*itClassifiers).second->Priority; +00545 dbg += <span class="stringliteral">"> "</span> + actionName + <span class="stringliteral">" ["</span> + <a class="code" href="a05378.html#a244">NLMISC::toString</a>(prio.getPriority()) + <span class="stringliteral">"]"</span>; +00546 <a class="code" href="a04223.html#a627">t</a> += dbg; +00547 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema7" doxytag="NLAINIMAT::CClassifierSystem::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::CClassifierSystem::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> + +<p> +Definition at line <a class="el" href="a05551.html#l00459">459</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00221">_Classifiers</a>, <a class="el" href="a05551.html#l00044">NLAINIMAT::CClassifierPriority::getPriority()</a>, <a class="el" href="a05551.html#l00637">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getSensorIsTrue()</a>, <a class="el" href="a05551.html#l00627">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getSensorName()</a>, <a class="el" href="a05551.html#l00632">NLAINIMAT::CClassifierSystem::CClassifierConditionCell::getValue()</a>, <a class="el" href="a05646.html#l00985">t</a>, and <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>. +<p> +<div class="fragment"><pre>00460 { +00461 std::string dbg = <span class="stringliteral">"\n"</span>; +00462 +00463 std::map<TClassifierNumber, CClassifier*>::const_iterator itClassifiers; +00464 <span class="keywordflow">for</span> (itClassifiers = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.begin(); itClassifiers != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.end(); itClassifiers++) +00465 { +00466 dbg += <span class="stringliteral">"<"</span> + <a class="code" href="a05378.html#a244">NLMISC::toString</a>((*itClassifiers).first) + <span class="stringliteral">"> "</span>; +00467 std::list<CClassifierConditionCell*>::const_iterator itConditions; +00468 <span class="comment">// On parcour la liste de sensor indépendant d'une cible</span> +00469 <span class="keywordflow">for</span> (itConditions = (*itClassifiers).second->ConditionWithoutTarget.begin(); +00470 itConditions != (*itClassifiers).second->ConditionWithoutTarget.end(); +00471 itConditions++) +00472 { +00473 CClassifierConditionCell* condCell = (*itConditions); +00474 <span class="keywordflow">if</span> (condCell->getSensorIsTrue()) +00475 { +00476 dbg += <span class="stringliteral">" ("</span> + conversionSensor.toString(condCell->getSensorName()) + <span class="stringliteral">"= "</span> + condCell->getValue() + <span class="stringliteral">") +"</span>; +00477 } +00478 <span class="keywordflow">else</span> +00479 { +00480 dbg += <span class="stringliteral">" ("</span> + conversionSensor.toString(condCell->getSensorName()) + <span class="stringliteral">"=!"</span> + condCell->getValue() + <span class="stringliteral">") +"</span>; +00481 } +00482 } +00483 <span class="comment">// On parcour la liste de sensor dépendant d'une cible</span> +00484 <span class="keywordflow">for</span> (itConditions = (*itClassifiers).second->ConditionWithTarget.begin(); +00485 itConditions != (*itClassifiers).second->ConditionWithTarget.end(); +00486 itConditions++) +00487 { +00488 CClassifierConditionCell* condCell = (*itConditions); +00489 <span class="keywordflow">if</span> (condCell->getSensorIsTrue()) +00490 { +00491 dbg += <span class="stringliteral">" ("</span> + conversionSensor.toString(condCell->getSensorName()) + <span class="stringliteral">"(x)= "</span> + condCell->getValue() + <span class="stringliteral">") +"</span>; +00492 } +00493 <span class="keywordflow">else</span> +00494 { +00495 dbg += <span class="stringliteral">" ("</span> + conversionSensor.toString(condCell->getSensorName()) + <span class="stringliteral">"(x)=!"</span> + condCell->getValue() + <span class="stringliteral">") +"</span>; +00496 } +00497 } +00498 std::string actionName = conversionAction.toString((*itClassifiers).second->Behavior); +00499 CClassifierPriority prio = (*itClassifiers).second->Priority; +00500 dbg += <span class="stringliteral">"> "</span> + actionName + <span class="stringliteral">" ["</span> + <a class="code" href="a05378.html#a244">NLMISC::toString</a>(prio.getPriority()) + <span class="stringliteral">"]\n"</span>; +00501 } +00502 <a class="code" href="a04223.html#a627">t</a> += dbg; +00503 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema8" doxytag="NLAINIMAT::CClassifierSystem::getPriorityPart" ></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="a02342.html">CClassifierPriority</a> NLAINIMAT::CClassifierSystem::getPriorityPart </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a7">TClassifierNumber</a> </td> + <td class="mdname1" valign="top" nowrap> <em>classifierNumber</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> + +<p> +Definition at line <a class="el" href="a05551.html#l00420">420</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00221">_Classifiers</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>. +<p> +<div class="fragment"><pre>00421 { +00422 std::map<TClassifierNumber, CClassifier*>::const_iterator itClassifiers = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.find(classifierNumber); +00423 <a class="code" href="a04199.html#a6">nlassert</a>(itClassifiers != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.end()); +00424 <span class="keywordflow">return</span> (*itClassifiers).second->Priority; +00425 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystemd0" doxytag="NLAINIMAT::CClassifierSystem::RAZNoTargetSensors" ></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::CClassifierSystem::RAZNoTargetSensors </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="a05551.html#l00215">215</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00220">_Sensors</a>, and <a class="el" href="a05371.html#a100a47">NLAINIMAT::Sensors_WITHTARGET</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00357">selectBehavior()</a>. +<p> +<div class="fragment"><pre>00216 { +00217 TSensorMap::iterator itSensorBorder = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.upper_bound(Sensors_WITHTARGET); +00218 TSensorMap::iterator itSensors; +00219 <span class="keywordflow">for</span> (itSensors = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.begin(); itSensors != itSensorBorder; itSensors++) +00220 { +00221 (*itSensors).second = <span class="charliteral">'#'</span>; +00222 } +00223 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystemd1" doxytag="NLAINIMAT::CClassifierSystem::RAZTargetSensors" ></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::CClassifierSystem::RAZTargetSensors </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="a05551.html#l00204">204</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00220">_Sensors</a>, and <a class="el" href="a05371.html#a100a47">NLAINIMAT::Sensors_WITHTARGET</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00357">selectBehavior()</a>. +<p> +<div class="fragment"><pre>00205 { +00206 TSensorMap::iterator itSensorBorder = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.upper_bound(Sensors_WITHTARGET); +00207 TSensorMap::iterator itSensors; +00208 <span class="keywordflow">for</span> (itSensors = itSensorBorder; itSensors != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.end(); itSensors++) +00209 { +00210 (*itSensors).second = <span class="charliteral">'#'</span>; +00211 } +00212 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema9" doxytag="NLAINIMAT::CClassifierSystem::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"> void NLAINIMAT::CClassifierSystem::selectBehavior </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02422.html">CCSPerception</a> * </td> + <td class="mdname" nowrap> <em>psensorMap</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::multimap< <a class="el" href="a02342.html">CClassifierPriority</a>, std::pair< <a class="el" href="a05371.html#a7">TClassifierNumber</a>, <a class="el" href="a05371.html#a13">TTargetId</a> > > & </td> + <td class="mdname" nowrap> <em>mapActivableCS</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> +Select a behavior according to the values in the sensorMap. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>sensorMap</em> </td><td>is a map whose key is the sensor name and value the sensor value. </td></tr> + <tr><td valign=top><em>mapActivableCS</em> </td><td>is the return value for the map containing all the activable CS. TClassifierPriority is the priority, TClassifierNumber the classifier number and TTargetId la cible de l'action</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05551.html#l00357">357</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00221">_Classifiers</a>, <a class="el" href="a05551.html#l00215">RAZNoTargetSensors()</a>, <a class="el" href="a05551.html#l00204">RAZTargetSensors()</a>, <a class="el" href="a05552.html#l00122">NLAINIMAT::CCSPerception::TargetSensors</a>, <a class="el" href="a05552.html#l00200">TitClassifiers</a>, <a class="el" href="a06363.html#l00038">NLAINIMAT::TTargetId</a>, <a class="el" href="a05551.html#l00164">updateNoTargetSensors()</a>, and <a class="el" href="a05551.html#l00183">updateTargetSensors()</a>. +<p> +<div class="fragment"><pre>00359 { +00360 <span class="comment">// We update the internal sensor values for the no target sensors</span> +00361 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemd2">updateNoTargetSensors</a>(psensorMap); +00362 +00363 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemy0">TitClassifiers</a> itClassifiers; +00364 +00365 <span class="keywordflow">for</span> (itClassifiers = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.begin(); +00366 itClassifiers != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.end(); +00367 itClassifiers++) +00368 { +00369 <span class="comment">// S'il y a des conditions dépendantes d'une cible, ce n'est pas activable.</span> +00370 <span class="keywordflow">if</span> ((*itClassifiers).second->ConditionWithTarget.begin() == (*itClassifiers).second->ConditionWithTarget.end()) +00371 { +00372 <span class="keywordflow">if</span> ( (*itClassifiers).second->isActivable()) +00373 { +00374 mapActivableCS.insert(std::make_pair((*itClassifiers).second->Priority, std::make_pair((*itClassifiers).first, NullTargetId))); +00375 } +00376 } +00377 } +00378 +00379 <span class="comment">// We now do the same, but with target sensors.</span> +00380 std::map<TTargetId, TSensorMap>::const_iterator itTargetSensorMap; +00381 <span class="keywordflow">for</span> (itTargetSensorMap = psensorMap->TargetSensors.begin(); itTargetSensorMap != psensorMap->TargetSensors.end(); itTargetSensorMap++) +00382 { +00383 <a class="code" href="a05371.html#a13">TTargetId</a> myTarget = (*itTargetSensorMap).first; +00384 <span class="comment">// We update the internal sensor values for the target sensors</span> +00385 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemd3">updateTargetSensors</a>(psensorMap, myTarget); +00386 +00387 <span class="comment">// We select the activables classifiers</span> +00388 <span class="keywordflow">for</span> (itClassifiers = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.begin(); +00389 itClassifiers != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.end(); +00390 itClassifiers++) +00391 { +00392 <span class="comment">// S'il n'y a pas de conditions dépendantes d'une cible, ça a déjà été traité au dessus.</span> +00393 <span class="keywordflow">if</span> ((*itClassifiers).second->ConditionWithTarget.begin() != (*itClassifiers).second->ConditionWithTarget.end()) +00394 { +00395 <span class="keywordflow">if</span> ( (*itClassifiers).second->isActivable()) +00396 { +00397 mapActivableCS.insert(std::make_pair((*itClassifiers).second->Priority, std::make_pair((*itClassifiers).first, myTarget))); +00398 } +00399 } +00400 } +00401 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemd1">RAZTargetSensors</a>(); +00402 } +00403 +00404 <span class="comment">// We set the sensors back to the default value.</span> +00405 <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemd0">RAZNoTargetSensors</a>(); +00406 +00407 <span class="comment">// // We set the return values.</span> +00408 <span class="comment">// lastClassifierNumber = selectionNumber;</span> +00409 <span class="comment">// lastTarget = myTarget;</span> +00410 <span class="comment">// lastSelectionMaxPriority = higherPriority;</span> +00411 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystema10" doxytag="NLAINIMAT::CClassifierSystem::setPriorityPart" ></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::CClassifierSystem::setPriorityPart </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a05371.html#a7">TClassifierNumber</a> </td> + <td class="mdname" nowrap> <em>classifierNumber</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02342.html">CClassifierPriority</a> </td> + <td class="mdname" nowrap> <em>priority</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> + +<p> +Definition at line <a class="el" href="a05551.html#l00427">427</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00221">_Classifiers</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05552.html#l00064">NLAINIMAT::TClassifierNumber</a>. +<p> +<div class="fragment"><pre>00428 { +00429 std::map<TClassifierNumber, CClassifier*>::iterator itClassifiers = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.find(classifierNumber); +00430 <a class="code" href="a04199.html#a6">nlassert</a>(itClassifiers != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">_Classifiers</a>.end()); +00431 (*itClassifiers).second->Priority = priority; +00432 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystemd2" doxytag="NLAINIMAT::CClassifierSystem::updateNoTargetSensors" ></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::CClassifierSystem::updateNoTargetSensors </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <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><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="a05551.html#l00164">164</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00220">_Sensors</a>, <a class="el" href="a05552.html#l00120">NLAINIMAT::CCSPerception::NoTargetSensors</a>, <a class="el" href="a06363.html#l00071">NLAINIMAT::TSensor</a>, and <a class="el" href="a05552.html#l00062">NLAINIMAT::TSensorValue</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00357">selectBehavior()</a>. +<p> +<div class="fragment"><pre>00165 { +00166 <span class="comment">// We use an internal sensor map, because each condition cell is mapped to this intrenal map.</span> +00167 TSensorMap::iterator itSensors; +00168 TSensorMap::const_iterator itNoTargetSensors; +00169 +00170 <span class="keywordflow">for</span> (itSensors = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.begin(); itSensors != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.end(); itSensors++) +00171 { +00172 <a class="code" href="a05371.html#a100">TSensor</a> sensName = (*itSensors).first; +00173 itNoTargetSensors = psensorMap->NoTargetSensors.find(sensName); +00174 <span class="keywordflow">if</span> (itNoTargetSensors !=psensorMap->NoTargetSensors.end()) +00175 { +00176 <a class="code" href="a05371.html#a5">TSensorValue</a> c = (*itNoTargetSensors).second; +00177 (*itSensors).second = c; +00178 } +00179 } +00180 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystemd3" doxytag="NLAINIMAT::CClassifierSystem::updateTargetSensors" ></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::CClassifierSystem::updateTargetSensors </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02422.html">CCSPerception</a> * </td> + <td class="mdname" nowrap> <em>psensorMap</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"><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="a05551.html#l00183">183</a> of file <a class="el" href="a05551.html">classifier.cpp</a>. +<p> +References <a class="el" href="a05552.html#l00220">_Sensors</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05552.html#l00122">NLAINIMAT::CCSPerception::TargetSensors</a>, <a class="el" href="a06363.html#l00071">NLAINIMAT::TSensor</a>, <a class="el" href="a05552.html#l00062">NLAINIMAT::TSensorValue</a>, and <a class="el" href="a06363.html#l00038">NLAINIMAT::TTargetId</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00357">selectBehavior()</a>. +<p> +<div class="fragment"><pre>00184 { +00185 <span class="comment">// We update the internal sensor values for the target sensors</span> +00186 TSensorMap::iterator itSensors; +00187 TSensorMap::const_iterator itTargetSensors; +00188 std::map<TTargetId, TSensorMap>::const_iterator itTargetSensorMap = psensorMap->TargetSensors.find(target); +00189 <a class="code" href="a04199.html#a6">nlassert</a>( itTargetSensorMap != psensorMap->TargetSensors.end() ); +00190 +00191 <span class="keywordflow">for</span> (itSensors = <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.begin(); itSensors != <a class="code" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">_Sensors</a>.end(); itSensors++) +00192 { +00193 <a class="code" href="a05371.html#a100">TSensor</a> sensName = (*itSensors).first; +00194 itTargetSensors = (*itTargetSensorMap).second.find(sensName); +00195 <span class="keywordflow">if</span> (itTargetSensors != (*itTargetSensorMap).second.end()) +00196 { +00197 <a class="code" href="a05371.html#a5">TSensorValue</a> c = (*itTargetSensors).second; +00198 (*itSensors).second = c; +00199 } +00200 } +00201 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystemr0" doxytag="NLAINIMAT::CClassifierSystem::_ClassifierNumber" ></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="a05371.html#a7">TClassifierNumber</a> <a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr0">NLAINIMAT::CClassifierSystem::_ClassifierNumber</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="a05552.html#l00222">222</a> of file <a class="el" href="a05552.html">classifier.h</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00094">addClassifier()</a>, <a class="el" href="a05551.html#l00079">CClassifierSystem()</a>, and <a class="el" href="a05552.html#l00262">getClassifierNumber()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystemr1" doxytag="NLAINIMAT::CClassifierSystem::_Classifiers" ></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#a7">TClassifierNumber</a>, <a class="el" href="a02344.html">CClassifier</a>*> <a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr1">NLAINIMAT::CClassifierSystem::_Classifiers</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="a05552.html#l00221">221</a> of file <a class="el" href="a05552.html">classifier.h</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00094">addClassifier()</a>, <a class="el" href="a05551.html#l00128">addClassifierSystem()</a>, <a class="el" href="a05551.html#l00413">getActionPart()</a>, <a class="el" href="a05551.html#l00459">getDebugString()</a>, <a class="el" href="a05551.html#l00420">getPriorityPart()</a>, <a class="el" href="a05551.html#l00357">selectBehavior()</a>, <a class="el" href="a05551.html#l00427">setPriorityPart()</a>, and <a class="el" href="a05551.html#l00084">~CClassifierSystem()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLAINIMAT_1_1CClassifierSystemr2" doxytag="NLAINIMAT::CClassifierSystem::_Sensors" ></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="a05371.html#a6">TSensorMap</a> <a class="el" href="a02343.html#NLAINIMAT_1_1CClassifierSystemr2">NLAINIMAT::CClassifierSystem::_Sensors</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="a05552.html#l00220">220</a> of file <a class="el" href="a05552.html">classifier.h</a>. +<p> +Referenced by <a class="el" href="a05551.html#l00094">addClassifier()</a>, <a class="el" href="a05551.html#l00215">RAZNoTargetSensors()</a>, <a class="el" href="a05551.html#l00204">RAZTargetSensors()</a>, <a class="el" href="a05551.html#l00164">updateNoTargetSensors()</a>, and <a class="el" href="a05551.html#l00183">updateTargetSensors()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05552.html">classifier.h</a><li><a class="el" href="a05551.html">classifier.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 11:09:43 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> |