Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10115


Ignore:
Timestamp:
11/08/13 10:10:07 (11 years ago)
Author:
ascheibe
Message:

#1886 some improvements in the RunCollectionModifierExecutable

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching.Views/3.3/HeuristicLab.Analysis.SolutionCaching.Views-3.3.csproj

    r10113 r10115  
    178178  </ItemGroup>
    179179  <ItemGroup>
    180     <EmbeddedResource Include="RunCollectionModifierTasksConfigurator.resx">
    181       <DependentUpon>RunCollectionModifierTasksConfigurator.cs</DependentUpon>
    182     </EmbeddedResource>
    183180    <EmbeddedResource Include="SolutionCacheView.resx">
    184181      <DependentUpon>SolutionCacheView.cs</DependentUpon>
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching.Views/3.3/RunCollectionModifierTasksConfigurator.Designer.cs

    r10113 r10115  
    3232      //
    3333      this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    34       this.okButton.Location = new System.Drawing.Point(502, 325);
     34      this.okButton.Location = new System.Drawing.Point(707, 437);
    3535      this.okButton.Name = "okButton";
    3636      this.okButton.Size = new System.Drawing.Size(75, 23);
     
    4343      //
    4444      this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    45       this.cancelButton.Location = new System.Drawing.Point(583, 325);
     45      this.cancelButton.Location = new System.Drawing.Point(788, 437);
    4646      this.cancelButton.Name = "cancelButton";
    4747      this.cancelButton.Size = new System.Drawing.Size(75, 23);
     
    6262      this.viewHost.Name = "viewHost";
    6363      this.viewHost.ReadOnly = false;
    64       this.viewHost.Size = new System.Drawing.Size(646, 307);
     64      this.viewHost.Size = new System.Drawing.Size(851, 419);
    6565      this.viewHost.TabIndex = 2;
    6666      this.viewHost.ViewsLabelVisible = true;
     
    7171      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    7272      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    73       this.ClientSize = new System.Drawing.Size(670, 360);
     73      this.ClientSize = new System.Drawing.Size(875, 472);
    7474      this.Controls.Add(this.viewHost);
    7575      this.Controls.Add(this.cancelButton);
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching.Views/3.3/RunCollectionModifierTasksConfigurator.cs

    r10114 r10115  
    5555
    5656    private void RunCollectionModifierTasksConfigurator_Load(object sender, EventArgs e) {
     57      runCollectionModifierExecutable.RunCollection.AddRange(Content.Runs);
    5758      viewHost.Content = runCollectionModifierExecutable;
    5859    }
    5960
    6061    private void CreateTask() {
    61       runCollectionModifierExecutable.RunCollection.AddRange(Content.Runs);
     62      runCollectionModifierExecutable.Prepare();
    6263      MainFormManager.MainForm.ShowContent(runCollectionModifierExecutable);
    6364    }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3/RunCollectionModifiers/RunCollectionModifierExecutable.cs

    r10114 r10115  
    6262      get { return (ValueParameter<ItemList<IRunCollectionModifier>>)Parameters["RunCollectionModifiers"]; }
    6363    }
     64    public RunCollection RunCollection {
     65      get { return RunCollectionParameter.Value; }
     66      protected set { RunCollectionParameter.Value = value; }
     67    }
     68    public ValueParameter<RunCollection> RunCollectionParameter {
     69      get { return (ValueParameter<RunCollection>)Parameters["RunCollection"]; }
     70    }
    6471    public ItemList<IRunCollectionModifier> RunCollectionModifiers {
    6572      get { return RunCollectionModifiersParameter.Value; }
    66     }
    67 
    68     [Storable]
    69     protected RunCollection runCollection;
    70     public RunCollection RunCollection {
    71       get { return runCollection; }
    7273    }
    7374
     
    9091    public RunCollectionModifierExecutable() {
    9192      Parameters.Add(new ValueParameter<ItemList<IRunCollectionModifier>>("RunCollectionModifiers", "List of RunCollectionModifiers that are executed. ", new ItemList<IRunCollectionModifier>()));
     93      Parameters.Add(new ValueParameter<RunCollection>("RunCollection", "RunCollection on which the modifiers are applied. ", new RunCollection()));
    9294      executionStack = new Stack<IRunCollectionModifier>();
    93       runCollection = new RunCollection();
    9495      log = new Log();
    9596    }
     
    100101      executionTime = original.executionTime;
    101102      executionState = original.executionState;
    102       runCollection = (RunCollection)original.runCollection.Clone(cloner);
    103103      executionStack = new Stack<IRunCollectionModifier>();
    104104      foreach (var runCollectionModifier in original.executionStack) {
     
    165165      CancellationToken ct = (CancellationToken)state;
    166166      OnStarted();
     167      var runs = RunCollection.ToList();
    167168
    168169      IRunCollectionModifier next;
     
    171172        try {
    172173          ct.ThrowIfCancellationRequested();
    173           next.Modify(runCollection.ToList());
     174          next.Modify(runs);
    174175        }
    175176        catch (Exception ex) {
     
    177178          if (ex is OperationCanceledException) throw ex;
    178179          else throw new Exception("IRunCollectionModifier " + next + "threw an exception.", ex);
     180        }
     181        finally {
     182          RunCollection = new RunCollection(runs);
    179183        }
    180184      }
Note: See TracChangeset for help on using the changeset viewer.