1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
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>
|