Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/11 16:38:28 (13 years ago)
Author:
ascheibe
Message:

#1233 more renaming for more consistency

Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/Tasks
Files:
1 added
3 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs

    r6717 r6725  
    77namespace HeuristicLab.Clients.Hive {
    88  [StorableClass]
    9   public class EngineJob : ItemJob {
     9  public class EngineTask : ItemTask {
    1010    [Storable]
    1111    protected IOperation initialOperation;
     
    2929
    3030    #region constructors and cloning
    31     public EngineJob() { }
    32     public EngineJob(IOperation initialOperation, IEngine engine) {
     31    public EngineTask() { }
     32    public EngineTask(IOperation initialOperation, IEngine engine) {
    3333      this.initialOperation = initialOperation;
    3434      this.Item = engine;
     
    3636
    3737    [StorableConstructor]
    38     protected EngineJob(bool deserializing) : base(deserializing) { }
    39     protected EngineJob(EngineJob original, Cloner cloner)
     38    protected EngineTask(bool deserializing) : base(deserializing) { }
     39    protected EngineTask(EngineTask original, Cloner cloner)
    4040      : base(original, cloner) {
    4141      this.initialOperation = cloner.Clone(original.initialOperation);
    4242    }
    4343    public override IDeepCloneable Clone(Cloner cloner) {
    44       return new EngineJob(this, cloner);
     44      return new EngineTask(this, cloner);
    4545    }
    4646    #endregion
     
    5656      Item.Start();
    5757    }
    58    
     58
    5959    public override void Pause() {
    6060      Item.Pause();
     
    8686
    8787    private void engine_ExceptionOccurred(object sender, EventArgs<Exception> e) {
    88       OnJobFailed(e);
     88      OnTaskFailed(e);
    8989    }
    9090
    9191    private void engine_Stopped(object sender, EventArgs e) {
    92       OnJobStopped();
     92      OnTaskStopped();
    9393    }
    9494
    9595    private void Item_Paused(object sender, EventArgs e) {
    96       OnJobPaused();
     96      OnTaskPaused();
    9797    }
    9898
     
    106106
    107107    private void Item_Started(object sender, EventArgs e) {
    108       OnJobStarted();
     108      OnTaskStarted();
    109109    }
    110110
     
    134134      get { return HeuristicLab.Common.Resources.VSImageLibrary.Operator; }
    135135    }
    136    
     136
    137137    public override string ItemName {
    138       get { return "EngineJob"; }
     138      get { return "EngineTask"; }
    139139    }
    140140
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/Tasks/ItemTask.cs

    r6721 r6725  
    2828
    2929namespace HeuristicLab.Clients.Hive {
    30   [Item("Item Task", "Represents a executable hive job which contains a HeuristicLab Item.")]
     30  [Item("Item Task", "Represents a executable hive task which contains a HeuristicLab Item.")]
    3131  [StorableClass]
    32   public abstract class ItemJob : NamedItem, IJob {
     32  public abstract class ItemTask : NamedItem, ITask {
    3333    public virtual bool IsParallelizable {
    3434      get { return true; }
     
    6262
    6363    #region Constructors and Cloning
    64     public ItemJob() { }
     64    public ItemTask() { }
    6565
    6666    [StorableConstructor]
    67     protected ItemJob(bool deserializing) { }
    68     protected ItemJob(ItemJob original, Cloner cloner)
     67    protected ItemTask(bool deserializing) { }
     68    protected ItemTask(ItemTask original, Cloner cloner)
    6969      : base(original, cloner) {
    7070      this.ComputeInParallel = original.ComputeInParallel;
     
    9898    #endregion
    9999
    100     #region IJob Members
     100    #region ITask Members
    101101
    102102    public abstract ExecutionState ExecutionState { get; }
     
    112112    public abstract void Stop();
    113113
    114     public event EventHandler JobStarted;
    115     protected virtual void OnJobStarted() {
    116       EventHandler handler = JobStarted;
    117       if (handler != null) handler(this, EventArgs.Empty);
    118     }
    119 
    120     public event EventHandler JobStopped;
    121     protected virtual void OnJobStopped() {
    122       EventHandler handler = JobStopped;
    123       if (handler != null) handler(this, EventArgs.Empty);
    124     }
    125 
    126     public event EventHandler JobPaused;
    127     protected virtual void OnJobPaused() {
    128       EventHandler handler = JobPaused;
    129       if (handler != null) handler(this, EventArgs.Empty);
    130     }
    131 
    132     public event EventHandler JobFailed;
    133     protected virtual void OnJobFailed(EventArgs<Exception> e) {
    134       EventHandler handler = JobFailed;
     114    public event EventHandler TaskStarted;
     115    protected virtual void OnTaskStarted() {
     116      EventHandler handler = TaskStarted;
     117      if (handler != null) handler(this, EventArgs.Empty);
     118    }
     119
     120    public event EventHandler TaskStopped;
     121    protected virtual void OnTaskStopped() {
     122      EventHandler handler = TaskStopped;
     123      if (handler != null) handler(this, EventArgs.Empty);
     124    }
     125
     126    public event EventHandler TaskPaused;
     127    protected virtual void OnTaskPaused() {
     128      EventHandler handler = TaskPaused;
     129      if (handler != null) handler(this, EventArgs.Empty);
     130    }
     131
     132    public event EventHandler TaskFailed;
     133    protected virtual void OnTaskFailed(EventArgs<Exception> e) {
     134      EventHandler handler = TaskFailed;
    135135      if (handler != null) handler(this, e);
    136136    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs

    r6721 r6725  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
    26 using HeuristicLab.Hive;
    2725using HeuristicLab.Optimization;
    2826using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3129  [Item("Optimizer Task", "Represents Task which executes a IOptimizer object.")]
    3230  [StorableClass]
    33   public class OptimizerJob : ItemJob {
     31  public class OptimizerTask : ItemTask {
    3432    public override bool IsParallelizable {
    3533      get { return this.Item is Experiment || this.Item is BatchRun; }
     
    4846    }
    4947
    50     public OptimizerJob() : base() { }
    51     public OptimizerJob(IOptimizer optimizer)
     48    public OptimizerTask() : base() { }
     49    public OptimizerTask(IOptimizer optimizer)
    5250      : this() {
    5351      this.Item = optimizer;
     
    6260    }
    6361    [StorableConstructor]
    64     protected OptimizerJob(bool deserializing) { }
    65     protected OptimizerJob(OptimizerJob original, Cloner cloner)
     62    protected OptimizerTask(bool deserializing) { }
     63    protected OptimizerTask(OptimizerTask original, Cloner cloner)
    6664      : base(original, cloner) {
    6765      this.IndexInParentOptimizerList = original.IndexInParentOptimizerList;
    6866    }
    6967    public override IDeepCloneable Clone(Cloner cloner) {
    70       return new OptimizerJob(this, cloner);
     68      return new OptimizerTask(this, cloner);
    7169    }
    7270
     
    8583    }
    8684
    87     #region IJob Members
     85    #region ITask Members
    8886    public override ExecutionState ExecutionState {
    8987      get { return Item.ExecutionState; }
     
    10199      if ((Item is Experiment && OptimizerAsExperiment.Optimizers.Count == 0) || // experiment would not fire OnStopped if it has 0 optimizers
    102100          (Item is BatchRun && OptimizerAsBatchRun.Optimizer == null)) { // batchrun would not fire OnStopped if algorithm == null
    103         OnJobStopped();
     101        OnTaskStopped();
    104102      } else {
    105103        Item.Start();
     
    156154
    157155    protected virtual void optimizer_ExceptionOccurred(object sender, EventArgs<Exception> e) {
    158       OnJobFailed(e);
     156      OnTaskFailed(e);
    159157    }
    160158
    161159    protected virtual void optimizer_Started(object sender, EventArgs e) {
    162       OnJobStarted();
     160      OnTaskStarted();
    163161    }
    164162
    165163    protected virtual void optimizer_Stopped(object sender, EventArgs e) {
    166       OnJobStopped();
     164      OnTaskStopped();
    167165    }
    168166
    169167    protected virtual void optimizer_Paused(object sender, EventArgs e) {
    170       OnJobPaused();
     168      OnTaskPaused();
    171169    }
    172170
Note: See TracChangeset for help on using the changeset viewer.