Changeset 15189 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Parser/PushParser.cs
- Timestamp:
- 07/10/17 21:36:03 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Parser/PushParser.cs
r15017 r15189 175 175 .Substring(1, word.Length - 2) 176 176 .Split(PushEnvironment.VectorSeparatorSymbol) 177 .To Array();178 179 if (vectorEntries. Length== 0) {177 .ToList(); 178 179 if (vectorEntries.Count == 0) { 180 180 expression = null; 181 181 return false; … … 190 190 191 191 if (e.GetType() == typeof(IntegerPushExpression)) { 192 var integerValues = vectorEntries.Select(long.Parse).To Array();192 var integerValues = vectorEntries.Select(long.Parse).ToList(); 193 193 expression = new IntegerVectorPushExpression(integerValues); 194 194 } else if (e.GetType() == typeof(FloatPushExpression)) { 195 var doubleValues = vectorEntries.Select(x => double.Parse(x, NumberStyles.Float, cultureInfo)).To Array();195 var doubleValues = vectorEntries.Select(x => double.Parse(x, NumberStyles.Float, cultureInfo)).ToList(); 196 196 expression = new FloatVectorPushExpression(doubleValues); 197 197 } else if (e.GetType() == typeof(StringPushExpression)) { 198 var stringValues = vectorEntries.Select(str => str.Substring(1, str.Length - 2)).To Array();198 var stringValues = vectorEntries.Select(str => str.Substring(1, str.Length - 2)).ToList(); 199 199 expression = new StringVectorPushExpression(stringValues); 200 200 } else if (e.GetType() == typeof(BooleanPushExpression)) { 201 var booleanValues = vectorEntries.Select(bool.Parse).To Array();201 var booleanValues = vectorEntries.Select(bool.Parse).ToList(); 202 202 expression = new BooleanVectorPushExpression(booleanValues); 203 203 } else {
Note: See TracChangeset
for help on using the changeset viewer.