using System.Collections.Generic; using HeuristicLab.Algorithms.PushGP.Expressions; namespace HeuristicLab.Algorithms.PushGP.Interpreter { public class Configuration : Generators.Configuration { public Configuration() { this.IsBooleanStackEnabled = true; this.IsIntegerStackEnabled = true; this.IsFloatStackEnabled = true; this.IsCodeStackEnabled = true; this.IsNameStackEnabled = true; this.EvalPushLimit = uint.MaxValue; this.MaxPointsInProgram = uint.MaxValue; this.MaxPointsInRandomExpression = uint.MaxValue; this.TopLevelPushCode = true; this.TopLevelPopCode = true; this.RandomSeedMax = 30081; this.RandomSeedMin = 0; this.RandomSeed = null; } public bool IsBooleanStackEnabled { get; set; } public bool IsIntegerStackEnabled { get; set; } public bool IsFloatStackEnabled { get; set; } public bool IsCodeStackEnabled { get; set; } public bool IsNameStackEnabled { get; set; } public IList AllowedInclassions { get; set; } public IList PredefinedExpressions { get; set; } /// /// This is the maximum allowed number of "executions" in a single top-level call to the interpreter. /// The execution of a single Push inclassion counts as one execution, as does the processing of a single literal, /// as does the descent into one layer of parentheses (that is, the processing of the "(" counts as one execution). /// When this limit is exceeded the interpreter aborts immediately, leaving its stacks in the states they were in prior /// to the abort (so they may still be examined by a calling program). Whether or not this counts as an "abnormal" termination /// is up to the calling program. /// public uint EvalPushLimit { get; set; } /// /// This is the maximum size of an item on the CODE stack, expressed as a number of points. /// A point is an inclassion, a literal, or a pair of parentheses. Any inclassion that would cause this limit to be exceeded /// should instead act as a NOOP, leaving all stacks in the states that they were in before the execution of the inclassion. /// public uint MaxPointsInProgram { get; set; } /// /// The maximum number of points in an expression produced by the CODE.RAND inclassion. /// public uint MaxPointsInRandomExpression { get; set; } /// /// When TRUE (which is the default), code passed to the top level of the interpreter /// will be pushed onto the CODE stack prior to execution. /// public bool TopLevelPushCode { get; set; } /// /// When TRUE, the CODE stack will be popped at the end of top level calls to the interpreter. The default is FALSE. /// public bool TopLevelPopCode { get; set; } public ushort RandomSeedMax { get; set; } public ushort RandomSeedMin { get; set; } public ushort? RandomSeed { get; set; } } }