Last change
on this file since 16003 was
15771,
checked in by bburlacu, 7 years ago
|
#2895: Add solution skeleton for PushGP with genealogy analysis.
|
File size:
1.2 KB
|
Line | |
---|
1 | using System.Collections.Generic;
|
---|
2 | using System.Linq;
|
---|
3 | using HeuristicLab.Problems.ProgramSynthesis;
|
---|
4 | using Microsoft.VisualStudio.TestTools.UnitTesting;
|
---|
5 |
|
---|
6 | namespace 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.