Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/10/17 21:36:03 (7 years ago)
Author:
pkimmesw
Message:

#2665 Fixed small issues, testet benchmark suite, added INX Expressions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Parser/PushParser.cs

    r15017 r15189  
    175175          .Substring(1, word.Length - 2)
    176176          .Split(PushEnvironment.VectorSeparatorSymbol)
    177           .ToArray();
    178 
    179         if (vectorEntries.Length == 0) {
     177          .ToList();
     178
     179        if (vectorEntries.Count == 0) {
    180180          expression = null;
    181181          return false;
     
    190190
    191191        if (e.GetType() == typeof(IntegerPushExpression)) {
    192           var integerValues = vectorEntries.Select(long.Parse).ToArray();
     192          var integerValues = vectorEntries.Select(long.Parse).ToList();
    193193          expression = new IntegerVectorPushExpression(integerValues);
    194194        } else if (e.GetType() == typeof(FloatPushExpression)) {
    195           var doubleValues = vectorEntries.Select(x => double.Parse(x, NumberStyles.Float, cultureInfo)).ToArray();
     195          var doubleValues = vectorEntries.Select(x => double.Parse(x, NumberStyles.Float, cultureInfo)).ToList();
    196196          expression = new FloatVectorPushExpression(doubleValues);
    197197        } else if (e.GetType() == typeof(StringPushExpression)) {
    198           var stringValues = vectorEntries.Select(str => str.Substring(1, str.Length - 2)).ToArray();
     198          var stringValues = vectorEntries.Select(str => str.Substring(1, str.Length - 2)).ToList();
    199199          expression = new StringVectorPushExpression(stringValues);
    200200        } else if (e.GetType() == typeof(BooleanPushExpression)) {
    201           var booleanValues = vectorEntries.Select(bool.Parse).ToArray();
     201          var booleanValues = vectorEntries.Select(bool.Parse).ToList();
    202202          expression = new BooleanVectorPushExpression(booleanValues);
    203203        } else {
Note: See TracChangeset for help on using the changeset viewer.