Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2895_PushGP_GenealogyAnalysis/HeuristicLab.Tests/Interpreter/Expressions/FloatVectorExpressionTests.cs @ 15771

Last change on this file since 15771 was 15771, checked in by bburlacu, 6 years ago

#2895: Add solution skeleton for PushGP with genealogy analysis.

File size: 1.2 KB
Line 
1using System.Collections.Generic;
2using System.Linq;
3using HeuristicLab.Problems.ProgramSynthesis;
4using Microsoft.VisualStudio.TestTools.UnitTesting;
5
6namespace HeuristicLab.Tests.Interpreter.Expressions {
7  [TestClass]
8  public class FloatVectorExpressionTests : VectorExpressionTests<double> {
9    protected override string TypeName { get { return "FLOAT[]"; } }
10
11    protected override IPushStack<IReadOnlyList<double>> Stack { get { return interpreter.FloatVectorStack; } }
12    protected override IPushStack<double> LiteralStack { get { return interpreter.FloatStack; } }
13
14    protected override IReadOnlyList<double>[] GetValues(int count) {
15      return Enumerable
16        .Range(0, count)
17        .Select(x => GetLiterals(interpreter.Configuration.MaxVectorLength / 2 - 1))
18        .ToArray();
19    }
20
21    protected override IReadOnlyList<double> GetLiterals(int count) {
22      return Enumerable
23        .Range(0, count)
24        .Select(x => interpreter.Configuration.ErcOptions.FloatErcOptions.GetErcValue(interpreter.Random))
25        .ToArray();
26    }
27
28    protected override void CheckOtherStacksAreEmpty() {
29      TestStackCounts(floatVectorStack: null);
30    }
31  }
32}
Note: See TracBrowser for help on using the repository browser.