GEGELATI
Loading...
Searching...
No Matches
mutationParameters.h
1
38#ifndef MUTATION_PARAMETERS_H
39#define MUTATION_PARAMETERS_H
40
41#include <cstddef>
42#include <cstdint>
43
44namespace Mutator {
48 typedef struct TPGParameters
49 {
50
52 inline static const std::string nbRootsComment =
53 "// Number of root TPGTeams to maintain when populating the "
54 "TPGGraph\n"
55 "// \"nbRoots\" : 100, // Default value";
57 size_t nbRoots = 100;
58
60 inline static const std::string ratioTeamsOverActionsComment =
61 "// Ratio of teams roots over the number of actions roots.\n"
62 "// If set to 1, there will be no action roots, if set to 0, there "
63 "will be no team root.\n"
64 "// \"ratioTeamsOverActions\" : 1.0, // Default value";
69
71 inline static const std::string maxInitOutgoingEdgesComment =
72 "// Maximum number of TPGEdge connected to each TPGTeam of the "
73 "TPGGraph when\n"
74 "// initialized.\n"
75 "// \"maxInitOutgoingEdges\" : 3, // Default value";
79
81 inline static const std::string pChangeActionClassComment =
82 "// Probablity of changing the action edge by any other action "
83 "edge in the graph\n"
84 "// \"pChangeActionClass\" : 0.1, // Default value";
87 double pChangeActionClass = 0.1;
89 inline static const std::string pActionEdgeDeletionComment =
90 "// Probability of deleting an outgoing ActionEdge of a Action.\n"
91 "// \"pActionEdgeDeletion\" : 0.7, // Default value";
93 double pActionEdgeDeletion = 0.7;
94
96 inline static const std::string pActionEdgeAdditionComment =
97 "// Probability of adding an outgoing Action Edge to a Action.\n"
98 "// \"pActionEdgeAddition\" : 0.7, // Default value";
101
103 inline static const std::string pMutateActionProgramComment =
104 "// Probablity of mutation the program on the action edge\n"
105 "// \"pMutateActionProgram\" : 0.1, // Default value";
108
110 inline static const std::string pSwapActionProgramComment =
111 "// Probablity of swapping two action edge within the same action "
112 "vertex\n"
113 "// \"pSwapActionProgram\" : 0.1, // Default value";
116 double pSwapActionProgram = 0.1;
117
119 inline static const std::string nbActionEdgeInitComment =
120 "// Number of edge per action vertex at initialisation\n"
121 "// \"nbActionEdgeInit\" : 1, // Default value";
124
126 inline static const std::string maxOutgoingEdgesComment =
127 "// Maximum number of outgoing edge during TPGGraph mutations.\n"
128 "// \"maxOutgoingEdges\" : 5, // Default value";
131
133 inline static const std::string pEdgeDeletionComment =
134 "// Probability of deleting an outgoing Edge of a Team.\n"
135 "// \"pEdgeDeletion\" : 0.7, // Default value";
137 double pEdgeDeletion = 0.7;
138
140 inline static const std::string pEdgeAdditionComment =
141 "// Probability of adding an outgoing Edge to a Team.\n"
142 "// \"pEdgeAddition\" : 0.7, // Default value";
144 double pEdgeAddition = 0.7;
145
147 inline static const std::string pProgramMutationComment =
148 "// Probability of mutating the Program of an outgoing Edge.\n"
149 "// \"pProgramMutation\" : 0.2, // Default value";
151 double pProgramMutation = 0.2;
152
154 inline static const std::string probaContextOverActionProgramComment =
155 "// When an edge is mutate, the choice between action and context "
156 "program is based on this\n"
157 "// \"probaContextOverActionProgram\" : 0.5, // Default value";
161
163 inline static const std::string
165 "// When a Program is mutated, makes sure its behavior is no "
166 "longer the same.\n"
167 "// \"forceProgramBehaviorChangeOnMutation\" : false, // "
168 "Default value";
174
176 inline static const std::string pEdgeDestinationChangeComment =
177 "// Probability of changing the destination of an Edge.\n"
178 "// \"pEdgeDestinationChange\" : 0.1, // Default value";
181
183 inline static const std::string pEdgeDestinationIsActionComment =
184 "// Probability of the new destination of an Edge to be an "
185 "Action.\n"
186 "// \"pEdgeDestinationIsAction\" : 0.5, // Default value";
189
191 inline static const std::string pCrossAgentsComment =
192 "// Probability of doing a crossover with two MAPLE agents (edge "
193 "crossover by default).\n"
194 "// \"pCrossAgents\" : 0.0, // Default value";
197 double pCrossAgents = 0.0;
198
200 inline static const std::string pCrossProgramsComment =
201 "// When doing a crossover with two MAPLE agents, probability to "
202 "do a program crossover instead of an edge crossover.\n"
203 "// \"pCrossPrograms\" : 0.0, // Default value";
206 double pCrossPrograms = 0.0;
207
209 inline static const std::string useActionProgramComment =
210 "// Create action program, instead of using context program to "
211 "select continuous action(s)"
212 ".\n"
213 "// \"useActionProgram\" : false, // Default value";
216 bool useActionProgram = false;
217
219 inline static const std::string useMultiActionProgramComment =
220 "// Create multiple action program, instead of one outputting "
221 "multiple action in a single program"
222 ".\n"
223 "// \"useMultiActionProgram\" : false, // Default value";
227
229 inline static const std::string teamAccessAllActionsComment =
230 "// During mutation of a team, setting this parameter to true "
231 "allow a team\n"
232 "//to change destination toward any other actions. If set to "
233 "false, it can only\n"
234 "//change destination toward a root action.\n"
235 "// \"teamAccessAllActions\" : true, // Default value";
240
242
246 typedef struct ProgramParameters
247 {
249 inline static const std::string maxProgramSizeComment =
250 "// Maximum number of Line within the Program of the TPG.\n"
251 "// \"maxProgramSize\" : 96, // Default value";
253 size_t maxProgramSize = 96;
254
256 inline static const std::string initMinProgramSizeComment =
257 "// Initial minimum number of Line within the Program of the "
258 "TPGGraph.\n"
259 "// \"initMinProgramSize\" : 1, // Default value";
262
264 inline static const std::string initMaxProgramSizeComment =
265 "// Initial maximum number of Line within the Program of the "
266 "TPGGraph.\n"
267 "// \"initMaxProgramSize\" : 10, // Default value";
270
272 inline static const std::string pDeleteComment =
273 "// Probability of deleting a line of the Program.\n"
274 "// \"pDelete\" : 0.5, // Default value";
276 double pDelete = 0.5;
277
279 inline static const std::string pAddComment =
280 "// Probability of inserting a line in the Program.\n"
281 "// \"pAdd\" : 0.5, // Default value";
283 double pAdd = 0.5;
284
286 inline static const std::string pMutateComment =
287 "// Probability of altering a line of the Program.\n"
288 "// \"pMutate\" : 1.0, // Default value";
290 double pMutate = 1.0;
291
293 inline static const std::string pSwapComment =
294 "// Probability of swapping two lines of the Program.\n"
295 "// \"pSwap\" : 1.0, // Default value";
297 double pSwap = 1.0;
298
300 inline static const std::string pConstantMutationComment =
301 "// Probability of each constant to be mutated.\n"
302 "// \"pConstantMutation\" : 0.5, // Default value";
304 double pConstantMutation = 0.5;
305
307 inline static const std::string pNewProgramComment =
308 "// Probability of creating a new program.\n"
309 "// \"pNewProgram\" : 0.0, // Default value";
311 double pNewProgram = 0.0;
312
314 inline static const std::string minConstValueComment =
315 "// Minimum constant value possible.\n"
316 "// \"minConstValue\" : -1.0, // Default value";
318 double minConstValue = -1.0;
319
321 inline static const std::string maxConstValueComment =
322 "// Maximum constant value possible.\n"
323 "// \"maxConstValue\" : 1.0, // Default value";
325 double maxConstValue = 1.0;
326
328
339} // namespace Mutator
340
341#endif
Definition deterministicRandom.h:44
struct Mutator::ProgramParameters ProgramParameters
Structure holding all parameters affecting mutations of Program.
struct Mutator::TPGParameters TPGParameters
Structure holding all parameters affecting mutations of TPGGraph.
struct Mutator::MutationParameters MutationParameters
Structure holding all parameters affecting stochastic mutations.
Structure holding all parameters affecting stochastic mutations.
Definition mutationParameters.h:333
ProgramParameters prog
Parameters for ProgramMutator.
Definition mutationParameters.h:337
TPGParameters tpg
Parameters for TPGMutator.
Definition mutationParameters.h:335
Structure holding all parameters affecting mutations of Program.
Definition mutationParameters.h:247
double minConstValue
Minimum constant value possible.
Definition mutationParameters.h:318
static const std::string initMinProgramSizeComment
JSon comment.
Definition mutationParameters.h:256
size_t initMaxProgramSize
Initial maximum number of Line within the Program of the TPGGraph.
Definition mutationParameters.h:269
static const std::string pSwapComment
JSon comment.
Definition mutationParameters.h:293
size_t initMinProgramSize
Initial minimum number of Line within the Program of the TPGGraph.
Definition mutationParameters.h:261
size_t maxProgramSize
Maximum number of Line within the Program of the TPGGraph.
Definition mutationParameters.h:253
static const std::string maxProgramSizeComment
JSon comment.
Definition mutationParameters.h:249
static const std::string pDeleteComment
JSon comment.
Definition mutationParameters.h:272
double pDelete
Probability of deleting a line of the Program.
Definition mutationParameters.h:276
static const std::string maxConstValueComment
JSon comment.
Definition mutationParameters.h:321
double pConstantMutation
Probability of each constant to be mutated.
Definition mutationParameters.h:304
double pMutate
Probability of altering a line of the Program.
Definition mutationParameters.h:290
static const std::string initMaxProgramSizeComment
JSon comment.
Definition mutationParameters.h:264
static const std::string pConstantMutationComment
JSon comment.
Definition mutationParameters.h:300
double pSwap
Probability of swapping two lines of the Program.
Definition mutationParameters.h:297
double pNewProgram
Probability of creating a new program.
Definition mutationParameters.h:311
double maxConstValue
Maximum constant value possible.
Definition mutationParameters.h:325
double pAdd
Probability of inserting a line in the Program.
Definition mutationParameters.h:283
static const std::string pMutateComment
JSon comment.
Definition mutationParameters.h:286
static const std::string minConstValueComment
JSon comment.
Definition mutationParameters.h:314
static const std::string pAddComment
JSon comment.
Definition mutationParameters.h:279
static const std::string pNewProgramComment
JSon comment.
Definition mutationParameters.h:307
Structure holding all parameters affecting mutations of TPGGraph.
Definition mutationParameters.h:49
bool useActionProgram
Definition mutationParameters.h:216
double pEdgeDeletion
Probability of deleting an outgoing TPGEdge of a TPGTeam.
Definition mutationParameters.h:137
double pMutateActionProgram
Probablity of mutation the program on the action edge.
Definition mutationParameters.h:107
static const std::string pEdgeDeletionComment
JSon comment.
Definition mutationParameters.h:133
double pEdgeAddition
Probability of adding an outgoing TPGEdge to a TPGTeam.
Definition mutationParameters.h:144
size_t nbActionEdgeInit
Init each team with one edge per action.
Definition mutationParameters.h:123
static const std::string pSwapActionProgramComment
JSon comment.
Definition mutationParameters.h:110
static const std::string pCrossProgramsComment
JSon comment.
Definition mutationParameters.h:200
static const std::string pCrossAgentsComment
JSon comment.
Definition mutationParameters.h:191
double pSwapActionProgram
Definition mutationParameters.h:116
double pCrossPrograms
Definition mutationParameters.h:206
double pCrossAgents
Definition mutationParameters.h:197
static const std::string pActionEdgeDeletionComment
JSon comment.
Definition mutationParameters.h:89
size_t maxInitOutgoingEdges
Definition mutationParameters.h:78
static const std::string ratioTeamsOverActionsComment
JSon comment.
Definition mutationParameters.h:60
size_t nbRoots
Number of root TPGTeams to maintain when populating the TPGGraph.
Definition mutationParameters.h:57
bool useMultiActionProgram
Definition mutationParameters.h:226
static const std::string forceProgramBehaviorChangeOnMutationComment
JSon comment.
Definition mutationParameters.h:164
static const std::string pEdgeAdditionComment
JSon comment.
Definition mutationParameters.h:140
static const std::string pMutateActionProgramComment
JSon comment.
Definition mutationParameters.h:103
static const std::string pEdgeDestinationChangeComment
JSon comment.
Definition mutationParameters.h:176
static const std::string probaContextOverActionProgramComment
JSon comment.
Definition mutationParameters.h:154
static const std::string pProgramMutationComment
JSon comment.
Definition mutationParameters.h:147
static const std::string nbRootsComment
JSon comment.
Definition mutationParameters.h:52
static const std::string pEdgeDestinationIsActionComment
JSon comment.
Definition mutationParameters.h:183
bool forceProgramBehaviorChangeOnMutation
Definition mutationParameters.h:173
double pProgramMutation
Probability of mutating the Program of an outgoing TPGEdge.
Definition mutationParameters.h:151
static const std::string teamAccessAllActionsComment
JSon comment.
Definition mutationParameters.h:229
double pActionEdgeDeletion
Probability of deleting an outgoing TPGEdge of a TPGTeam.
Definition mutationParameters.h:93
bool teamAccessAllActions
Definition mutationParameters.h:239
static const std::string pActionEdgeAdditionComment
JSon comment.
Definition mutationParameters.h:96
static const std::string maxInitOutgoingEdgesComment
JSon comment.
Definition mutationParameters.h:71
double pEdgeDestinationIsAction
Probability of the new destination of a TPGEdge to be a TPGAction.
Definition mutationParameters.h:188
static const std::string maxOutgoingEdgesComment
JSon comment.
Definition mutationParameters.h:126
double pChangeActionClass
Definition mutationParameters.h:87
static const std::string nbActionEdgeInitComment
JSon comment.
Definition mutationParameters.h:119
double pActionEdgeAddition
Probability of adding an outgoing TPGEdge to a TPGTeam.
Definition mutationParameters.h:100
static const std::string useMultiActionProgramComment
JSon comment.
Definition mutationParameters.h:219
static const std::string useActionProgramComment
JSon comment.
Definition mutationParameters.h:209
double ratioTeamsOverActions
Definition mutationParameters.h:68
double pEdgeDestinationChange
Probability of changing the destination of a TPGEdge.
Definition mutationParameters.h:180
static const std::string pChangeActionClassComment
JSon comment.
Definition mutationParameters.h:81
size_t maxOutgoingEdges
Maximum number of outgoing edge during TPGGraph mutations.
Definition mutationParameters.h:130
double probaContextOverActionProgram
Definition mutationParameters.h:160