Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9942


Ignore:
Timestamp:
09/10/13 15:21:36 (11 years ago)
Author:
abeham
Message:

#1833: merged into stable branch

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Operators/3.3/CheckedMultiOperator.cs

    r9456 r9942  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
     24using System.Linq;
    2225using HeuristicLab.Common;
    2326using HeuristicLab.Core;
     
    5154      Operators = new CheckedItemList<T>();
    5255    }
     56
     57    public override void CollectParameterValues(IDictionary<string, IItem> values) {
     58      foreach (var param in Parameters.OfType<IValueParameter>().Except(OperatorParameters)) {
     59        var children = GetCollectedValues(param);
     60        foreach (var c in children) {
     61          if (String.IsNullOrEmpty(c.Key))
     62            values.Add(param.Name, c.Value);
     63          else values.Add(param.Name + "." + c.Key, c.Value);
     64        }
     65      }
     66      foreach (var opParam in OperatorParameters) {
     67        var op = opParam.Value;
     68        var @checked = Operators.ItemChecked(op);
     69        if (!@checked) continue;
     70        var children = GetCollectedValues(opParam);
     71        foreach (var c in children) {
     72          if (String.IsNullOrEmpty(c.Key))
     73            values.Add(opParam.Name, c.Value);
     74          else values.Add(opParam.Name + "." + c.Key, c.Value);
     75        }
     76      }
     77    }
    5378  }
    5479}
  • stable/HeuristicLab.Operators/3.3/MultiOperator.cs

    r9456 r9942  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
    2224using HeuristicLab.Collections;
    2325using HeuristicLab.Common;
     
    2527using HeuristicLab.Parameters;
    2628using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using System;
    28 using System.Collections.Generic;
    2929
    3030namespace HeuristicLab.Operators {
     
    3636  public abstract class MultiOperator<T> : SingleSuccessorOperator, IMultiOperator<T> where T : class, IOperator {
    3737    private List<IValueParameter<T>> operatorParameters;
     38    protected IEnumerable<IValueParameter<T>> OperatorParameters { get { return operatorParameters; } }
    3839
    3940    [Storable]
Note: See TracChangeset for help on using the changeset viewer.