Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/01/14 10:53:46 (10 years ago)
Author:
mkommend
Message:

#2206: Updated data preprocessing branch with trunk changes.

Location:
branches/DataPreprocessing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing

  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Trading/3.4/ProblemData.cs

    r11009 r11064  
    16531653
    16541654    public override void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
    1655       throw new NotImplementedException("TODO");
     1655      var data = problemData as ProblemData;
     1656      if (data == null) throw new ArgumentException("The problem data is not a problem data set for trading. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     1657
     1658      string errorMessage;
     1659      if (!data.IsProblemDataCompatible(this, out errorMessage)) {
     1660        throw new InvalidOperationException(errorMessage);
     1661      }
     1662
     1663      base.AdjustProblemDataProperties(data);
     1664
     1665      var toDelete = PriceChangeVariableParameter.ValidValues.ToList();
     1666      foreach (var entry in data.PriceChangeVariableParameter.ValidValues) {
     1667        if (toDelete.Any(x => x.Value == entry.Value)) {
     1668          toDelete.RemoveAll(x => x.Value == entry.Value);
     1669        } else {
     1670          PriceChangeVariableParameter.ValidValues.Add(new StringValue(entry.Value));
     1671        }
     1672      }
     1673      PriceChangeVariableParameter.Value =
     1674        PriceChangeVariableParameter.ValidValues.Single(v => v.Value == data.PriceChangeVariable);
     1675
     1676      foreach (var varToDelete in toDelete) PriceChangeVariableParameter.ValidValues.Remove(varToDelete);
     1677
     1678      TransactionCostsParameter.Value.Value = data.TransactionCosts;
     1679
     1680      OnChanged();
    16561681    }
    16571682  }
Note: See TracChangeset for help on using the changeset viewer.