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
44 namespace 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";
68 double ratioTeamsOverActions = 1.0;
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";
78 size_t maxInitOutgoingEdges = 3;
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";
100 double pActionEdgeAddition = 0.7;
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";
107 double pMutateActionProgram = 0.1;
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";
123 size_t nbActionEdgeInit = 1;
124
126 inline static const std::string maxOutgoingEdgesComment =
127 "// Maximum number of outgoing edge during TPGGraph mutations.\n"
128 "// \"maxOutgoingEdges\" : 5, // Default value";
130 size_t maxOutgoingEdges = 5;
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";
160 double probaContextOverActionProgram = 0.5;
161
163 inline static const std::string
164 forceProgramBehaviorChangeOnMutationComment =
165 "// When a Program is mutated, makes sure its behavior is no "
166 "longer the same.\n"
167 "// \"forceProgramBehaviorChangeOnMutation\" : false, // "
168 "Default value";
173 bool forceProgramBehaviorChangeOnMutation = false;
174
176 inline static const std::string pEdgeDestinationChangeComment =
177 "// Probability of changing the destination of an Edge.\n"
178 "// \"pEdgeDestinationChange\" : 0.1, // Default value";
180 double pEdgeDestinationChange = 0.1;
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";
188 double pEdgeDestinationIsAction = 0.5;
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";
226 bool useMultiActionProgram = false;
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";
239 bool teamAccessAllActions = true;
240
241 } TPGParameters;
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";
261 size_t initMinProgramSize = 1;
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";
269 size_t initMaxProgramSize = 10;
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
327 } ProgramParameters;
328
332 typedef struct MutationParameters
333 {
335 TPGParameters tpg;
337 ProgramParameters prog;
338 } MutationParameters;
339} // namespace Mutator
340
341#endif
Mutator
Definition deterministicRandom.h:44
Mutator::ProgramParameters
struct Mutator::ProgramParameters ProgramParameters
Structure holding all parameters affecting mutations of Program.
Mutator::TPGParameters
struct Mutator::TPGParameters TPGParameters
Structure holding all parameters affecting mutations of TPGGraph.
Mutator::MutationParameters
struct Mutator::MutationParameters MutationParameters
Structure holding all parameters affecting stochastic mutations.
Mutator::MutationParameters
Structure holding all parameters affecting stochastic mutations.
Definition mutationParameters.h:333
Mutator::MutationParameters::prog
ProgramParameters prog
Parameters for ProgramMutator.
Definition mutationParameters.h:337
Mutator::MutationParameters::tpg
TPGParameters tpg
Parameters for TPGMutator.
Definition mutationParameters.h:335
Mutator::ProgramParameters
Structure holding all parameters affecting mutations of Program.
Definition mutationParameters.h:247
Mutator::ProgramParameters::minConstValue
double minConstValue
Minimum constant value possible.
Definition mutationParameters.h:318
Mutator::ProgramParameters::initMinProgramSizeComment
static const std::string initMinProgramSizeComment
JSon comment.
Definition mutationParameters.h:256
Mutator::ProgramParameters::initMaxProgramSize
size_t initMaxProgramSize
Initial maximum number of Line within the Program of the TPGGraph.
Definition mutationParameters.h:269
Mutator::ProgramParameters::pSwapComment
static const std::string pSwapComment
JSon comment.
Definition mutationParameters.h:293
Mutator::ProgramParameters::initMinProgramSize
size_t initMinProgramSize
Initial minimum number of Line within the Program of the TPGGraph.
Definition mutationParameters.h:261
Mutator::ProgramParameters::maxProgramSize
size_t maxProgramSize
Maximum number of Line within the Program of the TPGGraph.
Definition mutationParameters.h:253
Mutator::ProgramParameters::maxProgramSizeComment
static const std::string maxProgramSizeComment
JSon comment.
Definition mutationParameters.h:249
Mutator::ProgramParameters::pDeleteComment
static const std::string pDeleteComment
JSon comment.
Definition mutationParameters.h:272
Mutator::ProgramParameters::pDelete
double pDelete
Probability of deleting a line of the Program.
Definition mutationParameters.h:276
Mutator::ProgramParameters::maxConstValueComment
static const std::string maxConstValueComment
JSon comment.
Definition mutationParameters.h:321
Mutator::ProgramParameters::pConstantMutation
double pConstantMutation
Probability of each constant to be mutated.
Definition mutationParameters.h:304
Mutator::ProgramParameters::pMutate
double pMutate
Probability of altering a line of the Program.
Definition mutationParameters.h:290
Mutator::ProgramParameters::initMaxProgramSizeComment
static const std::string initMaxProgramSizeComment
JSon comment.
Definition mutationParameters.h:264
Mutator::ProgramParameters::pConstantMutationComment
static const std::string pConstantMutationComment
JSon comment.
Definition mutationParameters.h:300
Mutator::ProgramParameters::pSwap
double pSwap
Probability of swapping two lines of the Program.
Definition mutationParameters.h:297
Mutator::ProgramParameters::pNewProgram
double pNewProgram
Probability of creating a new program.
Definition mutationParameters.h:311
Mutator::ProgramParameters::maxConstValue
double maxConstValue
Maximum constant value possible.
Definition mutationParameters.h:325
Mutator::ProgramParameters::pAdd
double pAdd
Probability of inserting a line in the Program.
Definition mutationParameters.h:283
Mutator::ProgramParameters::pMutateComment
static const std::string pMutateComment
JSon comment.
Definition mutationParameters.h:286
Mutator::ProgramParameters::minConstValueComment
static const std::string minConstValueComment
JSon comment.
Definition mutationParameters.h:314
Mutator::ProgramParameters::pAddComment
static const std::string pAddComment
JSon comment.
Definition mutationParameters.h:279
Mutator::ProgramParameters::pNewProgramComment
static const std::string pNewProgramComment
JSon comment.
Definition mutationParameters.h:307
Mutator::TPGParameters
Structure holding all parameters affecting mutations of TPGGraph.
Definition mutationParameters.h:49
Mutator::TPGParameters::useActionProgram
bool useActionProgram
Definition mutationParameters.h:216
Mutator::TPGParameters::pEdgeDeletion
double pEdgeDeletion
Probability of deleting an outgoing TPGEdge of a TPGTeam.
Definition mutationParameters.h:137
Mutator::TPGParameters::pMutateActionProgram
double pMutateActionProgram
Probablity of mutation the program on the action edge.
Definition mutationParameters.h:107
Mutator::TPGParameters::pEdgeDeletionComment
static const std::string pEdgeDeletionComment
JSon comment.
Definition mutationParameters.h:133
Mutator::TPGParameters::pEdgeAddition
double pEdgeAddition
Probability of adding an outgoing TPGEdge to a TPGTeam.
Definition mutationParameters.h:144
Mutator::TPGParameters::nbActionEdgeInit
size_t nbActionEdgeInit
Init each team with one edge per action.
Definition mutationParameters.h:123
Mutator::TPGParameters::pSwapActionProgramComment
static const std::string pSwapActionProgramComment
JSon comment.
Definition mutationParameters.h:110
Mutator::TPGParameters::pCrossProgramsComment
static const std::string pCrossProgramsComment
JSon comment.
Definition mutationParameters.h:200
Mutator::TPGParameters::pCrossAgentsComment
static const std::string pCrossAgentsComment
JSon comment.
Definition mutationParameters.h:191
Mutator::TPGParameters::pSwapActionProgram
double pSwapActionProgram
Definition mutationParameters.h:116
Mutator::TPGParameters::pCrossPrograms
double pCrossPrograms
Definition mutationParameters.h:206
Mutator::TPGParameters::pCrossAgents
double pCrossAgents
Definition mutationParameters.h:197
Mutator::TPGParameters::pActionEdgeDeletionComment
static const std::string pActionEdgeDeletionComment
JSon comment.
Definition mutationParameters.h:89
Mutator::TPGParameters::maxInitOutgoingEdges
size_t maxInitOutgoingEdges
Definition mutationParameters.h:78
Mutator::TPGParameters::ratioTeamsOverActionsComment
static const std::string ratioTeamsOverActionsComment
JSon comment.
Definition mutationParameters.h:60
Mutator::TPGParameters::nbRoots
size_t nbRoots
Number of root TPGTeams to maintain when populating the TPGGraph.
Definition mutationParameters.h:57
Mutator::TPGParameters::useMultiActionProgram
bool useMultiActionProgram
Definition mutationParameters.h:226
Mutator::TPGParameters::forceProgramBehaviorChangeOnMutationComment
static const std::string forceProgramBehaviorChangeOnMutationComment
JSon comment.
Definition mutationParameters.h:164
Mutator::TPGParameters::pEdgeAdditionComment
static const std::string pEdgeAdditionComment
JSon comment.
Definition mutationParameters.h:140
Mutator::TPGParameters::pMutateActionProgramComment
static const std::string pMutateActionProgramComment
JSon comment.
Definition mutationParameters.h:103
Mutator::TPGParameters::pEdgeDestinationChangeComment
static const std::string pEdgeDestinationChangeComment
JSon comment.
Definition mutationParameters.h:176
Mutator::TPGParameters::probaContextOverActionProgramComment
static const std::string probaContextOverActionProgramComment
JSon comment.
Definition mutationParameters.h:154
Mutator::TPGParameters::pProgramMutationComment
static const std::string pProgramMutationComment
JSon comment.
Definition mutationParameters.h:147
Mutator::TPGParameters::nbRootsComment
static const std::string nbRootsComment
JSon comment.
Definition mutationParameters.h:52
Mutator::TPGParameters::pEdgeDestinationIsActionComment
static const std::string pEdgeDestinationIsActionComment
JSon comment.
Definition mutationParameters.h:183
Mutator::TPGParameters::forceProgramBehaviorChangeOnMutation
bool forceProgramBehaviorChangeOnMutation
Definition mutationParameters.h:173
Mutator::TPGParameters::pProgramMutation
double pProgramMutation
Probability of mutating the Program of an outgoing TPGEdge.
Definition mutationParameters.h:151
Mutator::TPGParameters::teamAccessAllActionsComment
static const std::string teamAccessAllActionsComment
JSon comment.
Definition mutationParameters.h:229
Mutator::TPGParameters::pActionEdgeDeletion
double pActionEdgeDeletion
Probability of deleting an outgoing TPGEdge of a TPGTeam.
Definition mutationParameters.h:93
Mutator::TPGParameters::teamAccessAllActions
bool teamAccessAllActions
Definition mutationParameters.h:239
Mutator::TPGParameters::pActionEdgeAdditionComment
static const std::string pActionEdgeAdditionComment
JSon comment.
Definition mutationParameters.h:96
Mutator::TPGParameters::maxInitOutgoingEdgesComment
static const std::string maxInitOutgoingEdgesComment
JSon comment.
Definition mutationParameters.h:71
Mutator::TPGParameters::pEdgeDestinationIsAction
double pEdgeDestinationIsAction
Probability of the new destination of a TPGEdge to be a TPGAction.
Definition mutationParameters.h:188
Mutator::TPGParameters::maxOutgoingEdgesComment
static const std::string maxOutgoingEdgesComment
JSon comment.
Definition mutationParameters.h:126
Mutator::TPGParameters::pChangeActionClass
double pChangeActionClass
Definition mutationParameters.h:87
Mutator::TPGParameters::nbActionEdgeInitComment
static const std::string nbActionEdgeInitComment
JSon comment.
Definition mutationParameters.h:119
Mutator::TPGParameters::pActionEdgeAddition
double pActionEdgeAddition
Probability of adding an outgoing TPGEdge to a TPGTeam.
Definition mutationParameters.h:100
Mutator::TPGParameters::useMultiActionProgramComment
static const std::string useMultiActionProgramComment
JSon comment.
Definition mutationParameters.h:219
Mutator::TPGParameters::useActionProgramComment
static const std::string useActionProgramComment
JSon comment.
Definition mutationParameters.h:209
Mutator::TPGParameters::ratioTeamsOverActions
double ratioTeamsOverActions
Definition mutationParameters.h:68
Mutator::TPGParameters::pEdgeDestinationChange
double pEdgeDestinationChange
Probability of changing the destination of a TPGEdge.
Definition mutationParameters.h:180
Mutator::TPGParameters::pChangeActionClassComment
static const std::string pChangeActionClassComment
JSon comment.
Definition mutationParameters.h:81
Mutator::TPGParameters::maxOutgoingEdges
size_t maxOutgoingEdges
Maximum number of outgoing edge during TPGGraph mutations.
Definition mutationParameters.h:130
Mutator::TPGParameters::probaContextOverActionProgram
double probaContextOverActionProgram
Definition mutationParameters.h:160