Changeset 3286
- Timestamp:
- 04/08/10 02:21:50 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Collections/3.3/ObservableArray.cs
r3017 r3286 32 32 public class ObservableArray<T> : IObservableArray<T> { 33 33 [Storable] 34 pr ivateT[] array;34 protected T[] array; 35 35 36 36 #region Properties -
trunk/sources/HeuristicLab.Collections/3.3/ObservableCollection.cs
r3017 r3286 31 31 public class ObservableCollection<T> : IObservableCollection<T> { 32 32 [Storable] 33 pr ivateList<T> list;33 protected List<T> list; 34 34 35 35 #region Properties -
trunk/sources/HeuristicLab.Collections/3.3/ObservableKeyedCollection.cs
r3017 r3286 32 32 public abstract class ObservableKeyedCollection<TKey, TItem> : IObservableKeyedCollection<TKey, TItem> { 33 33 [Storable] 34 pr ivateDictionary<TKey, TItem> dict;34 protected Dictionary<TKey, TItem> dict; 35 35 36 36 #region Properties -
trunk/sources/HeuristicLab.Collections/3.3/ObservableList.cs
r3017 r3286 31 31 public class ObservableList<T> : IObservableList<T> { 32 32 [Storable] 33 pr ivateList<T> list;33 protected List<T> list; 34 34 35 35 #region Properties -
trunk/sources/HeuristicLab.Collections/3.3/ObservableSet.cs
r3017 r3286 32 32 public class ObservableSet<T> : IObservableSet<T> { 33 33 [Storable] 34 pr ivateHashSet<T> set;34 protected HashSet<T> set; 35 35 36 36 #region Properties -
trunk/sources/HeuristicLab.Core/3.3/ItemArray.cs
r3017 r3286 55 55 56 56 public virtual IDeepCloneable Clone(Cloner cloner) { 57 ItemArray<T> clone = (ItemArray<T>)Activator.CreateInstance(this.GetType() , this.Select(x => (T)cloner.Clone(x)));57 ItemArray<T> clone = (ItemArray<T>)Activator.CreateInstance(this.GetType()); 58 58 cloner.RegisterClonedObject(this, clone); 59 clone.array = this.Select(x => (T)cloner.Clone(x)).ToArray(); 59 60 return clone; 60 61 } -
trunk/sources/HeuristicLab.Core/3.3/ItemCollection.cs
r3017 r3286 51 51 52 52 public virtual IDeepCloneable Clone(Cloner cloner) { 53 ItemCollection<T> clone = (ItemCollection<T>)Activator.CreateInstance(this.GetType() , this.Select(x => (T)cloner.Clone(x)));53 ItemCollection<T> clone = (ItemCollection<T>)Activator.CreateInstance(this.GetType()); 54 54 cloner.RegisterClonedObject(this, clone); 55 clone.list = new List<T>(this.Select(x => (T)cloner.Clone(x))); 55 56 return clone; 56 57 } -
trunk/sources/HeuristicLab.Core/3.3/ItemList.cs
r3017 r3286 55 55 56 56 public virtual IDeepCloneable Clone(Cloner cloner) { 57 ItemList<T> clone = (ItemList<T>)Activator.CreateInstance(this.GetType() , this.Select(x => (T)cloner.Clone(x)));57 ItemList<T> clone = (ItemList<T>)Activator.CreateInstance(this.GetType()); 58 58 cloner.RegisterClonedObject(this, clone); 59 clone.list = new List<T>(this.Select(x => (T)cloner.Clone(x))); 59 60 return clone; 60 61 } -
trunk/sources/HeuristicLab.Core/3.3/ItemSet.cs
r3017 r3286 54 54 55 55 public virtual IDeepCloneable Clone(Cloner cloner) { 56 ItemSet<T> clone = (ItemSet<T>)Activator.CreateInstance(this.GetType() , this.Select(x => (T)cloner.Clone(x)));56 ItemSet<T> clone = (ItemSet<T>)Activator.CreateInstance(this.GetType()); 57 57 cloner.RegisterClonedObject(this, clone); 58 clone.set = new HashSet<T>(this.Select(x => (T)cloner.Clone(x))); 58 59 return clone; 59 60 } -
trunk/sources/HeuristicLab.Core/3.3/NamedItemCollection.cs
r3017 r3286 58 58 } 59 59 public virtual IDeepCloneable Clone(Cloner cloner) { 60 NamedItemCollection<T> clone = (NamedItemCollection<T>)Activator.CreateInstance(this.GetType() , this.Select(x => (T)cloner.Clone(x)));60 NamedItemCollection<T> clone = (NamedItemCollection<T>)Activator.CreateInstance(this.GetType()); 61 61 cloner.RegisterClonedObject(this, clone); 62 foreach (string key in dict.Keys) 63 clone.dict.Add(key, (T)cloner.Clone(dict[key])); 62 64 return clone; 63 65 } -
trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs
r3283 r3286 126 126 runs = new RunCollection(); 127 127 } 128 internal Algorithm(Algorithm algorithm, Cloner cloner)129 : base(algorithm.Name, algorithm.Description, (ParameterCollection)cloner.Clone(algorithm.Parameters)) {130 executionState = algorithm.executionState;131 executionTime = algorithm.executionTime;132 problem = (IProblem)cloner.Clone(algorithm.problem);133 runsCounter = algorithm.runsCounter;134 runs = (RunCollection)cloner.Clone(algorithm.runs);135 Initialize();136 }137 128 [StorableConstructor] 138 129 protected Algorithm(bool deserializing) : base(deserializing) { } … … 154 145 return clone; 155 146 } 147 protected virtual void Clone(IDeepCloneable clone, Cloner cloner) { 148 Algorithm algorithm = clone as Algorithm; 149 if (algorithm != null) { 150 algorithm.name = name; 151 algorithm.description = description; 152 foreach (IParameter param in Parameters) 153 algorithm.Parameters.Add((IParameter)cloner.Clone(param)); 154 algorithm.executionState = executionState; 155 algorithm.executionTime = executionTime; 156 algorithm.problem = (IProblem)cloner.Clone(problem); 157 algorithm.runsCounter = runsCounter; 158 algorithm.runs = (RunCollection)cloner.Clone(runs); 159 algorithm.Initialize(); 160 } 161 } 156 162 157 163 public virtual void Prepare() { -
trunk/sources/HeuristicLab.Optimization/3.3/EngineAlgorithm.cs
r3283 r3286 112 112 Initialize(); 113 113 } 114 internal EngineAlgorithm(EngineAlgorithm algorithm, Cloner cloner)115 : base(algorithm, cloner) {116 globalScope = (IScope)cloner.Clone(algorithm.globalScope);117 operatorGraph = (OperatorGraph)cloner.Clone(algorithm.operatorGraph);118 engine = (IEngine)cloner.Clone(algorithm.engine);119 Initialize();120 }121 114 [StorableConstructor] 122 115 protected EngineAlgorithm(bool deserializing) : base(deserializing) { } … … 142 135 return clone; 143 136 } 137 protected override void Clone(IDeepCloneable clone, Cloner cloner) { 138 base.Clone(clone, cloner); 139 EngineAlgorithm algorithm = clone as EngineAlgorithm; 140 if (algorithm != null) { 141 algorithm.globalScope = (IScope)cloner.Clone(globalScope); 142 algorithm.engine = (IEngine)cloner.Clone(engine); 143 algorithm.operatorGraph = (OperatorGraph)cloner.Clone(operatorGraph); 144 algorithm.Initialize(); 145 } 146 } 144 147 145 148 public UserDefinedAlgorithm CreateUserDefinedAlgorithm() { 146 return new UserDefinedAlgorithm(this, new Cloner()); 149 UserDefinedAlgorithm algorithm = new UserDefinedAlgorithm(); 150 Cloner cloner = new Cloner(); 151 cloner.RegisterClonedObject(this, algorithm); 152 Clone(algorithm, cloner); 153 return algorithm; 147 154 } 148 155 -
trunk/sources/HeuristicLab.Optimization/3.3/UserDefinedAlgorithm.cs
r3280 r3286 52 52 public UserDefinedAlgorithm(string name) : base(name) { } 53 53 public UserDefinedAlgorithm(string name, string description) : base(name, description) { } 54 internal UserDefinedAlgorithm(EngineAlgorithm algorithm, Cloner cloner) : base(algorithm, cloner) { }55 54 [StorableConstructor] 56 55 private UserDefinedAlgorithm(bool deserializing) : base(deserializing) { }
Note: See TracChangeset
for help on using the changeset viewer.