Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/17 01:15:25 (7 years ago)
Author:
pkimmesw
Message:

#2665 BenchmarkSuite, all examples, partially tested, VectorExpressions added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Views/PushProgramDebuggerView.cs

    r14834 r14875  
    6868                         (IntegerVector)Content.IntegerVector.Clone(),
    6969                         Content.Quality,
    70                          (Data)Content.Data.Clone(),
     70                         (ProblemData)Content.Data.Clone(),
    7171                         (IRandom)Content.Random.Clone(),
    7272                         Content.Config,
     
    8585
    8686      UpdateExecList();
    87       UpdateValueLists();
     87      this.UpdateDebugLists();
    8888      CheckIfButtonsCanBeEnabled();
    8989    }
     
    120120
    121121      UpdateExecList();
    122       UpdateValueLists();
     122      this.UpdateDebugLists();
    123123      CheckIfButtonsCanBeEnabled();
    124124    }
     
    180180
    181181      interpreter.BooleanStack.Push(example.InputBoolean);
    182       interpreter.IntegerStack.Push(example.InputInt);
     182      interpreter.IntegerStack.Push(example.InputInteger);
    183183      interpreter.FloatStack.Push(example.InputFloat);
    184184
    185185      interpreter2.BooleanStack.Push(example.InputBoolean);
    186       interpreter2.IntegerStack.Push(example.InputInt);
     186      interpreter2.IntegerStack.Push(example.InputInteger);
    187187      interpreter2.FloatStack.Push(example.InputFloat);
    188188
     
    192192      stepWidthBox.Maximum = interpreter.ExecStack.Count;
    193193
    194       UpdateValueLists();
     194      this.UpdateDebugLists();
    195195      UpdateExecList();
    196196      CheckIfButtonsCanBeEnabled();
     
    227227      InitDebugLists(Content.Config);
    228228      InitResultGrid();
    229       ClearLists();
     229      this.ClearDebugLists();
    230230      UpdateExecList();
    231       UpdateValueLists();
     231      this.UpdateDebugLists();
    232232    }
    233233
     
    320320      switch (type) {
    321321        case ExampleArgumentType.Integer:
    322         case ExampleArgumentType.IntegerCollection: 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)));
    323323
    324324        case ExampleArgumentType.Float:
    325         case ExampleArgumentType.FloatCollection: 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();
    328328        case ExampleArgumentType.Char: return interpreter.CharStack.IsEmpty ? EmptySign : interpreter.CharStack.Top.ToString();
    329329
    330330        case ExampleArgumentType.String:
    331         case ExampleArgumentType.StringCollection: 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)));
    332332        default: return string.Empty;
    333333      }
     
    338338    }
    339339
    340     private void ClearLists() {
     340    private void ClearDebugLists() {
    341341      foreach (var list in debugControlDict.Values) {
    342342        list.Items.Clear();
     
    346346    private void UpdateExecList() {
    347347      execList.Items.Clear();
    348       var expressions = interpreter.ExecStack
     348      var expressions = interpreter.ExecStack.AsEnumerable()
    349349        .Reverse()
    350350        .Select(e => e.StringRepresentation)
     
    367367        if (stackType != StackTypes.Exec &&
    368368            ExpressionTable.GetExpressionsByStackTypes(stackType).Intersect(config.EnabledExpressions).Any()) {
    369           var list = GetDebugList(stackType);
     369          var list = this.CreateDebugList(stackType);
    370370          debugControlDict.Add(stackType, list);
    371371        }
     
    373373    }
    374374
    375     private ListBox GetDebugList(StackTypes type) {
     375    private ListBox CreateDebugList(StackTypes type) {
    376376      var groupBox = new GroupBox {
    377377        Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top,
     
    421421
    422422
    423     private void UpdateValueLists() {
    424       ClearLists();
     423    private void UpdateDebugLists() {
     424      this.ClearDebugLists();
    425425
    426426      if (Content == null || interpreter == null)
     
    436436    }
    437437
    438     private void UpdateExamples(Data data) {
     438    private void UpdateExamples(ProblemData data) {
    439439      exampleComboBox.Items.Clear();
    440440      if (data == null) return;
Note: See TracChangeset for help on using the changeset viewer.