Changeset 14392 for branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter
- Timestamp:
- 11/15/16 21:10:17 (8 years ago)
- Location:
- branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter
- Files:
-
- 1 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/Configuration.cs
r14328 r14392 4 4 namespace HeuristicLab.Algorithms.PushGP.Interpreter 5 5 { 6 public class Configuration : Generators.Configuration6 public class Configuration 7 7 { 8 8 public Configuration() … … 14 14 this.IsNameStackEnabled = true; 15 15 16 this.EvalPushLimit = uint.MaxValue;17 this.MaxPointsInProgram = uint.MaxValue;18 this.MaxPointsInRandomExpression = uint.MaxValue;16 this.EvalPushLimit = 1024; 17 this.MaxPointsInProgram = 4096; 18 this.MaxPointsInRandomExpression = 4096; 19 19 20 20 this.TopLevelPushCode = true; 21 this.TopLevelPopCode = true;21 this.TopLevelPopCode = false; 22 22 23 23 this.RandomSeedMax = 30081; 24 24 this.RandomSeedMin = 0; 25 25 this.RandomSeed = null; 26 27 this.MinRandomInteger = -128; 28 this.MaxRandomInteger = 128; 29 this.MinRandomFloat = -128D; 30 this.MaxRandomFloat = 128D; 31 this.NewErcNameProbability = 0.5; 26 32 } 27 33 … … 32 38 public bool IsNameStackEnabled { get; set; } 33 39 34 public IList< OpCode> AllowedInclassions { get; set; }40 public IList<string> AllowedInstructions { get; set; } 35 41 36 42 public IList<Expression> PredefinedExpressions { get; set; } … … 38 44 /// <summary> 39 45 /// This is the maximum allowed number of "executions" in a single top-level call to the interpreter. 40 /// The execution of a single Push in classion counts as one execution, as does the processing of a single literal,46 /// The execution of a single Push instruction counts as one execution, as does the processing of a single literal, 41 47 /// as does the descent into one layer of parentheses (that is, the processing of the "(" counts as one execution). 42 48 /// When this limit is exceeded the interpreter aborts immediately, leaving its stacks in the states they were in prior … … 48 54 /// <summary> 49 55 /// This is the maximum size of an item on the CODE stack, expressed as a number of points. 50 /// A point is an in classion, a literal, or a pair of parentheses. Any inclassion that would cause this limit to be exceeded51 /// should instead act as a NOOP, leaving all stacks in the states that they were in before the execution of the in classion.56 /// A point is an instruction, a literal, or a pair of parentheses. Any instruction that would cause this limit to be exceeded 57 /// should instead act as a NOOP, leaving all stacks in the states that they were in before the execution of the instruction. 52 58 /// </summary> 53 59 public uint MaxPointsInProgram { get; set; } 54 60 55 61 /// <summary> 56 /// The maximum number of points in an expression produced by the CODE.RAND in classion.62 /// The maximum number of points in an expression produced by the CODE.RAND instruction. 57 63 /// </summary> 58 64 public uint MaxPointsInRandomExpression { get; set; } … … 69 75 public bool TopLevelPopCode { get; set; } 70 76 77 /// <summary> 78 /// The minimum INTEGER that will be produced as an ephemeral random INTEGER constant or from a call to INTEGER.RAND. 79 /// </summary> 80 public int MinRandomInteger { get; set; } 81 82 /// <summary> 83 /// The maximum INTEGER that will be produced as an ephemeral random INTEGER constant or from a call to INTEGER.RAND. 84 /// </summary> 85 public int MaxRandomInteger { get; set; } 86 87 /// <summary> 88 /// The minimum FLOAT that will be produced as an ephemeral random FLOAT constant or from a call to FLOAT.RAND. 89 /// </summary> 90 public double MinRandomFloat { get; set; } 91 92 /// <summary> 93 /// The maximum FLOAT that will be produced as an ephemeral random FLOAT constant or from a call to FLOAT.RAND. 94 /// </summary> 95 public double MaxRandomFloat { get; set; } 96 97 /// <summary> 98 /// The probability that the selection of the ephemeral 99 /// random NAME constant for inclusion in randomly generated code will produce a new name 100 /// (rather than a name that was previously generated). 101 /// </summary> 102 public double NewErcNameProbability { get; set; } 103 71 104 public ushort RandomSeedMax { get; set; } 72 105 public ushort RandomSeedMin { get; set; } -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/IInterpreter.cs
r14328 r14392 3 3 using System.Threading.Tasks; 4 4 using HeuristicLab.Algorithms.PushGP.Expressions; 5 using HeuristicLab.Algorithms.PushGP.Generators; 5 6 using HeuristicLab.Algorithms.PushGP.Stack; 6 7 … … 15 16 IStack<long> IntegerStack { get; } 16 17 IStack<double> FloatStack { get; } 18 IDictionary<string, Expression> CustomExpressions { get; } 17 19 18 IDictionary<string, Expression> CustomExpressions { get; } 20 Configuration Configuration { get; } 21 22 CodeGenerator CodeGenerator { get; } 23 24 bool IsNameQuoteFlagSet { get; set; } 19 25 20 26 void Interpret(string code); … … 22 28 void Interpret(Expression program); 23 29 Task InterpretAsync(Expression program, bool paused = false, CancellationToken token = default(CancellationToken)); 24 Task AbortAndReset ();30 Task AbortAndResetAsync(); 25 31 Task AbortAsync(); 26 32 Task PauseAsync();
Note: See TracChangeset
for help on using the changeset viewer.