Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/02/08 21:10:17 (16 years ago)
Author:
gkronber
Message:

Refactored cloning in all plugins except: HL.Communication, HL.Hive, HL.GP, HL.Routing, HL.Scheduling, HL.SimOpt, HL.Visualization

#285 (Cloning could be improved by creating objects at the bottom of the cloning chain with 'new' instead of the top with Activator.CreateInstance())

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactorBranch/HeuristicLab.ThreadParallelEngine/ThreadParallelEngine.cs

    r2 r887  
    5858    }
    5959
     60    public ThreadParallelEngine(ThreadParallelEngine original) : this(original, new Dictionary<Guid, object>()) { }
     61    protected ThreadParallelEngine(ThreadParallelEngine original, IDictionary<Guid, object> clonedObjects)
     62      : base(original, clonedObjects) {
     63      this.myWorkers = original.Workers;
     64    }
    6065
    6166    public override object Clone(IDictionary<Guid, object> clonedObjects) {
    62       ThreadParallelEngine clone = (ThreadParallelEngine)base.Clone(clonedObjects);
    63       clone.myWorkers = Workers;
    64       return clone;
     67      return new ThreadParallelEngine(this, clonedObjects);
    6568    }
    6669
Note: See TracChangeset for help on using the changeset viewer.