Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/21/17 11:33:53 (7 years ago)
Author:
pkimmesw
Message:

#2665 Testet Problems, Testet error functions, Small fixes, Created HL files

Location:
branches/PushGP/HeuristicLab.PushGP
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP

    • Property svn:ignore
      •  

        old new  
        11*.user
         2packages
         3TestResults
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Problem/DeterministicTests.cs

    r15289 r15334  
    4444      var currentAverageQuality1 = GetDoubleResult(ga1, "CurrentAverageQuality");
    4545      var currentAverageQuality2 = GetDoubleResult(ga2, "CurrentAverageQuality");
    46       Assert.AreEqual(currentAverageQuality1, currentAverageQuality2, 0.0001);
     46      Assert.AreEqual(currentAverageQuality1, currentAverageQuality2, 0.01);
    4747
    4848      var currentWorstQuality1 = GetDoubleResult(ga1, "CurrentWorstQuality");
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Problem/IndividualMapperTests.cs

    r15289 r15334  
    1111  using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration;
    1212  using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool;
     13  using HeuristicLab.Problems.ProgramSynthesis.Push.Encoding;
     14  using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions;
    1315  using HeuristicLab.Problems.ProgramSynthesis.Push.Individual;
    1416  using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter;
     17  using HeuristicLab.Problems.ProgramSynthesis.Push.Parser;
    1518  using HeuristicLab.Problems.ProgramSynthesis.Push.Stack;
    1619  using HeuristicLab.Random;
     
    5356      var random = new MersenneTwister();
    5457      var config = new PushConfiguration {
    55         ParenthesesCloseBiasLevel = 4
     58        CloseBiasLevel = 4
    5659      };
    5760
     
    7578      Assert.AreEqual(vector.Length, program.TotalExpressionCount);
    7679    }
     80
     81    [TestMethod]
     82    [TestProperty("Time", "Short")]
     83    [TestCategory("Individual")]
     84    public void PlushToPushProgram() {
     85      var plushGenome = new PlushVector();
     86
     87      plushGenome.Add(new PlushEntry { Instruction = new ExecDoTimesExpression(), Close = 0 });
     88      plushGenome.Add(new PlushEntry { Instruction = new IntegerPushExpression(8), Close = 0 });
     89      plushGenome.Add(new PlushEntry { Instruction = new IntegerPushExpression(11), Close = 3 });
     90      plushGenome.Add(new PlushEntry { Instruction = new IntegerAddExpression(), Close = 3, Silent = true });
     91      plushGenome.Add(new PlushEntry { Instruction = new ExecIfExpression(), Close = 1 });
     92      plushGenome.Add(new PlushEntry { Instruction = new IntegerPushExpression(17), Close = 0 });
     93      plushGenome.Add(new PlushEntry { Instruction = new BooleanPushExpression(false), Close = 0 });
     94      plushGenome.Add(new PlushEntry { Instruction = new CodeQuoteExpression(), Close = 0 });
     95      plushGenome.Add(new PlushEntry { Instruction = new FloatMultiplyExpression(), Close = 2 });
     96      plushGenome.Add(new PlushEntry { Instruction = new ExecRotateExpression(), Close = 0 });
     97      plushGenome.Add(new PlushEntry { Instruction = new FloatPushExpression(34.44), Close = 0 });
     98
     99      var expected = PushParser.ParseProgram("( EXEC.DO*TIMES ( 8 11 ) EXEC.IF ( ) ( 17 false CODE.QUOTE ( FLOAT.* ) ) EXEC.ROT ( 34.44 ) ( ) ( ) )");
     100
     101      Assert.AreEqual(expected, plushGenome.PushProgram);
     102    }
    77103  }
    78104}
Note: See TracChangeset for help on using the changeset viewer.