1 | using System.Collections.Generic;
|
---|
2 | using HeuristicLab.Algorithms.PushGP.Expressions;
|
---|
3 |
|
---|
4 | namespace HeuristicLab.Algorithms.PushGP.Interpreter
|
---|
5 | {
|
---|
6 | public class Configuration
|
---|
7 | {
|
---|
8 | public bool IsBooleanStackEnabled { get; set; } = true;
|
---|
9 | public bool IsIntegerStackEnabled { get; set; } = true;
|
---|
10 | public bool IsFloatStackEnabled { get; set; } = true;
|
---|
11 | public bool IsCodeStackEnabled { get; set; } = true;
|
---|
12 | public bool IsNameStackEnabled { get; set; } = true;
|
---|
13 |
|
---|
14 | public IList<OpCode> AllowedInstructions { get; set; }
|
---|
15 |
|
---|
16 | public IList<Expression> PredefinedExpressions { get; set; }
|
---|
17 |
|
---|
18 | /// <summary>
|
---|
19 | /// The minimum INTEGER that will be produced as an ephemeral random INTEGER constant or from a call to INTEGER.RAND.
|
---|
20 | /// </summary>
|
---|
21 | public long MinRandomInteger { get; set; } = long.MinValue;
|
---|
22 |
|
---|
23 | /// <summary>
|
---|
24 | /// The maximum INTEGER that will be produced as an ephemeral random INTEGER constant or from a call to INTEGER.RAND.
|
---|
25 | /// </summary>
|
---|
26 | public long MaxRandomInteger { get; set; } = long.MaxValue;
|
---|
27 |
|
---|
28 | /// <summary>
|
---|
29 | /// The minimum FLOAT that will be produced as an ephemeral random FLOAT constant or from a call to FLOAT.RAND.
|
---|
30 | /// </summary>
|
---|
31 | public double MinRandomFloag { get; set; } = double.MinValue;
|
---|
32 |
|
---|
33 | /// <summary>
|
---|
34 | /// The maximum FLOAT that will be produced as an ephemeral random FLOAT constant or from a call to FLOAT.RAND.
|
---|
35 | /// </summary>
|
---|
36 | public double MaxRandomFloag { get; set; } = double.MaxValue;
|
---|
37 |
|
---|
38 | /// <summary>
|
---|
39 | /// This is the maximum allowed number of "executions" in a single top-level call to the interpreter.
|
---|
40 | /// The execution of a single Push instruction counts as one execution, as does the processing of a single literal,
|
---|
41 | /// as does the descent into one layer of parentheses (that is, the processing of the "(" counts as one execution).
|
---|
42 | /// When this limit is exceeded the interpreter aborts immediately, leaving its stacks in the states they were in prior
|
---|
43 | /// to the abort (so they may still be examined by a calling program). Whether or not this counts as an "abnormal" termination
|
---|
44 | /// is up to the calling program.
|
---|
45 | /// </summary>
|
---|
46 | public uint EvalPushLimit { get; set; } = uint.MaxValue;
|
---|
47 |
|
---|
48 | /// <summary>
|
---|
49 | /// This is the maximum size of an item on the CODE stack, expressed as a number of points.
|
---|
50 | /// A point is an instruction, a literal, or a pair of parentheses. Any instruction that would cause this limit to be exceeded
|
---|
51 | /// should instead act as a NOOP, leaving all stacks in the states that they were in before the execution of the instruction.
|
---|
52 | /// </summary>
|
---|
53 | public uint MaxPointsInProgram { get; set; } = uint.MaxValue;
|
---|
54 |
|
---|
55 | /// <summary>
|
---|
56 | /// The maximum number of points in an expression produced by the CODE.RAND instruction.
|
---|
57 | /// </summary>
|
---|
58 | public uint MaxPointsInRandomExpression { get; set; } = uint.MaxValue;
|
---|
59 |
|
---|
60 | /// <summary>
|
---|
61 | /// When TRUE (which is the default), code passed to the top level of the interpreter
|
---|
62 | /// will be pushed onto the CODE stack prior to execution.
|
---|
63 | /// </summary>
|
---|
64 | public bool TopLevelPushCode { get; set; } = true;
|
---|
65 |
|
---|
66 | /// <summary>
|
---|
67 | /// When TRUE, the CODE stack will be popped at the end of top level calls to the interpreter. The default is FALSE.
|
---|
68 | /// </summary>
|
---|
69 | public bool TopLevelPopCode { get; set; } = true;
|
---|
70 |
|
---|
71 | /// <summary>
|
---|
72 | /// The probability that the selection of the ephemeral
|
---|
73 | /// random NAME constant for inclusion in randomly generated code will produce a new name
|
---|
74 | /// (rather than a name that was previously generated).
|
---|
75 | /// </summary>
|
---|
76 | public double NewErcNameProbability { get; set; } = 0.5;
|
---|
77 |
|
---|
78 | public ushort RandomSeedMax { get; set; } = 30081;
|
---|
79 | public ushort RandomSeedMin { get; set; } = 0;
|
---|
80 |
|
---|
81 | public ushort? RandomSeed { get; set; } = null;
|
---|
82 | }
|
---|
83 | }
|
---|