Last change
on this file since 17432 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 StringVectorExpressionTests : VectorExpressionTests<string> {
|
---|
9 | protected override string TypeName { get { return "STRING[]"; } }
|
---|
10 |
|
---|
11 | protected override IPushStack<IReadOnlyList<string>> Stack { get { return interpreter.StringVectorStack; } }
|
---|
12 | protected override IPushStack<string> LiteralStack { get { return interpreter.StringStack; } }
|
---|
13 |
|
---|
14 | protected override IReadOnlyList<string>[] 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<string> GetLiterals(int count) {
|
---|
22 | return Enumerable
|
---|
23 | .Range(0, count)
|
---|
24 | .Select(x => interpreter.Configuration.ErcOptions.StringErcOptions.GetErcValue(interpreter.Random))
|
---|
25 | .ToArray();
|
---|
26 | }
|
---|
27 |
|
---|
28 | protected override void CheckOtherStacksAreEmpty() {
|
---|
29 | TestStackCounts(stringVectorStack: null);
|
---|
30 | }
|
---|
31 | }
|
---|
32 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.