Changeset 2830 for trunk/sources
- Timestamp:
- 02/19/10 02:15:10 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 13 added
- 1 deleted
- 49 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab 3.3.sln
r2819 r2830 6 6 ConfigMerger.exe = ConfigMerger.exe 7 7 ..\documentation\License\gpl-3.0.txt = ..\documentation\License\gpl-3.0.txt 8 HeuristicLab 3.3.vsmdi = HeuristicLab 3.3.vsmdi 8 9 LocalTestRun.testrunconfig = LocalTestRun.testrunconfig 9 10 PreBuildEvent.cmd = PreBuildEvent.cmd … … 149 150 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Routing.TSP.Views-3.3", "HeuristicLab.Routing.TSP.Views\3.3\HeuristicLab.Routing.TSP.Views-3.3.csproj", "{DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}" 150 151 EndProject 152 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.SGA-3.3.Tests", "HeuristicLab.SGA\3.3\Tests\HeuristicLab.SGA-3.3.Tests.csproj", "{F42F3576-7233-4B28-90F7-36AE15F30F92}" 153 EndProject 151 154 Global 155 GlobalSection(TestCaseManagementSettings) = postSolution 156 CategoryFile = HeuristicLab 3.3.vsmdi 157 EndGlobalSection 152 158 GlobalSection(SolutionConfigurationPlatforms) = preSolution 153 159 Debug|Any CPU = Debug|Any CPU … … 661 667 {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Release|x64.ActiveCfg = Release|Any CPU 662 668 {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Release|x86.ActiveCfg = Release|Any CPU 669 {F42F3576-7233-4B28-90F7-36AE15F30F92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 670 {F42F3576-7233-4B28-90F7-36AE15F30F92}.Debug|Any CPU.Build.0 = Debug|Any CPU 671 {F42F3576-7233-4B28-90F7-36AE15F30F92}.Debug|x64.ActiveCfg = Debug|Any CPU 672 {F42F3576-7233-4B28-90F7-36AE15F30F92}.Debug|x86.ActiveCfg = Debug|Any CPU 673 {F42F3576-7233-4B28-90F7-36AE15F30F92}.Release|Any CPU.ActiveCfg = Release|Any CPU 674 {F42F3576-7233-4B28-90F7-36AE15F30F92}.Release|Any CPU.Build.0 = Release|Any CPU 675 {F42F3576-7233-4B28-90F7-36AE15F30F92}.Release|x64.ActiveCfg = Release|Any CPU 676 {F42F3576-7233-4B28-90F7-36AE15F30F92}.Release|x86.ActiveCfg = Release|Any CPU 663 677 EndGlobalSection 664 678 GlobalSection(SolutionProperties) = preSolution -
trunk/sources/HeuristicLab.Collections/3.3/ObservableArray.cs
r2790 r2830 68 68 public ObservableArray(T[] array) { 69 69 this.array = (T[])array.Clone(); 70 OnCollectionReset(GetIndexedItems(), new IndexedItem<T>[0]);71 70 } 72 71 public ObservableArray(IEnumerable<T> collection) { 73 72 array = collection.ToArray(); 74 OnCollectionReset(GetIndexedItems(), new IndexedItem<T>[0]);75 73 } 76 74 #endregion -
trunk/sources/HeuristicLab.Collections/3.3/ObservableCollection.cs
r2790 r2830 59 59 public ObservableCollection(IEnumerable<T> collection) { 60 60 list = new List<T>(collection); 61 OnItemsAdded(collection);62 61 } 63 62 #endregion -
trunk/sources/HeuristicLab.Collections/3.3/ObservableDictionary.cs
r2790 r2830 79 79 public ObservableDictionary(IDictionary<TKey, TValue> dictionary) { 80 80 dict = new Dictionary<TKey, TValue>(dictionary); 81 OnItemsAdded(dictionary);82 81 } 83 82 public ObservableDictionary(int capacity, IEqualityComparer<TKey> comparer) { … … 86 85 public ObservableDictionary(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer) { 87 86 dict = new Dictionary<TKey, TValue>(dictionary, comparer); 88 OnItemsAdded(dictionary);89 87 } 90 88 #endregion -
trunk/sources/HeuristicLab.Collections/3.3/ObservableKeyedCollection.cs
r2790 r2830 66 66 foreach (TItem item in collection) 67 67 dict.Add(GetKeyForItem(item), item); 68 OnItemsAdded(collection);69 68 } 70 69 protected ObservableKeyedCollection(int capacity, IEqualityComparer<TKey> comparer) { … … 76 75 foreach (TItem item in collection) 77 76 dict.Add(GetKeyForItem(item), item); 78 OnItemsAdded(collection);79 77 } 80 78 #endregion -
trunk/sources/HeuristicLab.Collections/3.3/ObservableList.cs
r2790 r2830 73 73 public ObservableList(IEnumerable<T> collection) { 74 74 list = new List<T>(collection); 75 OnItemsAdded(GetIndexedItems());76 OnItemsAdded(collection);77 75 } 78 76 #endregion -
trunk/sources/HeuristicLab.Collections/3.3/ObservableSet.cs
r2790 r2830 51 51 public ObservableSet(IEnumerable<T> collection) { 52 52 set = new HashSet<T>(collection); 53 OnItemsAdded(this);54 53 } 55 54 public ObservableSet(IEqualityComparer<T> comparer) { … … 58 57 public ObservableSet(IEnumerable<T> collection, IEqualityComparer<T> comparer) { 59 58 set = new HashSet<T>(collection, comparer); 60 OnItemsAdded(this);61 59 } 62 60 #endregion -
trunk/sources/HeuristicLab.Core/3.3/DeepCloneable.cs
r2790 r2830 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 using System.Xml;26 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 24 -
trunk/sources/HeuristicLab.Core/3.3/Item.cs
r2790 r2830 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Text;26 using System.Xml;27 22 using System.Drawing; 28 using System.Resources;23 using HeuristicLab.Common.Resources; 29 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common.Resources;31 25 32 26 namespace HeuristicLab.Core { … … 61 55 protected virtual void OnChanged(ChangedEventArgs e) { 62 56 if ((e.RegisterChangedObject(this)) && (Changed != null)) 63 57 Changed(this, e); 64 58 } 65 59 } -
trunk/sources/HeuristicLab.Core/3.3/ItemArray.cs
r2790 r2830 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Collections; 24 25 using System.Collections.Generic; … … 55 56 public ItemArray() : base() { } 56 57 public ItemArray(int length) : base(length) { } 57 public ItemArray(T[] array) : base(array) { } 58 public ItemArray(IEnumerable<T> collection) : base(collection) { } 58 public ItemArray(T[] array) : base(array) { 59 foreach (T item in this) 60 item.Changed += new ChangedEventHandler(Item_Changed); 61 } 62 public ItemArray(IEnumerable<T> collection) : base(collection) { 63 foreach (T item in this) 64 item.Changed += new ChangedEventHandler(Item_Changed); 65 } 59 66 60 67 public object Clone() { … … 62 69 } 63 70 64 public IDeepCloneable Clone(Cloner cloner) { 65 T[] items = new T[Length]; 66 for (int i = 0; i < items.Length; i++) 67 items[i] = (T)cloner.Clone(this[i]); 68 ItemArray<T> clone = (ItemArray<T>)Activator.CreateInstance(this.GetType(), new object[] { items }); 71 public virtual IDeepCloneable Clone(Cloner cloner) { 72 ItemArray<T> clone = (ItemArray<T>)Activator.CreateInstance(this.GetType(), this.Select(x => (T)cloner.Clone(x))); 69 73 cloner.RegisterClonedObject(this, clone); 70 74 return clone; -
trunk/sources/HeuristicLab.Core/3.3/ItemCollection.cs
r2790 r2830 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Collections; 24 25 using System.Collections.Generic; … … 56 57 public ItemCollection() : base() { } 57 58 public ItemCollection(int capacity) : base(capacity) { } 58 public ItemCollection(IEnumerable<T> collection) : base(collection) { } 59 public ItemCollection(IEnumerable<T> collection) : base(collection) { 60 foreach (T item in this) 61 item.Changed += new ChangedEventHandler(Item_Changed); 62 } 59 63 60 64 public object Clone() { … … 62 66 } 63 67 64 public IDeepCloneable Clone(Cloner cloner) { 65 List<T> items = new List<T>(); 66 foreach (T item in this) 67 items.Add((T)cloner.Clone(item)); 68 ItemCollection<T> clone = (ItemCollection<T>)Activator.CreateInstance(this.GetType(), items); 68 public virtual IDeepCloneable Clone(Cloner cloner) { 69 ItemCollection<T> clone = (ItemCollection<T>)Activator.CreateInstance(this.GetType(), this.Select(x => (T)cloner.Clone(x))); 69 70 cloner.RegisterClonedObject(this, clone); 70 71 return clone; -
trunk/sources/HeuristicLab.Core/3.3/ItemList.cs
r2790 r2830 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Collections; 24 25 using System.Collections.Generic; … … 56 57 public ItemList() : base() { } 57 58 public ItemList(int capacity) : base(capacity) { } 58 public ItemList(IEnumerable<T> collection) : base(collection) { } 59 public ItemList(IEnumerable<T> collection) : base(collection) { 60 foreach (T item in this) 61 item.Changed += new ChangedEventHandler(Item_Changed); 62 } 59 63 60 64 public object Clone() { … … 62 66 } 63 67 64 public IDeepCloneable Clone(Cloner cloner) { 65 List<T> items = new List<T>(); 66 foreach (T item in this) 67 items.Add((T)cloner.Clone(item)); 68 ItemList<T> clone = (ItemList<T>)Activator.CreateInstance(this.GetType(), items); 68 public virtual IDeepCloneable Clone(Cloner cloner) { 69 ItemList<T> clone = (ItemList<T>)Activator.CreateInstance(this.GetType(), this.Select(x => (T)cloner.Clone(x))); 69 70 cloner.RegisterClonedObject(this, clone); 70 71 return clone; -
trunk/sources/HeuristicLab.Core/3.3/ItemSet.cs
r2790 r2830 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Collections; 24 25 using System.Collections.Generic; … … 55 56 56 57 public ItemSet() : base() { } 57 public ItemSet(IEnumerable<T> collection) : base(collection) { } 58 public ItemSet(IEnumerable<T> collection) : base(collection) { 59 foreach (T item in this) 60 item.Changed += new ChangedEventHandler(Item_Changed); 61 } 58 62 59 63 public object Clone() { … … 61 65 } 62 66 63 public IDeepCloneable Clone(Cloner cloner) { 64 List<T> items = new List<T>(); 65 foreach (T item in this) 66 items.Add((T)cloner.Clone(item)); 67 ItemSet<T> clone = (ItemSet<T>)Activator.CreateInstance(this.GetType(), items); 67 public virtual IDeepCloneable Clone(Cloner cloner) { 68 ItemSet<T> clone = (ItemSet<T>)Activator.CreateInstance(this.GetType(), this.Select(x => (T)cloner.Clone(x))); 68 69 cloner.RegisterClonedObject(this, clone); 69 70 return clone; -
trunk/sources/HeuristicLab.Core/3.3/NamedItem.cs
r2793 r2830 74 74 /// </summary> 75 75 protected NamedItem() { 76 name = ItemName;77 description = ItemDescription;76 name = string.Empty; 77 description = string.Empty; 78 78 } 79 79 /// <summary> … … 83 83 /// <param name="name">The name of the current instance.</param> 84 84 /// <param name="value">The value of the current instance.</param> 85 protected NamedItem(string name) 86 : this() { 85 protected NamedItem(string name) { 87 86 if (name == null) throw new ArgumentNullException(); 88 87 this.name = name; 88 description = string.Empty; 89 89 } 90 protected NamedItem(string name, string description) 91 : this(name) { 90 protected NamedItem(string name, string description) { 91 if (name == null) throw new ArgumentNullException(); 92 this.name = name; 92 93 this.description = description; 93 94 } -
trunk/sources/HeuristicLab.Core/3.3/NamedItemCollection.cs
r2790 r2830 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Collections.Generic; 24 25 using System.Drawing; … … 43 44 private object RestoreEvents { 44 45 get { return null; } 45 set { 46 foreach (T item in this) { 47 item.NameChanging += new EventHandler<CancelEventArgs<string>>(Item_NameChanging); 48 item.NameChanged += new EventHandler(Item_NameChanged); 49 item.Changed += new ChangedEventHandler(Item_Changed); 50 } 51 } 46 set { RegisterItemEvents(this); } 52 47 } 53 48 54 49 public NamedItemCollection() : base() { } 55 50 public NamedItemCollection(int capacity) : base(capacity) { } 56 public NamedItemCollection(IEnumerable<T> collection) : base(collection) { } 51 public NamedItemCollection(IEnumerable<T> collection) : base(collection) { 52 RegisterItemEvents(this); 53 } 57 54 58 55 public object Clone() { 59 56 return Clone(new Cloner()); 60 57 } 61 public IDeepCloneable Clone(Cloner cloner) { 62 List<T> items = new List<T>(); 63 foreach (T item in this) 64 items.Add((T)cloner.Clone(item)); 65 NamedItemCollection<T> clone = (NamedItemCollection<T>)Activator.CreateInstance(this.GetType(), items); 58 public virtual IDeepCloneable Clone(Cloner cloner) { 59 NamedItemCollection<T> clone = (NamedItemCollection<T>)Activator.CreateInstance(this.GetType(), this.Select(x => (T)cloner.Clone(x))); 66 60 cloner.RegisterClonedObject(this, clone); 67 61 return clone; … … 86 80 87 81 protected override void OnItemsAdded(IEnumerable<T> items) { 88 foreach (T item in items) { 89 item.NameChanging += new EventHandler<CancelEventArgs<string>>(Item_NameChanging); 90 item.NameChanged += new EventHandler(Item_NameChanged); 91 item.Changed += new ChangedEventHandler(Item_Changed); 92 } 82 RegisterItemEvents(items); 93 83 base.OnItemsAdded(items); 94 84 } 95 85 protected override void OnItemsRemoved(IEnumerable<T> items) { 96 foreach (T item in items) { 97 item.NameChanging -= new EventHandler<CancelEventArgs<string>>(Item_NameChanging); 98 item.NameChanged -= new EventHandler(Item_NameChanged); 99 item.Changed -= new ChangedEventHandler(Item_Changed); 100 } 86 DeregisterItemEvents(items); 101 87 base.OnItemsRemoved(items); 102 88 } … … 108 94 #endregion 109 95 protected override void OnCollectionReset(IEnumerable<T> items, IEnumerable<T> oldItems) { 110 foreach (T oldItem in oldItems) { 111 oldItem.NameChanging -= new EventHandler<CancelEventArgs<string>>(Item_NameChanging); 112 oldItem.NameChanged -= new EventHandler(Item_NameChanged); 113 oldItem.Changed -= new ChangedEventHandler(Item_Changed); 114 } 96 DeregisterItemEvents(oldItems); 97 RegisterItemEvents(items); 98 base.OnCollectionReset(items, oldItems); 99 } 100 protected override void OnPropertyChanged(string propertyName) { 101 base.OnPropertyChanged(propertyName); 102 OnChanged(); 103 } 104 105 private void RegisterItemEvents(IEnumerable<T> items) { 115 106 foreach (T item in items) { 116 107 item.NameChanging += new EventHandler<CancelEventArgs<string>>(Item_NameChanging); … … 118 109 item.Changed += new ChangedEventHandler(Item_Changed); 119 110 } 120 base.OnCollectionReset(items, oldItems);121 111 } 122 protected override void OnPropertyChanged(string propertyName) { 123 base.OnPropertyChanged(propertyName); 124 OnChanged(); 112 private void DeregisterItemEvents(IEnumerable<T> items) { 113 foreach (T item in items) { 114 item.NameChanging -= new EventHandler<CancelEventArgs<string>>(Item_NameChanging); 115 item.NameChanged -= new EventHandler(Item_NameChanged); 116 item.Changed -= new ChangedEventHandler(Item_Changed); 117 } 125 118 } 126 119 -
trunk/sources/HeuristicLab.Core/3.3/Scope.cs
r2790 r2830 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Text; 25 using System.Xml; 22 using HeuristicLab.Collections; 26 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Collections;28 24 29 25 namespace HeuristicLab.Core { … … 99 95 clone.Name = Name; 100 96 clone.Description = Description; 101 clone.parent = (IScope)cloner.Clone(parent); 102 clone.Variables = (VariableCollection)cloner.Clone(variables); 103 clone.SubScopes = (ScopeList)cloner.Clone(subScopes); 97 if (variables.Count > 0) clone.Variables = (VariableCollection)cloner.Clone(variables); 98 if (subScopes.Count > 0) clone.SubScopes = (ScopeList)cloner.Clone(subScopes); 104 99 return clone; 105 100 } -
trunk/sources/HeuristicLab.Core/3.3/ScopeList.cs
r2790 r2830 20 20 #endregion 21 21 22 using System;23 using System.Collections;24 22 using System.Collections.Generic; 25 using System.Collections.ObjectModel; 26 using System.Text; 27 using System.Drawing; 23 using System.Linq; 28 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common.Resources;30 using HeuristicLab.Collections;31 25 32 26 namespace HeuristicLab.Core { … … 34 28 [Item("ScopeList", "Represents a list of scopes.")] 35 29 [Creatable("Test")] 36 public class ScopeList : ItemList<IScope> {30 public sealed class ScopeList : ItemList<IScope> { 37 31 public ScopeList() : base() { } 38 32 public ScopeList(int capacity) : base(capacity) { } 39 33 public ScopeList(IEnumerable<IScope> collection) : base(collection) { } 34 35 public override IDeepCloneable Clone(Cloner cloner) { 36 ScopeList clone = new ScopeList(this.Select(x => (IScope)cloner.Clone(x))); 37 cloner.RegisterClonedObject(this, clone); 38 return clone; 39 } 40 40 } 41 41 } -
trunk/sources/HeuristicLab.Core/3.3/Variable.cs
r2818 r2830 53 53 public Variable() 54 54 : base("Anonymous") { 55 Value = null;55 this.value = null; 56 56 } 57 57 /// <summary> … … 61 61 /// <param name="name">The name of the current instance.</param> 62 62 /// <param name="value">The value of the current instance.</param> 63 public Variable(string name) 64 : base(name) { 65 this.value = null; 66 } 67 public Variable(string name, string description) 68 : base(name, description) { 69 this.value = null; 70 } 63 71 public Variable(string name, IItem value) 64 72 : base(name) { 65 Value = value; 73 this.value = value; 74 this.value.Changed += new ChangedEventHandler(Value_Changed); 75 } 76 public Variable(string name, string description, IItem value) 77 : base(name, description) { 78 this.value = value; 79 this.value.Changed += new ChangedEventHandler(Value_Changed); 66 80 } 67 81 … … 72 86 /// <returns>The cloned object as <see cref="Variable"/>.</returns> 73 87 public override IDeepCloneable Clone(Cloner cloner) { 74 Variable clone = new Variable( );88 Variable clone = new Variable(Name, Description, (IItem)cloner.Clone(value)); 75 89 cloner.RegisterClonedObject(this, clone); 76 clone.Name = Name;77 clone.Description = Description;78 clone.Value = (IItem)cloner.Clone(value);79 90 return clone; 80 91 } -
trunk/sources/HeuristicLab.Core/3.3/VariableCollection.cs
r2790 r2830 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 25 … … 27 28 [Item("VariableCollection", "Represents a collection of variables.")] 28 29 [Creatable("Test")] 29 public class VariableCollection : NamedItemCollection<IVariable> {30 public sealed class VariableCollection : NamedItemCollection<IVariable> { 30 31 public VariableCollection() : base() { } 31 32 public VariableCollection(int capacity) : base(capacity) { } 32 33 public VariableCollection(IEnumerable<IVariable> collection) : base(collection) { } 34 35 public override IDeepCloneable Clone(Cloner cloner) { 36 VariableCollection clone = new VariableCollection(this.Select(x => (IVariable)cloner.Clone(x))); 37 cloner.RegisterClonedObject(this, clone); 38 return clone; 39 } 33 40 } 34 41 } -
trunk/sources/HeuristicLab.Evolutionary/3.3/HeuristicLab.Evolutionary-3.3.csproj
r2794 r2830 82 82 <ItemGroup> 83 83 <None Include="HeuristicLabEvolutionaryPlugin.cs.frame" /> 84 <Compile Include="PopulationCreator.cs" /> 84 85 <Compile Include="HeuristicLabEvolutionaryPlugin.cs" /> 85 86 <Compile Include="Properties\AssemblyInfo.cs" /> -
trunk/sources/HeuristicLab.Operators.Views/3.3/AlgorithmOperatorView.Designer.cs
r2829 r2830 21 21 22 22 namespace HeuristicLab.Operators.Views { 23 partial class CombinedOperatorView {23 partial class AlgorithmOperatorView { 24 24 /// <summary> 25 25 /// Required designer variable. … … 127 127 this.operatorGraphViewHost.ViewType = null; 128 128 // 129 // CombinedOperatorView129 // AlgorithmOperatorView 130 130 // 131 131 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 132 132 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 133 133 this.Controls.Add(this.tabControl); 134 this.Name = " CombinedOperatorView";134 this.Name = "AlgorithmOperatorView"; 135 135 this.Size = new System.Drawing.Size(486, 482); 136 136 this.Controls.SetChildIndex(this.tabControl, 0); -
trunk/sources/HeuristicLab.Operators.Views/3.3/AlgorithmOperatorView.cs
r2829 r2830 29 29 /// </summary> 30 30 [Content(typeof(CombinedOperator), true)] 31 public partial class CombinedOperatorView : NamedItemView {32 public new CombinedOperator Content {33 get { return ( CombinedOperator)base.Content; }31 public partial class AlgorithmOperatorView : NamedItemView { 32 public new AlgorithmOperator Content { 33 get { return (AlgorithmOperator)base.Content; } 34 34 set { base.Content = value; } 35 35 } … … 38 38 /// Initializes a new instance of <see cref="ItemBaseView"/>. 39 39 /// </summary> 40 public CombinedOperatorView() {40 public AlgorithmOperatorView() { 41 41 InitializeComponent(); 42 42 } … … 45 45 /// </summary> 46 46 /// <param name="item">The item that should be displayed.</param> 47 public CombinedOperatorView(CombinedOperator content)47 public AlgorithmOperatorView(AlgorithmOperator content) 48 48 : this() { 49 49 Content = content; -
trunk/sources/HeuristicLab.Operators.Views/3.3/HeuristicLab.Operators.Views-3.3.csproj
r2805 r2830 68 68 </ItemGroup> 69 69 <ItemGroup> 70 <Compile Include=" CombinedOperatorView.cs">70 <Compile Include="AlgorithmOperatorView.cs"> 71 71 <SubType>UserControl</SubType> 72 72 </Compile> 73 <Compile Include=" CombinedOperatorView.Designer.cs">74 <DependentUpon> CombinedOperatorView.cs</DependentUpon>73 <Compile Include="AlgorithmOperatorView.Designer.cs"> 74 <DependentUpon>AlgorithmOperatorView.cs</DependentUpon> 75 75 </Compile> 76 76 <None Include="HeuristicLabOperatorsViewsPlugin.cs.frame" /> -
trunk/sources/HeuristicLab.Operators/3.3/CombinedOperator.cs
r2796 r2830 27 27 namespace HeuristicLab.Operators { 28 28 /// <summary> 29 /// Operator which contains an operator graph.29 /// An operator which contains an operator graph. 30 30 /// </summary> 31 31 [Item("CombinedOperator", "An operator which contains an operator graph.")] 32 32 [Creatable("Test")] 33 public sealed class CombinedOperator : SingleSuccessorOperator, IOperator { 34 public override Image ItemImage { 35 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Module; } 36 } 37 [Storable] 38 private OperatorGraph operatorGraph; 39 public OperatorGraph OperatorGraph { 40 get { return operatorGraph; } 41 } 33 public sealed class CombinedOperator : AlgorithmOperator, IOperator { 42 34 public new ParameterCollection Parameters { 43 35 get { … … 52 44 } 53 45 54 public CombinedOperator() 55 : base() { 56 operatorGraph = new OperatorGraph(); 57 } 58 59 public override IDeepCloneable Clone(Cloner cloner) { 60 CombinedOperator clone = (CombinedOperator)base.Clone(cloner); 61 clone.operatorGraph = (OperatorGraph)cloner.Clone(operatorGraph); 62 return clone; 63 } 64 65 public override IExecutionSequence Apply() { 66 ExecutionContextCollection next = new ExecutionContextCollection(base.Apply()); 67 if (operatorGraph.InitialOperator != null) 68 next.Insert(0, ExecutionContext.CreateChildContext(operatorGraph.InitialOperator)); 69 return next; 70 } 46 public CombinedOperator() : base() { } 71 47 } 72 48 } -
trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj
r2818 r2830 90 90 <Compile Include="Comparator.cs" /> 91 91 <Compile Include="Assigner.cs" /> 92 <Compile Include="AlgorithmOperator.cs" /> 92 93 <Compile Include="MultipleCallsOperator.cs" /> 93 94 <Compile Include="Operator.cs" /> -
trunk/sources/HeuristicLab.Operators/3.3/ParallelSubScopesProcessor.cs
r2796 r2830 39 39 inner.Parallel = true; 40 40 for (int i = 0; (i < ExecutionContext.Scope.SubScopes.Count) && (i < Operators.Count); i++) 41 i nner.Add(ExecutionContext.CreateContext(Operators[i], ExecutionContext.Scope.SubScopes[i]));41 if (Operators[i] != null) inner.Add(ExecutionContext.CreateContext(Operators[i], ExecutionContext.Scope.SubScopes[i])); 42 42 next.Insert(0, inner); 43 43 } -
trunk/sources/HeuristicLab.Operators/3.3/SequentialSubScopesProcessor.cs
r2796 r2830 38 38 ExecutionContextCollection inner = new ExecutionContextCollection(); 39 39 for (int i = 0; (i < ExecutionContext.Scope.SubScopes.Count) && (i < Operators.Count); i++) 40 i nner.Add(ExecutionContext.CreateContext(Operators[i], ExecutionContext.Scope.SubScopes[i]));40 if (Operators[i] != null) inner.Add(ExecutionContext.CreateContext(Operators[i], ExecutionContext.Scope.SubScopes[i])); 41 41 next.Insert(0, inner); 42 42 } -
trunk/sources/HeuristicLab.Operators/3.3/SubScopesRemover.cs
r2794 r2830 27 27 namespace HeuristicLab.Operators { 28 28 /// <summary> 29 /// An operator which removes one specified or (if not specified) all sub-scopesfrom the current scope.29 /// An operator which removes all sub-scopes or one specified sub-scope from the current scope. 30 30 /// </summary> 31 [Item("SubScopesRemover", "An operator which removes one specified or (if not specified) all sub-scopesfrom the current scope.")]31 [Item("SubScopesRemover", "An operator which removes all sub-scopes or one specified sub-scope from the current scope.")] 32 32 [EmptyStorableClass] 33 33 [Creatable("Test")] 34 public class SubScopesRemover : SingleSuccessorOperator { 34 public sealed class SubScopesRemover : SingleSuccessorOperator { 35 private ValueParameter<BoolData> RemoveAllSubScopesParameter { 36 get { return (ValueParameter<BoolData>)Parameters["RemoveAllSubScopes"]; } 37 } 35 38 public ValueLookupParameter<IntData> SubScopeIndexParameter { 36 39 get { return (ValueLookupParameter<IntData>)Parameters["SubScopeIndex"]; } 37 40 } 38 pr otectedScopeParameter CurrentScopeParameter {41 private ScopeParameter CurrentScopeParameter { 39 42 get { return (ScopeParameter)Parameters["CurrentScope"]; } 43 } 44 45 public bool RemoveAllSubScopes { 46 get { return RemoveAllSubScopesParameter.Value.Value; } 47 set { RemoveAllSubScopesParameter.Value.Value = value; } 40 48 } 41 49 public IScope CurrentScope { … … 45 53 public SubScopesRemover() 46 54 : base() { 47 Parameters.Add(new ValueLookupParameter<IntData>("SubScopeIndex", "The index of the sub-scope which should be removed. If this parameter has no value, all sub-scopes of the current scope are removed.")); 55 Parameters.Add(new ValueParameter<BoolData>("RemoveAllSubScopes", "True if all sub-scopes of the current scope should be removed, otherwise false.", new BoolData(true))); 56 Parameters.Add(new ValueLookupParameter<IntData>("SubScopeIndex", "The index of the sub-scope which should be removed. This parameter is ignored, if RemoveAllSubScopes is true.")); 48 57 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope from which one or all sub-scopes should be removed.")); 49 58 } 50 59 51 60 public override IExecutionSequence Apply() { 52 IntData index = SubScopeIndexParameter.ActualValue; 53 if (index != null) 54 CurrentScope.SubScopes.RemoveAt(index.Value); 55 else 61 if (RemoveAllSubScopes) 56 62 CurrentScope.SubScopes.Clear(); 63 else { 64 CurrentScope.SubScopes.RemoveAt(SubScopeIndexParameter.ActualValue.Value); 65 } 57 66 return base.Apply(); 58 67 } -
trunk/sources/HeuristicLab.Permutation/3.3/CyclicCrossover.cs
r2829 r2830 54 54 if (parent1.Length != parent2.Length) throw new ArgumentException("CyclicCrossover: The parent permutations are of unequal length"); 55 55 int length = parent1.Length; 56 Permutation result = new Permutation(length);56 int[] result = new int[length]; 57 57 bool[] indexCopied = new bool[length]; 58 58 int[] invParent1 = new int[length]; … … 89 89 } while (j < length); 90 90 91 return result;91 return new Permutation(result); 92 92 } 93 93 -
trunk/sources/HeuristicLab.Permutation/3.3/InversionManipulator.cs
r2794 r2830 31 31 [Creatable("Test")] 32 32 public class InversionManipulator : PermutationManipulator { 33 34 33 /// <summary> 35 34 /// Inverts a randomly chosen part of a permutation. … … 38 37 /// <param name="permutation">The permutation to manipulate.</param> 39 38 /// <returns>The new manipulated permutation.</returns> 40 public static Permutation Apply(IRandom random, Permutation permutation) { 41 Permutation result = (Permutation)permutation.Clone(); 39 public static void Apply(IRandom random, Permutation permutation) { 42 40 int breakPoint1, breakPoint2; 43 41 44 breakPoint1 = random.Next( result.Length - 1);42 breakPoint1 = random.Next(permutation.Length - 1); 45 43 do { 46 breakPoint2 = random.Next( result.Length - 1);44 breakPoint2 = random.Next(permutation.Length - 1); 47 45 } while (breakPoint2 == breakPoint1); 48 46 if (breakPoint2 < breakPoint1) { int h = breakPoint1; breakPoint1 = breakPoint2; breakPoint2 = h; } 49 47 50 for (int i = 0; i <= (breakPoint2 - breakPoint1); i++) { // invert permutation between breakpoints 51 result[breakPoint1 + i] = permutation[breakPoint2 - i]; 48 for (int i = 0; i <= (breakPoint2 - breakPoint1) / 2; i++) { // invert permutation between breakpoints 49 int temp = permutation[breakPoint1 + i]; 50 permutation[breakPoint1 + i] = permutation[breakPoint2 - i]; 51 permutation[breakPoint2 - i] = temp; 52 52 } 53 return result;54 53 } 55 54 … … 60 59 /// <param name="permutation">The permutation to manipulate.</param> 61 60 /// <returns>The new manipulated permuation.</returns> 62 protected override PermutationManipulate(IRandom random, Permutation permutation) {63 returnApply(random, permutation);61 protected override void Manipulate(IRandom random, Permutation permutation) { 62 Apply(random, permutation); 64 63 } 65 64 } -
trunk/sources/HeuristicLab.Permutation/3.3/MaximalPreservativeCrossover.cs
r2829 r2830 59 59 if (parent1.Length < 4) throw new ArgumentException("MaximalPreservativeCrossover: The parent permutation must be at least of size 4"); 60 60 int length = parent1.Length; 61 Permutation result = new Permutation(length);61 int[] result = new int[length]; 62 62 bool[] numberCopied = new bool[length]; 63 63 int breakPoint1, breakPoint2, subsegmentLength, index; … … 119 119 } while (index != breakPoint1); 120 120 121 return result;121 return new Permutation(result); 122 122 } 123 123 -
trunk/sources/HeuristicLab.Permutation/3.3/OrderCrossover.cs
r2794 r2830 45 45 /// <returns>The new permutation resulting from the crossover.</returns> 46 46 public static Permutation Apply(IRandom random, Permutation parent1, Permutation parent2) { 47 Permutation result = new Permutation(parent1.Length);47 int[] result = new int[parent1.Length]; 48 48 bool[] copied = new bool[result.Length]; 49 49 … … 66 66 } 67 67 } 68 return result;68 return new Permutation(result); 69 69 } 70 70 -
trunk/sources/HeuristicLab.Permutation/3.3/PartiallyMatchedCrossover.cs
r2829 r2830 57 57 if (parent1.Length < 4) throw new ArgumentException("PartiallyMatchedCrossover: The parent permutation must be at least of size 4"); 58 58 int length = parent1.Length; 59 Permutation result = new Permutation(length);;59 int[] result = new int[length]; 60 60 int[] invResult = new int[length]; 61 61 … … 85 85 } 86 86 87 return result;87 return new Permutation(result); 88 88 } 89 89 -
trunk/sources/HeuristicLab.Permutation/3.3/Permutation.cs
r2794 r2830 44 44 public Permutation(int[] elements) 45 45 : base(elements) { 46 if (!Validate()) throw new ArgumentException("Elements do not represent a valid permutation.");47 46 } 48 47 private Permutation(Permutation elements) : base(elements) { } -
trunk/sources/HeuristicLab.Permutation/3.3/PermutationManipulator.cs
r2794 r2830 46 46 47 47 public sealed override IExecutionSequence Apply() { 48 PermutationParameter.ActualValue =Manipulate(RandomParameter.ActualValue, PermutationParameter.ActualValue);48 Manipulate(RandomParameter.ActualValue, PermutationParameter.ActualValue); 49 49 return base.Apply(); 50 50 } 51 51 52 protected abstract PermutationManipulate(IRandom random, Permutation permutation);52 protected abstract void Manipulate(IRandom random, Permutation permutation); 53 53 } 54 54 } -
trunk/sources/HeuristicLab.Routing.TSP/3.3/HeuristicLab.Routing.TSP-3.3.csproj
r2805 r2830 80 80 </Reference> 81 81 <Reference Include="System.Data" /> 82 <Reference Include="System.Drawing" />83 <Reference Include="System.Windows.Forms" />84 82 <Reference Include="System.Xml" /> 85 83 </ItemGroup> -
trunk/sources/HeuristicLab.Routing.TSP/3.3/TSP.cs
r2805 r2830 34 34 get { return (ValueParameter<DoubleMatrixData>)Parameters["Coordinates"]; } 35 35 } 36 private OperatorParameter Solution GeneratorParameter {37 get { return (OperatorParameter)Parameters["Solution Generator"]; }36 private OperatorParameter SolutionCreatorParameter { 37 get { return (OperatorParameter)Parameters["SolutionCreator"]; } 38 38 } 39 private OperatorParameter EvaluatorParameter {40 get { return (OperatorParameter)Parameters[" Evaluator"]; }39 private OperatorParameter SolutionEvaluatorParameter { 40 get { return (OperatorParameter)Parameters["SolutionEvaluator"]; } 41 41 } 42 42 … … 45 45 set { CoordinatesParameter.Value = value; } 46 46 } 47 public IOperator Solution Generator {48 get { return Solution GeneratorParameter.Value; }49 set { Solution GeneratorParameter.Value = value; }47 public IOperator SolutionCreator { 48 get { return SolutionCreatorParameter.Value; } 49 set { SolutionCreatorParameter.Value = value; } 50 50 } 51 public IOperator Evaluator {52 get { return EvaluatorParameter.Value; }53 set { EvaluatorParameter.Value = value; }51 public IOperator SolutionEvaluator { 52 get { return SolutionEvaluatorParameter.Value; } 53 set { SolutionEvaluatorParameter.Value = value; } 54 54 } 55 55 … … 59 59 Parameters.Add(new ValueParameter<DoubleMatrixData>("Coordinates", "The x- and y-Coordinates of the cities.", new DoubleMatrixData(0, 0))); 60 60 Parameters.Add(new ValueParameter<DoubleData>("BestKnownQuality", "The quality of the best known solution of this TSP instance.")); 61 Parameters.Add(new OperatorParameter("Solution Generator", "The operator which should be used to generate new solutions."));62 Parameters.Add(new OperatorParameter(" Evaluator", "The operator which should be used to evaluate solutions."));61 Parameters.Add(new OperatorParameter("SolutionCreator", "The operator which should be used to create new solutions.")); 62 Parameters.Add(new OperatorParameter("SolutionEvaluator", "The operator which should be used to evaluate solutions.")); 63 63 } 64 64 … … 70 70 RandomPermutationCreator creator = new RandomPermutationCreator(); 71 71 creator.LengthParameter.Value = new IntData(cities); 72 Solution Generator = creator;72 SolutionCreator = creator; 73 73 TSPRoundedEuclideanPathEvaluator evaluator = new TSPRoundedEuclideanPathEvaluator(); 74 Evaluator = evaluator;74 SolutionEvaluator = evaluator; 75 75 } 76 76 } -
trunk/sources/HeuristicLab.SGA/3.3
- Property svn:ignore
-
old new 1 *.user 2 HeuristicLabSGAPlugin.cs 1 3 bin 2 4 obj 3 *.user
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.SGA/3.3/HeuristicLab.SGA-3.3.csproj
r2546 r2830 79 79 </Reference> 80 80 <Reference Include="System.Data" /> 81 <Reference Include="System.Drawing" />82 <Reference Include="System.Windows.Forms" />83 81 <Reference Include="System.Xml" /> 84 82 </ItemGroup> 85 83 <ItemGroup> 84 <None Include="HeuristicLabSGAPlugin.cs.frame" /> 85 <Compile Include="SGAOperator.cs" /> 86 86 <Compile Include="HeuristicLabSGAPlugin.cs" /> 87 87 <Compile Include="Properties\AssemblyInfo.cs" /> 88 <Compile Include="SGA.cs" />89 <Compile Include="SGAView.cs">90 <SubType>UserControl</SubType>91 </Compile>92 <Compile Include="SGAView.Designer.cs">93 <DependentUpon>SGAView.cs</DependentUpon>94 </Compile>95 88 </ItemGroup> 96 89 <ItemGroup> 97 <ProjectReference Include="..\..\HeuristicLab.Common\3.2\HeuristicLab.Common-3.2.csproj"> 98 <Project>{1FC004FC-59AF-4249-B1B6-FF25873A20E4}</Project> 99 <Name>HeuristicLab.Common-3.2</Name> 100 </ProjectReference> 101 <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj"> 102 <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project> 103 <Name>HeuristicLab.Core.Views-3.3</Name> 90 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 91 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> 92 <Name>HeuristicLab.Collections-3.3</Name> 104 93 </ProjectReference> 105 94 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> … … 115 104 <Name>HeuristicLab.Evolutionary-3.3</Name> 116 105 </ProjectReference> 117 <ProjectReference Include="..\..\HeuristicLab.Logging\3.3\HeuristicLab.Logging-3.3.csproj">118 <Project>{72908B54-D136-4BF2-8474-25AA6CB66C92}</Project>119 <Name>HeuristicLab.Logging-3.3</Name>120 </ProjectReference>121 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.2\HeuristicLab.MainForm.WindowsForms-3.2.csproj">122 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>123 <Name>HeuristicLab.MainForm.WindowsForms-3.2</Name>124 </ProjectReference>125 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.2\HeuristicLab.MainForm-3.2.csproj">126 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>127 <Name>HeuristicLab.MainForm-3.2</Name>128 </ProjectReference>129 106 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> 130 107 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 131 108 <Name>HeuristicLab.Operators-3.3</Name> 109 </ProjectReference> 110 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 111 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project> 112 <Name>HeuristicLab.Parameters-3.3</Name> 132 113 </ProjectReference> 133 114 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> … … 139 120 <Name>HeuristicLab.PluginInfrastructure</Name> 140 121 </ProjectReference> 141 <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">142 <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>143 <Name>HeuristicLab.Random-3.3</Name>144 </ProjectReference>145 122 <ProjectReference Include="..\..\HeuristicLab.Selection\3.3\HeuristicLab.Selection-3.3.csproj"> 146 123 <Project>{2C36CD4F-E5F5-43A4-801A-201EA895FE17}</Project> 147 124 <Name>HeuristicLab.Selection-3.3</Name> 148 </ProjectReference>149 <ProjectReference Include="..\..\HeuristicLab.SequentialEngine\3.3\HeuristicLab.SequentialEngine-3.3.csproj">150 <Project>{DC3D7072-7999-4719-B65D-3997744D5DC1}</Project>151 <Name>HeuristicLab.SequentialEngine-3.3</Name>152 125 </ProjectReference> 153 126 </ItemGroup> … … 155 128 <None Include="HeuristicLab.snk" /> 156 129 <None Include="Properties\AssemblyInfo.frame" /> 157 </ItemGroup> 158 <ItemGroup> 159 <EmbeddedResource Include="SGAView.resx"> 160 <DependentUpon>SGAView.cs</DependentUpon> 161 </EmbeddedResource> 130 <None Include="SGAEngine.hl" /> 162 131 </ItemGroup> 163 132 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> … … 175 144 set Outdir=$(Outdir) 176 145 177 call PreBuildEvent.cmd</PreBuildEvent> 146 call PreBuildEvent.cmd 147 SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabSGAPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabSGAPlugin.cs"</PreBuildEvent> 178 148 </PropertyGroup> 179 149 </Project> -
trunk/sources/HeuristicLab.SGA/3.3/Properties/AssemblyInfo.frame
r1872 r2830 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-20 08Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System.Reflection; 23 using System.Runtime.CompilerServices;24 23 using System.Runtime.InteropServices; 25 using HeuristicLab.PluginInfrastructure;26 24 27 25 // General Information about an assembly is controlled through the following … … 33 31 [assembly: AssemblyCompany("")] 34 32 [assembly: AssemblyProduct("HeuristicLab")] 35 [assembly: AssemblyCopyright("(c) 2002-20 08HEAL")]33 [assembly: AssemblyCopyright("(c) 2002-2010 HEAL")] 36 34 [assembly: AssemblyTrademark("")] 37 35 [assembly: AssemblyCulture("")] … … 54 52 // You can specify all the values or you can default the Revision and Build Numbers 55 53 // by using the '*' as shown below: 56 [assembly: AssemblyVersion("3.3.0. $WCREV$")]54 [assembly: AssemblyVersion("3.3.0.0")] 57 55 [assembly: AssemblyFileVersion("3.3.0.$WCREV$")] 58 [assembly: AssemblyBuildDate("$WCNOW$")] -
trunk/sources/HeuristicLab.Selection/3.3/LeftReducer.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 public LeftReducer() : base() { } 34 35 35 protected override ScopeList Reduce(ScopeListscopes) {36 ScopeList reduced = new ScopeList();36 protected override List<IScope> Reduce(List<IScope> scopes) { 37 List<IScope> reduced = new List<IScope>(); 37 38 if (scopes.Count > 0) reduced.AddRange(scopes[0].SubScopes); 38 39 return reduced; -
trunk/sources/HeuristicLab.Selection/3.3/LeftSelector.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 public LeftSelector() : base() { } 34 35 35 protected override ScopeList Select(ScopeListscopes) {36 protected override IScope[] Select(List<IScope> scopes) { 36 37 int count = NumberOfSelectedSubScopesParameter.ActualValue.Value; 37 38 bool copy = CopySelectedParameter.Value.Value; 38 ScopeList selected = new ScopeList();39 IScope[] selected = new IScope[count]; 39 40 40 41 int j = 0; 41 42 for (int i = 0; i < count; i++) { 42 43 if (copy) { 43 selected .Add((IScope)scopes[j].Clone());44 selected[i] = (IScope)scopes[j].Clone(); 44 45 j++; 45 46 if (j >= scopes.Count) j = 0; 46 47 } else { 47 selected .Add(scopes[0]);48 selected[i] = scopes[0]; 48 49 scopes.RemoveAt(0); 49 50 } -
trunk/sources/HeuristicLab.Selection/3.3/LinearRankSelector.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Linq; 23 24 using HeuristicLab.Core; … … 38 39 } 39 40 40 protected override ScopeList Select(ScopeListscopes) {41 protected override IScope[] Select(List<IScope> scopes) { 41 42 int count = NumberOfSelectedSubScopesParameter.ActualValue.Value; 42 43 bool copy = CopySelectedParameter.Value.Value; … … 44 45 bool maximization = MaximizationParameter.ActualValue.Value; 45 46 ItemArray<DoubleData> qualities = QualityParameter.ActualValue; 46 ScopeList selected = new ScopeList();47 IScope[] selected = new IScope[count]; 47 48 48 49 // create a list for each scope that contains the scope's index in the original scope list and its lots … … 64 65 } 65 66 if (copy) 66 selected .Add((IScope)scopes[list[index].index].Clone());67 selected[i] = (IScope)scopes[list[index].index].Clone(); 67 68 else { 68 selected .Add(scopes[list[index].index]);69 selected[i] = scopes[list[index].index]; 69 70 scopes.RemoveAt(list[index].index); 70 71 lotSum -= list[index].lots; -
trunk/sources/HeuristicLab.Selection/3.3/MergingReducer.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 public MergingReducer() : base() { } 34 35 35 protected override ScopeList Reduce(ScopeListscopes) {36 ScopeList reduced = new ScopeList();36 protected override List<IScope> Reduce(List<IScope> scopes) { 37 List<IScope> reduced = new List<IScope>(); 37 38 for (int i = 0; i < scopes.Count; i++) 38 39 reduced.AddRange(scopes[i].SubScopes); -
trunk/sources/HeuristicLab.Selection/3.3/ProportionalSelector.cs
r2818 r2830 51 51 } 52 52 53 protected override ScopeList Select(ScopeListscopes) {53 protected override IScope[] Select(List<IScope> scopes) { 54 54 int count = NumberOfSelectedSubScopesParameter.ActualValue.Value; 55 55 bool copy = CopySelectedParameter.Value.Value; … … 57 57 bool maximization = MaximizationParameter.ActualValue.Value; 58 58 bool windowing = WindowingParameter.Value.Value; 59 ScopeList selected = new ScopeList();59 IScope[] selected = new IScope[count]; 60 60 61 61 // prepare qualities for proportional selection … … 91 91 } 92 92 if (copy) 93 selected .Add((IScope)scopes[index].Clone());93 selected[i] = (IScope)scopes[index].Clone(); 94 94 else { 95 selected .Add(scopes[index]);95 selected[i] = scopes[index]; 96 96 scopes.RemoveAt(index); 97 97 qualitySum -= list[index]; -
trunk/sources/HeuristicLab.Selection/3.3/RandomSelector.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 public RandomSelector() : base() { } 34 35 35 protected override ScopeList Select(ScopeListscopes) {36 protected override IScope[] Select(List<IScope> scopes) { 36 37 int count = NumberOfSelectedSubScopesParameter.ActualValue.Value; 37 38 bool copy = CopySelectedParameter.Value.Value; 38 39 IRandom random = RandomParameter.ActualValue; 39 ScopeList selected = new ScopeList();40 IScope[] selected = new IScope[count]; 40 41 41 42 for (int i = 0; i < count; i++) { 42 43 if (copy) 43 selected .Add((IScope)scopes[random.Next(scopes.Count)].Clone());44 selected[i] = (IScope)scopes[random.Next(scopes.Count)].Clone(); 44 45 else { 45 46 int index = random.Next(scopes.Count); 46 selected .Add(scopes[index]);47 selected[i] = scopes[index]; 47 48 scopes.RemoveAt(index); 48 49 } -
trunk/sources/HeuristicLab.Selection/3.3/Reducer.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Operators; … … 46 47 47 48 public sealed override IExecutionSequence Apply() { 48 ScopeList scopes = new ScopeList(CurrentScope.SubScopes);49 ScopeListreduced = Reduce(scopes);49 List<IScope> scopes = new List<IScope>(CurrentScope.SubScopes); 50 List<IScope> reduced = Reduce(scopes); 50 51 51 52 CurrentScope.SubScopes.Clear(); … … 55 56 } 56 57 57 protected abstract ScopeList Reduce(ScopeListscopes);58 protected abstract List<IScope> Reduce(List<IScope> scopes); 58 59 } 59 60 } -
trunk/sources/HeuristicLab.Selection/3.3/RightReducer.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 public RightReducer() : base() { } 34 35 35 protected override ScopeList Reduce(ScopeListscopes) {36 ScopeList reduced = new ScopeList();36 protected override List<IScope> Reduce(List<IScope> scopes) { 37 List<IScope> reduced = new List<IScope>(); 37 38 if (scopes.Count > 0) reduced.AddRange(scopes[scopes.Count - 1].SubScopes); 38 39 return reduced; -
trunk/sources/HeuristicLab.Selection/3.3/RightSelector.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 public RightSelector() : base() { } 34 35 35 protected override ScopeList Select(ScopeListscopes) {36 protected override IScope[] Select(List<IScope> scopes) { 36 37 int count = NumberOfSelectedSubScopesParameter.ActualValue.Value; 37 38 bool copy = CopySelectedParameter.Value.Value; 38 ScopeList selected = new ScopeList();39 IScope[] selected = new IScope[count]; 39 40 40 41 int j = scopes.Count - 1; 41 42 for (int i = 0; i < count; i++) { 42 43 if (copy) { 43 selected .Add((IScope)scopes[j].Clone());44 selected[i] = (IScope)scopes[j].Clone(); 44 45 j--; 45 46 if (j < 0) j = scopes.Count - 1; 46 47 } else { 47 selected .Add(scopes[scopes.Count - 1]);48 selected[i] = scopes[scopes.Count - 1]; 48 49 scopes.RemoveAt(scopes.Count - 1); 49 50 } -
trunk/sources/HeuristicLab.Selection/3.3/Selector.cs
r2818 r2830 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 59 60 60 61 public sealed override IExecutionSequence Apply() { 61 ScopeList scopes = new ScopeList(CurrentScope.SubScopes);62 ScopeListselected = Select(scopes);62 List<IScope> scopes = new List<IScope>(CurrentScope.SubScopes); 63 IScope[] selected = Select(scopes); 63 64 64 65 CurrentScope.SubScopes.Clear(); … … 73 74 } 74 75 75 protected abstract ScopeList Select(ScopeListscopes);76 protected abstract IScope[] Select(List<IScope> scopes); 76 77 } 77 78 } -
trunk/sources/HeuristicLab.Selection/3.3/TournamentSelector.cs
r2818 r2830 44 44 } 45 45 46 protected override ScopeList Select(ScopeListscopes) {46 protected override IScope[] Select(List<IScope> scopes) { 47 47 int count = NumberOfSelectedSubScopesParameter.ActualValue.Value; 48 48 bool copy = CopySelectedParameter.Value.Value; … … 51 51 List<double> qualities = QualityParameter.ActualValue.Select(x => x.Value).ToList(); 52 52 int groupSize = GroupSizeParameter.ActualValue.Value; 53 ScopeList selected = new ScopeList();53 IScope[] selected = new IScope[count]; 54 54 55 55 for (int i = 0; i < count; i++) { … … 65 65 66 66 if (copy) 67 selected .Add((IScope)scopes[best].Clone());67 selected[i] = (IScope)scopes[best].Clone(); 68 68 else { 69 selected .Add(scopes[best]);69 selected[i] = scopes[best]; 70 70 scopes.RemoveAt(best); 71 71 qualities.RemoveAt(best);
Note: See TracChangeset
for help on using the changeset viewer.