Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/15/16 21:10:17 (8 years ago)
Author:
pkimmesw
Message:

#2665 Full Push 3.0 instruction set and tests; Added first benchmark test (count odds) for random walk tests;

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  
    44namespace HeuristicLab.Algorithms.PushGP.Interpreter
    55{
    6     public class Configuration : Generators.Configuration
     6    public class Configuration
    77    {
    88        public Configuration()
     
    1414            this.IsNameStackEnabled = true;
    1515
    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;
    1919
    2020            this.TopLevelPushCode = true;
    21             this.TopLevelPopCode = true;
     21            this.TopLevelPopCode = false;
    2222
    2323            this.RandomSeedMax = 30081;
    2424            this.RandomSeedMin = 0;
    2525            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;
    2632        }
    2733
     
    3238        public bool IsNameStackEnabled { get; set; }
    3339
    34         public IList<OpCode> AllowedInclassions { get; set; }
     40        public IList<string> AllowedInstructions { get; set; }
    3541
    3642        public IList<Expression> PredefinedExpressions { get; set; }
     
    3844        /// <summary>
    3945        /// 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,
     46        /// The execution of a single Push instruction counts as one execution, as does the processing of a single literal,
    4147        /// as does the descent into one layer of parentheses (that is, the processing of the "(" counts as one execution).
    4248        /// When this limit is exceeded the interpreter aborts immediately, leaving its stacks in the states they were in prior
     
    4854        /// <summary>
    4955        /// 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.
     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.
    5258        /// </summary>
    5359        public uint MaxPointsInProgram { get; set; }
    5460
    5561        /// <summary>
    56         /// The maximum number of points in an expression produced by the CODE.RAND inclassion.
     62        /// The maximum number of points in an expression produced by the CODE.RAND instruction.
    5763        /// </summary>
    5864        public uint MaxPointsInRandomExpression { get; set; }
     
    6975        public bool TopLevelPopCode { get; set; }
    7076
     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
    71104        public ushort RandomSeedMax { get; set; }
    72105        public ushort RandomSeedMin { get; set; }
  • branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/IInterpreter.cs

    r14328 r14392  
    33using System.Threading.Tasks;
    44using HeuristicLab.Algorithms.PushGP.Expressions;
     5using HeuristicLab.Algorithms.PushGP.Generators;
    56using HeuristicLab.Algorithms.PushGP.Stack;
    67
     
    1516        IStack<long> IntegerStack { get; }
    1617        IStack<double> FloatStack { get; }
     18        IDictionary<string, Expression> CustomExpressions { get; }
    1719
    18         IDictionary<string, Expression> CustomExpressions { get; }
     20        Configuration Configuration { get; }
     21
     22        CodeGenerator CodeGenerator { get; }
     23
     24        bool IsNameQuoteFlagSet { get; set; }
    1925
    2026        void Interpret(string code);
     
    2228        void Interpret(Expression program);
    2329        Task InterpretAsync(Expression program, bool paused = false, CancellationToken token = default(CancellationToken));
    24         Task AbortAndReset();
     30        Task AbortAndResetAsync();
    2531        Task AbortAsync();
    2632        Task PauseAsync();
Note: See TracChangeset for help on using the changeset viewer.