1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include "attribute.h"
22 #include "cond_node.h"
23 #include "result_node.h"
31 CBrain
brain(10,10,10,10,10);
34 CBoolField
viande("Viande");
35 CBoolField
grand("Grand");
36 CBoolField
bon("Bon");
37 std::vector
<std::string
> vals_couleur
;
38 vals_couleur
.push_back(std::string("Vert"));
39 vals_couleur
.push_back(std::string("Rouge"));
40 CStringField
couleur(std::string("Couleur"), vals_couleur
);
42 brain
.addField(&viande
);
43 brain
.addField(&grand
);
45 brain
.addField( (CField
*) &couleur
);
48 brain
.addTree( &tree
);
50 CValue
<bool> val1(true);
51 CValue
<bool> val2(false);
52 CValue
<std::string
> val3("Vert");
53 CValue
<std::string
> val4("Rouge");
54 CValue
<std::string
> val5("Orange");
100 r8
.addValue( &val1
);
101 r8
.addValue( &val1
);
102 r8
.addValue( &val3
);
105 r9
.addValue( &val1
);
106 r9
.addValue( &val1
);
107 r9
.addValue( &val1
);
108 r9
.addValue( &val3
);
111 r10
.addValue( &val2
);
112 r10
.addValue( &val1
);
113 r10
.addValue( &val2
);
114 r10
.addValue( &val4
);
125 brain
.setInput(&r10
);
128 std::cout
<< brain
.getDebugString();
136 std::string
age_old("old");
137 std::string
age_mid("mid");
138 std::string
age_new("new");
140 std::vector
<std::string
> vals_age
;
141 vals_age
.push_back( age_old
);
142 vals_age
.push_back( age_mid
);
143 vals_age
.push_back( age_new
);
144 CStringField
age(std::string("AGE"), vals_age
);
146 CValue
<bool> val_true(true);
147 CValue
<bool> val_false(false);
150 CBoolField
competition(std::string("Competition"));
152 std::string
type_swr("swr");
153 std::string
type_hwr("hwr");
155 std::vector
<std::string
> vals_type
;
156 vals_type
.push_back( type_swr
);
157 vals_type
.push_back( type_hwr
);
158 CStringField
type(std::string("TYPE"), vals_type
);
160 CBoolField
profit("Profit");
162 CBrain
brain(10,10,10,10,10);
165 brain
.addField( &age
);
166 brain
.addField( &competition
);
167 brain
.addField( &type
);
168 brain
.addField( &profit
);
171 brain
.addTree( &tree
);
174 r1
.addValue( age_old
);
175 r1
.addValue( &val_true
);
176 r1
.addValue( type_swr
);
177 r1
.addValue( &val_false
);
178 brain
.addRecord( &r1
);
181 r2
.addValue( age_old
);
182 r2
.addValue( &val_false
);
183 r2
.addValue( type_swr
);
184 r2
.addValue( &val_false
);
185 brain
.addRecord( &r2
);
188 r3
.addValue( age_old
);
189 r3
.addValue( &val_false
);
190 r3
.addValue( type_hwr
);
191 r3
.addValue( &val_false
);
192 brain
.addRecord( &r3
);
195 r4
.addValue( age_mid
);
196 r4
.addValue( &val_true
);
197 r4
.addValue( type_swr
);
198 r4
.addValue( &val_false
);
199 brain
.addRecord( &r4
);
202 r5
.addValue( age_mid
);
203 r5
.addValue( &val_true
);
204 r5
.addValue( type_hwr
);
205 r5
.addValue( &val_false
);
206 brain
.addRecord( &r5
);
209 r6
.addValue( age_mid
);
210 r6
.addValue( &val_false
);
211 r6
.addValue( type_hwr
);
212 r6
.addValue( &val_true
);
213 brain
.addRecord( &r6
);
216 r7
.addValue( age_mid
);
217 r7
.addValue( &val_false
);
218 r7
.addValue( type_swr
);
219 r7
.addValue( &val_true
);
220 brain
.addRecord( &r7
);
223 r8
.addValue( age_new
);
224 r8
.addValue( &val_true
);
225 r8
.addValue( type_swr
);
226 r8
.addValue( &val_true
);
227 brain
.addRecord( &r8
);
230 r9
.addValue( age_new
);
231 r9
.addValue( &val_false
);
232 r9
.addValue( type_hwr
);
233 r9
.addValue( &val_true
);
234 brain
.addRecord( &r9
);
237 r10
.addValue( age_new
);
238 r10
.addValue( &val_false
);
239 r10
.addValue( type_swr
);
240 r10
.addValue( &val_true
);
241 brain
.addRecord( &r10
);
244 brain
.setInput( &r5
);
247 int main(int, char *[])