Changeset 15017 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/BenchmarkSuite/BenchmarkSuitePushSolutionView.cs
- Timestamp:
- 06/01/17 09:28:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/BenchmarkSuite/BenchmarkSuitePushSolutionView.cs
r14952 r15017 10 10 using HeuristicLab.BenchmarkSuite.Views; 11 11 using HeuristicLab.Common; 12 using HeuristicLab.Problems.ProgramSynthesis.Push.Constants; 12 13 13 14 using Interpreter; … … 237 238 238 239 case ExampleArgumentType.Print: 239 var requiredLines = example.OutputPrint.Split(new[] { Environment.NewLine }, StringSplitOptions.None).Length; 240 var count = Math.Min(requiredLines, interpreter.PrintStack.Count); 241 return string.Join(valueSeparator, string.Join(Environment.NewLine, interpreter.PrintStack.Peek(count))); 240 return string.Join(valueSeparator, string.Join(PushEnvironment.NewLine, interpreter.PrintStack.Take(example.OutputPrintLineCount))); 242 241 243 242 case ExampleArgumentType.String: … … 257 256 } 258 257 259 private static string GetVectorEntryAsString<T>(int offset, IPushStack< List<T>> vectorStack) {258 private static string GetVectorEntryAsString<T>(int offset, IPushStack<IReadOnlyList<T>> vectorStack) { 260 259 return vectorStack.Count > offset 261 260 ? "[" + string.Join(",", vectorStack[offset]) + "]" 262 261 : string.Empty; 263 }264 265 private int GetCount<T>(IPushStack<T> stack, T[] data) {266 return Math.Max(0, Math.Min(data.Length, stack.Count));267 }268 269 private int GetVectorCount<T>(IPushStack<List<T>> stack, T[][] data) {270 return Math.Max(0, Math.Min(data.Length, stack.Count));271 262 } 272 263
Note: See TracChangeset
for help on using the changeset viewer.