Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/Configuration.cs @ 14328

Last change on this file since 14328 was 14328, checked in by pkimmesw, 8 years ago

#2665 Set .NET version to 4.5, C# version to 5.0, Added expression templates and factory

File size: 3.3 KB
Line 
1using System.Collections.Generic;
2using HeuristicLab.Algorithms.PushGP.Expressions;
3
4namespace HeuristicLab.Algorithms.PushGP.Interpreter
5{
6    public class Configuration : Generators.Configuration
7    {
8        public Configuration()
9        {
10            this.IsBooleanStackEnabled = true;
11            this.IsIntegerStackEnabled = true;
12            this.IsFloatStackEnabled = true;
13            this.IsCodeStackEnabled = true;
14            this.IsNameStackEnabled = true;
15
16            this.EvalPushLimit = uint.MaxValue;
17            this.MaxPointsInProgram = uint.MaxValue;
18            this.MaxPointsInRandomExpression = uint.MaxValue;
19
20            this.TopLevelPushCode = true;
21            this.TopLevelPopCode = true;
22
23            this.RandomSeedMax = 30081;
24            this.RandomSeedMin = 0;
25            this.RandomSeed = null;
26        }
27
28        public bool IsBooleanStackEnabled { get; set; }
29        public bool IsIntegerStackEnabled { get; set; }
30        public bool IsFloatStackEnabled { get; set; }
31        public bool IsCodeStackEnabled { get; set; }
32        public bool IsNameStackEnabled { get; set; }
33
34        public IList<OpCode> AllowedInclassions { get; set; }
35
36        public IList<Expression> PredefinedExpressions { get; set; }
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 inclassion 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; }
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 inclassion, a literal, or a pair of parentheses. Any inclassion 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 inclassion.
52        /// </summary>
53        public uint MaxPointsInProgram { get; set; }
54
55        /// <summary>
56        /// The maximum number of points in an expression produced by the CODE.RAND inclassion.
57        /// </summary>
58        public uint MaxPointsInRandomExpression { get; set; }
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; }
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; }
70
71        public ushort RandomSeedMax { get; set; }
72        public ushort RandomSeedMin { get; set; }
73
74        public ushort? RandomSeed { get; set; }
75    }
76}
Note: See TracBrowser for help on using the repository browser.