Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/28/10 04:11:23 (14 years ago)
Author:
swagner
Message:

Implemented first version of algorithm batch processing (#947).

Location:
trunk/sources/HeuristicLab.Optimization.Operators/3.3
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Operators/3.3/HeuristicLab.Optimization.Operators-3.3.csproj

    r3094 r3226  
    8282  <ItemGroup>
    8383    <Compile Include="ProbabilisticQualityComparator.cs" />
     84    <Compile Include="ResultsCollector.cs" />
    8485    <Compile Include="SquareRootDiscreteDoubleValueModifier.cs" />
    8586    <Compile Include="DiscreteDoubleValueModifier.cs" />
  • trunk/sources/HeuristicLab.Optimization.Operators/3.3/ResultsCollector.cs

    r3225 r3226  
    2121
    2222using HeuristicLab.Core;
     23using HeuristicLab.Operators;
    2324using HeuristicLab.Parameters;
    2425using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2526
    26 namespace HeuristicLab.Operators {
     27namespace HeuristicLab.Optimization.Operators {
    2728  /// <summary>
    28   /// An operator which collects the actual values of parameters and adds them to a collection of variables.
     29  /// An operator which collects the actual values of parameters and adds them to a collection of results.
    2930  /// </summary>
    30   [Item("ResultsCollector", "An operator which collects the actual values of parameters and adds them to a collection of variables.")]
     31  [Item("ResultsCollector", "An operator which collects the actual values of parameters and adds them to a collection of results.")]
    3132  [StorableClass]
    3233  public class ResultsCollector : ValuesCollector {
    33     public ValueLookupParameter<VariableCollection> ResultsParameter {
    34       get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
     34    public ValueLookupParameter<ResultCollection> ResultsParameter {
     35      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    3536    }
    3637
    3738    public ResultsCollector()
    3839      : base() {
    39       Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where the collected values should be stored."));
     40      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the collected values should be stored."));
    4041    }
    4142
    4243    public override IOperation Apply() {
    43       VariableCollection results = ResultsParameter.ActualValue;
    44       IVariable var;
     44      ResultCollection results = ResultsParameter.ActualValue;
     45      IResult result;
    4546      foreach (IParameter param in CollectedValues) {
    4647        IItem value = param.ActualValue;
    4748        if (value != null) {
    48           results.TryGetValue(param.Name, out var);
    49           if (var != null)
    50             var.Value = value;
     49          results.TryGetValue(param.Name, out result);
     50          if (result != null)
     51            result.Value = value;
    5152          else
    52             results.Add(new Variable(param.Name, param.Description, value));
     53            results.Add(new Result(param.Name, param.Description, value));
    5354        }
    5455      }
Note: See TracChangeset for help on using the changeset viewer.