Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13566 for trunk/sources


Ignore:
Timestamp:
01/25/16 17:34:49 (9 years ago)
Author:
abeham
Message:

#2566: improved collection of parameter values in InstrumentedOperator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/InstrumentedOperator.cs

    r12012 r13566  
    6161      Parameters.Add(new FixedValueParameter<OperatorList>(AfterExecutionOperatorsParameterName, "Actions that are executed after the execution of the operator", new OperatorList()));
    6262      BeforeExecutionOperatorsParameter.Hidden = true;
     63      BeforeExecutionOperatorsParameter.GetsCollected = false;
    6364      AfterExecutionOperatorsParameter.Hidden = true;
     65      AfterExecutionOperatorsParameter.GetsCollected = false;
    6466    }
    6567
     
    7779      }
    7880      #endregion
     81    }
     82
     83    protected override IEnumerable<KeyValuePair<string, IItem>> GetCollectedValues(IValueParameter param) {
     84      foreach (var b in base.GetCollectedValues(param)) yield return b;
     85      if (param != BeforeExecutionOperatorsParameter && param != AfterExecutionOperatorsParameter) yield break;
     86      var operatorList = param.Value as OperatorList;
     87      if (operatorList != null) {
     88        var counter = 0;
     89        foreach (var op in operatorList) {
     90          yield return new KeyValuePair<string, IItem>(counter.ToString(), op);
     91          var children = new Dictionary<string, IItem>();
     92          op.CollectParameterValues(children);
     93          foreach (var c in children) yield return new KeyValuePair<string, IItem>(counter + "." + c.Key, c.Value);
     94          counter++;
     95        }
     96      }
    7997    }
    8098
Note: See TracChangeset for help on using the changeset viewer.