Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/10/17 00:27:31 (7 years ago)
Author:
pkimmesw
Message:

#2665 LexicaseSelector, Performance improvements, UI Fixes, Debugger only shows used stacks, fixed Debugger stepping, Added vector expressions, ERCOptions,

Location:
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Benchmark/ProblemTests.cs

    r14777 r14834  
    1111  using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions;
    1212  using HeuristicLab.Problems.ProgramSynthesis.Push.Generators;
     13  using HeuristicLab.Problems.ProgramSynthesis.Push.Generators.CodeGenerator;
    1314  using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter;
    1415  using HeuristicLab.Problems.ProgramSynthesis.Push.Stack;
     
    218219    }
    219220
    220     private static double GetDiff<T>(IReadOnlyList<T> estimated, IStack<T> resultStack)
     221    private static double GetDiff<T>(IReadOnlyList<T> estimated, IPushStack<T> resultStack)
    221222      where T : IComparable {
    222223      var count = Math.Min(estimated.Count, resultStack.Count);
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/BooleanExpressionTests.cs

    r14727 r14834  
    1515    }
    1616
    17     protected override IStack<bool> Stack
     17    protected override IPushStack<bool> Stack
    1818    {
    1919      get
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CodeExpressionTests.cs

    r14733 r14834  
    1616    }
    1717
    18     protected override IStack<Expression> Stack
     18    protected override IPushStack<Expression> Stack
    1919    {
    2020      get
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CommonTests.cs

    r14727 r14834  
    1010    protected abstract string TypeName { get; }
    1111
    12     protected abstract IStack<T> Stack { get; }
     12    protected abstract IPushStack<T> Stack { get; }
    1313
    1414    protected abstract T[] GetValues(int count);
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExecExpressionTests.cs

    r14733 r14834  
    1616    }
    1717
    18     protected override IStack<Expression> Stack
     18    protected override IPushStack<Expression> Stack
    1919    {
    2020      get
     
    2525
    2626    protected override void Test(Expression expression) {
    27       this.interpreter.RunAsync(expression, true).Wait();
     27      this.interpreter.Run(expression, true);
     28      this.interpreter.Step();
    2829    }
    2930
     
    6162      var third = PushParser.Parse("C");
    6263
    63       this.interpreter.ExecStack.Push(third, second, first);
    64       this.Test(new ExecKExpression());
     64      interpreter.ExecStack.Push(third, second, first);
     65      Test(new ExecKExpression());
    6566
    66       Assert.AreEqual(first, this.interpreter.ExecStack.Top);
    67       Assert.AreEqual(third, this.interpreter.ExecStack.Bottom);
    68       this.TestStackCounts(2);
     67      Assert.AreEqual(first, interpreter.ExecStack.Top);
     68      Assert.AreEqual(third, interpreter.ExecStack.Bottom);
     69      TestStackCounts(2);
    6970    }
    7071
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/FloatExpressionTests.cs

    r14727 r14834  
    2121    }
    2222
    23     protected override IStack<double> Stack
     23    protected override IPushStack<double> Stack
    2424    {
    2525      get
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/IntegerExpressionTests.cs

    r14727 r14834  
    1717    }
    1818
    19     protected override IStack<long> Stack
     19    protected override IPushStack<long> Stack
    2020    {
    2121      get
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/NameExpressionTests.cs

    r14727 r14834  
    1 namespace HeuristicLab.Tests.Interpreter.Expressions
    2 {
     1namespace HeuristicLab.Tests.Interpreter.Expressions {
    32  using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions;
    43  using HeuristicLab.Problems.ProgramSynthesis.Push.Generators;
     
    87
    98  [TestClass]
    10   public class NameExpressionTests : CommonTests<string>
    11   {
     9  public class NameExpressionTests : CommonTests<string> {
    1210    protected override string TypeName
    1311    {
     
    1816    }
    1917
    20     protected override IStack<string> Stack
     18    protected override IPushStack<string> Stack
    2119    {
    2220      get
     
    3028    [TestCategory("ExpressionTest")]
    3129    [TestCategory("NameExpressionTest")]
    32     public void TestRand()
    33     {
     30    public void TestRand() {
     31      this.interpreter.Configuration.ErcOptions.NameErcOptions.IsEnabled = true;
    3432      this.interpreter.Run(new NameRandExpression());
    3533
     
    4341    [TestCategory("ExpressionTest")]
    4442    [TestCategory("NameExpressionTest")]
    45     public void TestRandomBound()
    46     {
     43    public void TestRandomBound() {
    4744      this.interpreter.CustomExpressions.Add("c1", new CodeNoopExpression());
    4845      this.interpreter.CustomExpressions.Add("c2", new CodeNoopExpression());
     
    6057    [TestCategory("ExpressionTest")]
    6158    [TestCategory("NameExpressionTest")]
    62     public void TestRandomBoundWithInsufficientArguments()
    63     {
     59    public void TestRandomBoundWithInsufficientArguments() {
    6460      this.TestWithInsufficientArguments("RANDBOUNDNAME");
    6561    }
     
    6965    [TestCategory("ExpressionTest")]
    7066    [TestCategory("NameExpressionTest")]
    71     public void TestQuote()
    72     {
     67    public void TestQuote() {
    7368      this.interpreter.Run(new NameQuoteExpression());
    7469
     
    7873    }
    7974
    80     protected override string[] GetValues(int count)
    81     {
    82       var ng = new NameGenerator();
     75    protected override string[] GetValues(int count) {
     76      var ng = new StringGenerator();
    8377      var values = new string[count];
    8478
     
    8882    }
    8983
    90     protected override void CheckOtherStacksAreEmpty()
    91     {
     84    protected override void CheckOtherStacksAreEmpty() {
    9285      this.TestStackCounts(nameStack: null);
    9386    }
Note: See TracChangeset for help on using the changeset viewer.