Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/08/10 04:36:13 (13 years ago)
Author:
mkommend
Message:

sorting of column names in RunCollection and fixed errors in RunCollectionConstraints (ticket #970)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs

    r3716 r3717  
    147147
    148148    public IItem GetValue(IRun run, int columnIndex) {
     149      string name = ((IStringConvertibleMatrix)this).ColumnNames.ElementAt(columnIndex);
     150      return GetValue(run, name);
     151    }
     152
     153    public IItem GetValue(IRun run, string columnName) {
    149154      IItem value = null;
    150       if (columnIndex < parameterNames.Count) {
    151         string parameterName = parameterNames[columnIndex];
    152         if (run.Parameters.ContainsKey(parameterName))
    153           value = run.Parameters[parameterName];
    154       } else if (columnIndex < parameterNames.Count + resultNames.Count) {
    155         string resultName = resultNames[columnIndex - parameterNames.Count];
    156         if (run.Results.ContainsKey(resultName))
    157           value = run.Results[resultName];
    158       }
     155       if (run.Parameters.ContainsKey(columnName))
     156         value = run.Parameters[columnName];
     157       else if (run.Results.ContainsKey(columnName))
     158         value = run.Results[columnName];
    159159      return value;
    160160    }
     161
    161162
    162163    public override IDeepCloneable Clone(Cloner cloner) {
     
    193194        List<string> value = new List<string>(parameterNames);
    194195        value.AddRange(resultNames);
     196        value.Sort();
    195197        return value;
    196198      }
Note: See TracChangeset for help on using the changeset viewer.