Changeset 14875 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Views/PushProgramDebuggerView.cs
- Timestamp:
- 04/18/17 01:15:25 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Views/PushProgramDebuggerView.cs
r14834 r14875 68 68 (IntegerVector)Content.IntegerVector.Clone(), 69 69 Content.Quality, 70 ( Data)Content.Data.Clone(),70 (ProblemData)Content.Data.Clone(), 71 71 (IRandom)Content.Random.Clone(), 72 72 Content.Config, … … 85 85 86 86 UpdateExecList(); 87 UpdateValueLists();87 this.UpdateDebugLists(); 88 88 CheckIfButtonsCanBeEnabled(); 89 89 } … … 120 120 121 121 UpdateExecList(); 122 UpdateValueLists();122 this.UpdateDebugLists(); 123 123 CheckIfButtonsCanBeEnabled(); 124 124 } … … 180 180 181 181 interpreter.BooleanStack.Push(example.InputBoolean); 182 interpreter.IntegerStack.Push(example.InputInt );182 interpreter.IntegerStack.Push(example.InputInteger); 183 183 interpreter.FloatStack.Push(example.InputFloat); 184 184 185 185 interpreter2.BooleanStack.Push(example.InputBoolean); 186 interpreter2.IntegerStack.Push(example.InputInt );186 interpreter2.IntegerStack.Push(example.InputInteger); 187 187 interpreter2.FloatStack.Push(example.InputFloat); 188 188 … … 192 192 stepWidthBox.Maximum = interpreter.ExecStack.Count; 193 193 194 UpdateValueLists();194 this.UpdateDebugLists(); 195 195 UpdateExecList(); 196 196 CheckIfButtonsCanBeEnabled(); … … 227 227 InitDebugLists(Content.Config); 228 228 InitResultGrid(); 229 ClearLists();229 this.ClearDebugLists(); 230 230 UpdateExecList(); 231 UpdateValueLists();231 this.UpdateDebugLists(); 232 232 } 233 233 … … 320 320 switch (type) { 321 321 case ExampleArgumentType.Integer: 322 case ExampleArgumentType.Integer Collection: return interpreter.IntegerStack.IsEmpty ? EmptySign : string.Join(valueSeparator, interpreter.IntegerStack.Peek(GetCount(interpreter.IntegerStack, example.OutputInt)));322 case ExampleArgumentType.IntegerVector: return interpreter.IntegerStack.IsEmpty ? EmptySign : string.Join(valueSeparator, interpreter.IntegerStack.Peek(GetCount(interpreter.IntegerStack, example.OutputInteger))); 323 323 324 324 case ExampleArgumentType.Float: 325 case ExampleArgumentType.Float Collection: return interpreter.FloatStack.IsEmpty ? EmptySign : string.Join(valueSeparator, interpreter.FloatStack.Peek(GetCount(interpreter.FloatStack, example.OutputFloat)).Select(d => d.ToString(CultureInfo.CurrentUICulture)));326 327 case ExampleArgumentType.Bool : return interpreter.BooleanStack.IsEmpty ? EmptySign : interpreter.BooleanStack.Top.ToString();325 case ExampleArgumentType.FloatVector: return interpreter.FloatStack.IsEmpty ? EmptySign : string.Join(valueSeparator, interpreter.FloatStack.Peek(GetCount(interpreter.FloatStack, example.OutputFloat)).Select(d => d.ToString(CultureInfo.CurrentUICulture))); 326 327 case ExampleArgumentType.Boolean: return interpreter.BooleanStack.IsEmpty ? EmptySign : interpreter.BooleanStack.Top.ToString(); 328 328 case ExampleArgumentType.Char: return interpreter.CharStack.IsEmpty ? EmptySign : interpreter.CharStack.Top.ToString(); 329 329 330 330 case ExampleArgumentType.String: 331 case ExampleArgumentType.String Collection: return interpreter.StringStack.IsEmpty ? EmptySign : string.Join(valueSeparator, interpreter.StringStack.Peek(GetCount(interpreter.StringStack, example.OutputString)));331 case ExampleArgumentType.StringVector: return interpreter.StringStack.IsEmpty ? EmptySign : string.Join(valueSeparator, interpreter.StringStack.Peek(GetCount(interpreter.StringStack, example.OutputString))); 332 332 default: return string.Empty; 333 333 } … … 338 338 } 339 339 340 private void Clear Lists() {340 private void ClearDebugLists() { 341 341 foreach (var list in debugControlDict.Values) { 342 342 list.Items.Clear(); … … 346 346 private void UpdateExecList() { 347 347 execList.Items.Clear(); 348 var expressions = interpreter.ExecStack 348 var expressions = interpreter.ExecStack.AsEnumerable() 349 349 .Reverse() 350 350 .Select(e => e.StringRepresentation) … … 367 367 if (stackType != StackTypes.Exec && 368 368 ExpressionTable.GetExpressionsByStackTypes(stackType).Intersect(config.EnabledExpressions).Any()) { 369 var list = GetDebugList(stackType);369 var list = this.CreateDebugList(stackType); 370 370 debugControlDict.Add(stackType, list); 371 371 } … … 373 373 } 374 374 375 private ListBox GetDebugList(StackTypes type) {375 private ListBox CreateDebugList(StackTypes type) { 376 376 var groupBox = new GroupBox { 377 377 Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top, … … 421 421 422 422 423 private void Update ValueLists() {424 ClearLists();423 private void UpdateDebugLists() { 424 this.ClearDebugLists(); 425 425 426 426 if (Content == null || interpreter == null) … … 436 436 } 437 437 438 private void UpdateExamples( Data data) {438 private void UpdateExamples(ProblemData data) { 439 439 exampleComboBox.Items.Clear(); 440 440 if (data == null) return;
Note: See TracChangeset
for help on using the changeset viewer.