Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/17 01:31:10 (8 years ago)
Author:
pkimmesw
Message:

#2665 Fixed VectorExpression errors, Fixed BenchmarkSuite Problem Data View issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Views/ViewHelper.cs

    r14898 r14909  
    11namespace HeuristicLab.BenchmarkSuite.Views {
     2  using System.Linq;
     3
    24  public static class ViewHelper {
    35    public static string StringifyInput(ExampleArgumentType type, Example example, string valueSeparator) {
    46      switch (type) {
    57        case ExampleArgumentType.Integer: return string.Join(valueSeparator, example.InputInteger);
    6         //case ExampleArgumentType.IntegerVector: return string.Join(valueSeparator, example.InputInteger);
     8        case ExampleArgumentType.IntegerVector: return "[" + string.Join("], [", example.InputIntegerVector.Select(vector => string.Join(valueSeparator, vector))) + "]";
    79
    810        case ExampleArgumentType.Float: return string.Join(valueSeparator, example.InputFloat);
    9         //case ExampleArgumentType.FloatVector: return string.Join(valueSeparator, example.InputFloat);
     11        case ExampleArgumentType.FloatVector: return "[" + string.Join("], [", example.InputFloatVector.Select(vector => string.Join(valueSeparator, vector))) + "]";
    1012
    1113        case ExampleArgumentType.Boolean: return string.Join(valueSeparator, example.InputBoolean);
     
    1315
    1416        case ExampleArgumentType.String: return string.Join(valueSeparator, example.InputString);
    15         //case ExampleArgumentType.StringVector: return string.Join(valueSeparator, example.InputString);
     17        case ExampleArgumentType.StringVector: return "[" + string.Join("], [", example.InputStringVector.Select(vector => string.Join(valueSeparator, vector))) + "]";
    1618        default: return string.Empty;
    1719      }
     
    2123      switch (type) {
    2224        case ExampleArgumentType.Integer: return string.Join(valueSeparator, example.OutputInteger);
    23         //case ExampleArgumentType.IntegerVector: return string.Join(valueSeparator, example.OutputIntegerVector);
     25        case ExampleArgumentType.IntegerVector: return "[" + string.Join("], [", example.OutputIntegerVector.Select(vector => string.Join(valueSeparator, vector))) + "]";
    2426
    2527        case ExampleArgumentType.Float: return string.Join(valueSeparator, example.OutputFloat);
    26         //case ExampleArgumentType.FloatVector: return string.Join(valueSeparator, example.OutputFloat);
     28        case ExampleArgumentType.FloatVector: return "[" + string.Join("], [", example.OutputFloatVector.Select(vector => string.Join(valueSeparator, vector))) + "]";
    2729
    2830        case ExampleArgumentType.Boolean: return string.Join(valueSeparator, example.OutputBoolean);
     
    3032
    3133        case ExampleArgumentType.String: return string.Join(valueSeparator, example.OutputString);
    32         //case ExampleArgumentType.StringVector: return string.Join(valueSeparator, example.OutputString);
     34        case ExampleArgumentType.Print: return string.Join(valueSeparator, example.OutputPrint);
     35        case ExampleArgumentType.StringVector: return "[" + string.Join("], [", example.OutputStringVector.Select(vector => string.Join(valueSeparator, vector))) + "]";
     36
    3337        default: return string.Empty;
    3438      }
     
    4246    private const string CharColumnHeader = "char";
    4347    private const string StringColumnHeader = "string";
     48    private const string PrintColumnHeader = "print";
    4449    private const string StringsColumnHeader = "string[]";
    4550    public static string GetHeaderTypeName(ExampleArgumentType type) {
     
    5055        case ExampleArgumentType.Char: return CharColumnHeader;
    5156        case ExampleArgumentType.String: return StringColumnHeader;
     57        case ExampleArgumentType.Print: return PrintColumnHeader;
    5258        case ExampleArgumentType.IntegerVector: return IntegersColumnHeader;
    5359        case ExampleArgumentType.FloatVector: return DoublesColumnHeader;
Note: See TracChangeset for help on using the changeset viewer.