Changeset 2818 for trunk/sources
- Timestamp:
- 02/17/10 05:24:03 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 deleted
- 63 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/Auxiliary.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Text; 25 24 using System.Windows.Forms; -
trunk/sources/HeuristicLab.Core.Views/3.3/CreateParameterDialog.cs
r2796 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Data;26 using System.Drawing;27 using System.Text;28 using System.Linq;29 23 using System.Windows.Forms; 30 using HeuristicLab.PluginInfrastructure;31 using HeuristicLab.Core;32 24 33 25 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.cs
r2796 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Text;28 23 using System.Windows.Forms; 29 using HeuristicLab.Core;30 24 using HeuristicLab.Common; 31 25 using HeuristicLab.MainForm; -
trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLabCoreViewsPlugin.cs.frame
r2796 r2818 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 22 using HeuristicLab.PluginInfrastructure; 26 23 -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs
r2790 r2818 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel;25 using System.Data;26 24 using System.Drawing; 27 using System.Text;28 25 using System.Windows.Forms; 29 26 using HeuristicLab.Collections; 30 using HeuristicLab.Common;31 27 using HeuristicLab.MainForm; 32 28 using HeuristicLab.MainForm.WindowsForms; -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r2790 r2818 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel;25 using System.Data;26 using System.Drawing;27 using System.Text;28 24 using System.Windows.Forms; 29 25 using HeuristicLab.Collections; 30 using HeuristicLab.Common;31 26 using HeuristicLab.MainForm; 32 27 using HeuristicLab.MainForm.WindowsForms; -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs
r2790 r2818 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel;25 using System.Data;26 24 using System.Drawing; 27 using System.Text;28 25 using System.Windows.Forms; 29 26 using HeuristicLab.Collections; 30 using HeuristicLab.Common;31 27 using HeuristicLab.MainForm; 32 28 using HeuristicLab.MainForm.WindowsForms; -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemSetView.cs
r2790 r2818 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 using System.ComponentModel;25 using System.Data;26 using System.Drawing;27 using System.Text;28 23 using System.Windows.Forms; 29 24 using HeuristicLab.Collections; 30 using HeuristicLab.Common;31 25 using HeuristicLab.MainForm; 32 26 -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemView.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Text;28 using System.Xml;29 using System.Windows.Forms;30 23 using HeuristicLab.MainForm; 31 24 using HeuristicLab.MainForm.WindowsForms; -
trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemCollectionView.cs
r2790 r2818 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 using System.ComponentModel;25 using System.Data;26 using System.Drawing;27 using System.Text;28 23 using System.Windows.Forms; 29 24 using HeuristicLab.Collections; 30 using HeuristicLab.Common;31 25 using HeuristicLab.MainForm; 32 26 -
trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemView.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.ComponentModel; 25 using System.Drawing;26 using System.Data;27 using System.Text;28 24 using System.Windows.Forms; 29 25 using HeuristicLab.MainForm; -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorCollectionView.cs
r2727 r2818 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Drawing; 5 using System.Data; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 1 using System.Windows.Forms; 2 using HeuristicLab.Collections; 9 3 using HeuristicLab.MainForm; 10 using HeuristicLab.Collections;11 4 12 5 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorGraphView.cs
r2801 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.ComponentModel; 25 24 using System.Drawing; 26 using System.Data;27 using System.Linq;28 using System.Text;29 25 using System.Windows.Forms; 30 using HeuristicLab.PluginInfrastructure;31 using HeuristicLab.Common;32 26 using HeuristicLab.MainForm; 33 using HeuristicLab.Collections;34 27 35 28 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorListView.cs
r2727 r2818 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Drawing; 5 using System.Data; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 1 using System.Windows.Forms; 2 using HeuristicLab.Collections; 9 3 using HeuristicLab.MainForm; 10 using HeuristicLab.Collections;11 4 12 5 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorSetView.cs
r2727 r2818 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Drawing; 5 using System.Data; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 1 using System.Windows.Forms; 2 using HeuristicLab.Collections; 9 3 using HeuristicLab.MainForm; 10 using HeuristicLab.Collections;11 4 12 5 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs
r2790 r2818 24 24 using System.ComponentModel; 25 25 using System.Drawing; 26 using System.Data;27 using System.Text;28 26 using System.Windows.Forms; 29 using HeuristicLab.PluginInfrastructure; 30 using HeuristicLab.Common; 27 using HeuristicLab.Collections; 31 28 using HeuristicLab.MainForm; 32 using HeuristicLab.Collections;33 29 34 30 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorsSidebar.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Text;28 23 using System.Windows.Forms; 29 using System.Linq;30 using HeuristicLab.MainForm;31 using HeuristicLab.MainForm.WindowsForms;32 24 33 25 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs
r2796 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Linq;28 using System.Text;29 23 using System.Windows.Forms; 24 using HeuristicLab.Collections; 30 25 using HeuristicLab.MainForm; 31 using HeuristicLab.Collections;32 26 33 27 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/ScopeListView.cs
r2727 r2818 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Drawing; 5 using System.Data; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 1 using HeuristicLab.Collections; 9 2 using HeuristicLab.MainForm; 10 using HeuristicLab.Collections;11 3 12 4 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.cs
r2790 r2818 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Text;28 24 using System.Windows.Forms; 29 using HeuristicLab.PluginInfrastructure; 30 using HeuristicLab.Common; 25 using HeuristicLab.Collections; 31 26 using HeuristicLab.MainForm; 32 using HeuristicLab.Collections;33 27 34 28 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.ComponentModel; 25 using System.Drawing; 26 using System.Data; 23 using System.Linq; 27 24 using System.Text; 28 25 using System.Windows.Forms; 29 using System.Linq;30 26 using HeuristicLab.Common; 31 27 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.MainForm;33 28 34 29 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelectorDialog.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections;24 using System.Collections.Generic;25 using System.ComponentModel;26 using System.Data;27 using System.Drawing;28 using System.Text;29 23 using System.Windows.Forms; 30 using HeuristicLab.PluginInfrastructure;31 24 32 25 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.cs
r2796 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Linq;28 using System.Text;29 23 using System.Windows.Forms; 24 using HeuristicLab.Collections; 30 25 using HeuristicLab.MainForm; 31 using HeuristicLab.Collections;32 26 33 27 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/VariableCollectionView.cs
r2727 r2818 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Drawing; 5 using System.Data; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 1 using HeuristicLab.Collections; 9 2 using HeuristicLab.MainForm; 10 using HeuristicLab.Collections;11 3 12 4 namespace HeuristicLab.Core.Views { -
trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Text;28 23 using System.Windows.Forms; 24 using HeuristicLab.Common; 29 25 using HeuristicLab.MainForm; 30 26 … … 95 91 } else { 96 92 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 97 dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType(). FullName;93 dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType().GetPrettyName(); 98 94 dataTypeTextBox.Enabled = Content.Value != null; 99 95 setValueButton.Enabled = Content.Value == null; … … 108 104 Invoke(new EventHandler(Content_ValueChanged), sender, e); 109 105 else { 110 dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType(). FullName;106 dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType().GetPrettyName(); 111 107 dataTypeTextBox.Enabled = Content.Value != null; 112 108 setValueButton.Enabled = Content.Value == null; -
trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.cs
r2817 r2818 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 25 using System.Drawing; 26 using System.Data; 27 using System.Text; 24 using System.Linq; 28 25 using System.Windows.Forms; 29 using System.Linq;30 26 using HeuristicLab.Common; 31 27 using HeuristicLab.MainForm; -
trunk/sources/HeuristicLab.Core/3.3/Variable.cs
r2793 r2818 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Text; 25 using System.Xml; 23 using HeuristicLab.Common; 26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common;28 25 29 26 namespace HeuristicLab.Core { … … 91 88 return string.Format("{0}: null", Name); 92 89 else 93 return string.Format("{0}: {1} ({2})", Name, Value.ToString(), Value.GetType(). Name);90 return string.Format("{0}: {1} ({2})", Name, Value.ToString(), Value.GetType().GetPrettyName()); 94 91 } 95 92 -
trunk/sources/HeuristicLab.Evolutionary/3.3/ChildrenCreator.cs
r2794 r2818 68 68 for (int i = 0; i < children; i++) { 69 69 IScope child = new Scope(i.ToString()); 70 for (int j = 0; j < parents ; j++) {70 for (int j = 0; j < parentsPerChild; j++) { 71 71 IScope parent = CurrentScope.SubScopes[0]; 72 72 CurrentScope.SubScopes.RemoveAt(0); -
trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj
r2805 r2818 94 94 <Compile Include="ParallelSubScopesProcessor.cs" /> 95 95 <Compile Include="Placeholder.cs" /> 96 <Compile Include="SingleCallOperator.cs" />97 96 <Compile Include="IntCounter.cs" /> 98 97 <Compile Include="ScopeCleaner.cs" /> -
trunk/sources/HeuristicLab.Operators/3.3/MultipleCallsOperator.cs
r2796 r2818 29 29 namespace HeuristicLab.Operators { 30 30 /// <summary> 31 /// A n operator which applies multiple operators sequentially on the current scope.31 /// A base class for operators which apply multiple user-defined operators. 32 32 /// </summary> 33 [Item("MultipleCallsOperator", "An operator which applies multiple operators sequentially on the current scope.")] 34 [Creatable("Test")] 35 public class MultipleCallsOperator : SingleSuccessorOperator { 33 [Item("MultipleCallsOperator", "A base class for operators which apply multiple user-defined operators.")] 34 public abstract class MultipleCallsOperator : SingleSuccessorOperator { 36 35 protected IValueParameter<IOperator>[] OperatorParameters { 37 36 get { … … 106 105 operators[index] = opParam.Value; 107 106 } 108 109 public override IExecutionSequence Apply() {110 ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());111 for (int i = Operators.Count - 1; i >= 0; i--)112 next.Insert(0, ExecutionContext.CreateContext(Operators[i]));113 return next;114 }115 107 } 116 108 } -
trunk/sources/HeuristicLab.Operators/3.3/SubScopesSorter.cs
r2794 r2818 58 58 public override IExecutionSequence Apply() { 59 59 descending = DescendingParameter.ActualValue.Value; 60 actualName = LookupParameter< DoubleData>.TranslateName(ValueParameter.Name, ExecutionContext);60 actualName = LookupParameter<ItemArray<DoubleData>>.TranslateName(ValueParameter.Name, ExecutionContext); 61 61 CurrentScope.SubScopes.Sort(SortScopes); 62 62 return base.Apply(); … … 67 67 IVariable var2; 68 68 x.Variables.TryGetValue(actualName, out var1); 69 x.Variables.TryGetValue(actualName, out var2);69 y.Variables.TryGetValue(actualName, out var2); 70 70 if ((var1 == null) && (var2 == null)) 71 71 return 0; -
trunk/sources/HeuristicLab.Operators/3.3/UniformParallelSubScopesProcessor.cs
r2796 r2818 31 31 [Creatable("Test")] 32 32 [EmptyStorableClass] 33 public sealed class UniformParallelSubScopesProcessor : SingleCallOperator { 33 public sealed class UniformParallelSubScopesProcessor : SingleSuccessorOperator { 34 private OperatorParameter OperatorParameter { 35 get { return (OperatorParameter)Parameters["Operator"]; } 36 } 37 public IOperator Operator { 38 get { return OperatorParameter.Value; } 39 set { OperatorParameter.Value = value; } 40 } 41 34 42 public UniformParallelSubScopesProcessor() 35 43 : base() { 36 Parameters.Remove("Operator");37 44 Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied on all sub-scopes of the current scope in parallel.")); 38 45 } -
trunk/sources/HeuristicLab.Operators/3.3/UniformSequentialSubScopesProcessor.cs
r2796 r2818 31 31 [Creatable("Test")] 32 32 [EmptyStorableClass] 33 public sealed class UniformSequentialSubScopesProcessor : SingleCallOperator { 33 public sealed class UniformSequentialSubScopesProcessor : SingleSuccessorOperator { 34 private OperatorParameter OperatorParameter { 35 get { return (OperatorParameter)Parameters["Operator"]; } 36 } 37 public IOperator Operator { 38 get { return OperatorParameter.Value; } 39 set { OperatorParameter.Value = value; } 40 } 41 34 42 public UniformSequentialSubScopesProcessor() 35 43 : base() { 36 Parameters.Remove("Operator");37 44 Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied sequentially on all sub-scopes of the current scope.")); 38 45 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/HeuristicLab.Parameters.Views-3.3.csproj
r2803 r2818 105 105 <Name>HeuristicLab.Common.Resources-3.2</Name> 106 106 </ProjectReference> 107 <ProjectReference Include="..\..\HeuristicLab.Common\3.2\HeuristicLab.Common-3.2.csproj"> 108 <Project>{1FC004FC-59AF-4249-B1B6-FF25873A20E4}</Project> 109 <Name>HeuristicLab.Common-3.2</Name> 110 </ProjectReference> 107 111 <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj"> 108 112 <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project> -
trunk/sources/HeuristicLab.Parameters.Views/3.3/HeuristicLabParametersViewsPlugin.cs.frame
r2790 r2818 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 22 using HeuristicLab.PluginInfrastructure; 26 23 … … 31 28 [Plugin("HeuristicLab.Parameters.Views", "3.3.0.$WCREV$")] 32 29 [PluginFile("HeuristicLab.Parameters.Views-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Common", "3.2")] 33 31 [PluginDependency("HeuristicLab.Common.Resources", "3.2")] 34 32 [PluginDependency("HeuristicLab.Core", "3.3")] -
trunk/sources/HeuristicLab.Parameters.Views/3.3/LookupParameterView.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Text;28 using System.Windows.Forms;29 23 using HeuristicLab.Core; 30 24 using HeuristicLab.Core.Views; … … 36 30 /// </summary> 37 31 [Content(typeof(LookupParameter<>), true)] 38 [Content(typeof(SubScopesLookupParameter<>), true)]39 32 [Content(typeof(ILookupParameter<>), false)] 40 33 public partial class LookupParameterView<T> : ParameterView where T : class, IItem { -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ParameterView.cs
r2790 r2818 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.ComponentModel; 25 using System.Drawing; 26 using System.Data; 27 using System.Text; 28 using System.Windows.Forms; 22 using HeuristicLab.Common; 29 23 using HeuristicLab.Core; 30 24 using HeuristicLab.Core.Views; … … 73 67 } else { 74 68 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 75 dataTypeTextBox.Text = Content.DataType. Name;69 dataTypeTextBox.Text = Content.DataType.GetPrettyName(); 76 70 dataTypeTextBox.Enabled = true; 77 71 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Text;28 23 using System.Windows.Forms; 29 24 using HeuristicLab.Core; -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.ComponentModel;25 using System.Drawing;26 using System.Data;27 using System.Text;28 23 using System.Windows.Forms; 29 24 using HeuristicLab.Core; -
trunk/sources/HeuristicLab.Parameters/3.3/HeuristicLabParametersPlugin.cs.frame
r2790 r2818 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 22 using HeuristicLab.PluginInfrastructure; 26 23 -
trunk/sources/HeuristicLab.Parameters/3.3/LookupParameter.cs
r2805 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 using System.Xml;26 23 using HeuristicLab.Common; 27 24 using HeuristicLab.Core; … … 71 68 72 69 public override string ToString() { 73 return string.Format("{0}: {1} ({2})", Name, ActualName, DataType. Name);74 } 75 76 private IValueParameter <T>GetParameter(out string name) {77 IValueParameter <T> valueParam = this as IValueParameter<T>;78 ILookupParameter <T> lookupParam = this as ILookupParameter<T>;70 return string.Format("{0}: {1} ({2})", Name, ActualName, DataType.GetPrettyName()); 71 } 72 73 private IValueParameter GetParameter(out string name) { 74 IValueParameter valueParam = this as IValueParameter; 75 ILookupParameter lookupParam = this as ILookupParameter; 79 76 ExecutionContext current = ExecutionContext; 80 77 81 78 name = Name; 82 while ((valueParam != null) &&(lookupParam != null)) {79 while ((valueParam != null) || (lookupParam != null)) { 83 80 if ((valueParam != null) && (valueParam.Value != null)) return valueParam; 84 81 if (lookupParam != null) name = lookupParam.ActualName; … … 89 86 90 87 if (current != null) { 91 valueParam = current.Operator.Parameters[name] as IValueParameter <T>;92 lookupParam = current.Operator.Parameters[name] as ILookupParameter <T>;88 valueParam = current.Operator.Parameters[name] as IValueParameter; 89 lookupParam = current.Operator.Parameters[name] as ILookupParameter; 93 90 if ((valueParam == null) && (lookupParam == null)) 94 91 throw new InvalidOperationException( 95 92 string.Format("Parameter look-up chain broken. Parameter \"{0}\" is not an \"{1}\" or an \"{2}\".", 96 93 name, 97 typeof(IValueParameter <T>).GetPrettyName(),98 typeof(ILookupParameter <T>).GetPrettyName())94 typeof(IValueParameter).GetPrettyName(), 95 typeof(ILookupParameter).GetPrettyName()) 99 96 ); 100 97 } else { … … 111 108 return scope != null ? scope.Variables[actualName] : null; 112 109 } 113 private IValueParameter <T>GetProblemParameter(string name) {114 IValueParameter <T>param = null;110 private IValueParameter GetProblemParameter(string name) { 111 IValueParameter param = null; 115 112 if (ExecutionContext.Problem.Parameters.ContainsKey(name)) { 116 param = ExecutionContext.Problem.Parameters[name] as IValueParameter <T>;113 param = ExecutionContext.Problem.Parameters[name] as IValueParameter; 117 114 if (param == null) 118 115 throw new InvalidOperationException( 119 116 string.Format("Parameter look-up chain broken. Parameter \"{0}\" is not an \"{1}\".", 120 117 name, 121 typeof(IValueParameter <T>).GetPrettyName())118 typeof(IValueParameter).GetPrettyName()) 122 119 ); 123 120 } … … 127 124 string name; 128 125 // try to get value from context stack 129 IValueParameter <T>param = GetParameter(out name);126 IValueParameter param = GetParameter(out name); 130 127 if (param != null) return param.Value; 131 128 … … 144 141 145 142 // try to get value from problem 146 IValueParameter <T>problemParam = GetProblemParameter(name);143 IValueParameter problemParam = GetProblemParameter(name); 147 144 if (problemParam != null) return problemParam.Value; 148 145 … … 158 155 // try to set value in context stack 159 156 string name; 160 IValueParameter <T>param = GetParameter(out name);157 IValueParameter param = GetParameter(out name); 161 158 if (param != null) { 162 159 param.Value = val; … … 172 169 173 170 // try to set value in problem 174 IValueParameter <T>problemParam = GetProblemParameter(name);171 IValueParameter problemParam = GetProblemParameter(name); 175 172 if (problemParam != null) { 176 173 problemParam.Value = val; … … 193 190 ExecutionContext currentContext = context; 194 191 IParameter param; 195 ILookupParameter <T>lookupParam;192 ILookupParameter lookupParam; 196 193 197 194 while (currentContext != null) { 198 195 currentContext.Operator.Parameters.TryGetValue(currentName, out param); 199 196 if (param != null) { 200 lookupParam = param as ILookupParameter <T>;197 lookupParam = param as ILookupParameter; 201 198 if (lookupParam == null) 202 199 throw new InvalidOperationException( 203 200 string.Format("Parameter look-up chain broken. Parameter \"{0}\" is not an \"{1}\".", 204 201 currentName, 205 typeof(ILookupParameter <T>).GetPrettyName())202 typeof(ILookupParameter).GetPrettyName()) 206 203 ); 207 204 currentName = lookupParam.ActualName; -
trunk/sources/HeuristicLab.Parameters/3.3/OperatorParameter.cs
r2790 r2818 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using System.Xml;26 22 using HeuristicLab.Core; 27 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
trunk/sources/HeuristicLab.Parameters/3.3/Parameter.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Text; 25 using System.Xml; 23 using HeuristicLab.Common; 26 24 using HeuristicLab.Core; 27 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 84 82 85 83 public override string ToString() { 86 return string.Format("{0} ({1})", Name, DataType. Name);84 return string.Format("{0} ({1})", Name, DataType.GetPrettyName()); 87 85 } 88 86 -
trunk/sources/HeuristicLab.Parameters/3.3/ScopeParameter.cs
r2790 r2818 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Text; 25 using System.Xml; 23 using HeuristicLab.Common; 26 24 using HeuristicLab.Core; 27 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 50 48 51 49 public override string ToString() { 52 return string.Format("{0} ({1})", Name, DataType. Name);50 return string.Format("{0} ({1})", Name, DataType.GetPrettyName()); 53 51 } 54 52 -
trunk/sources/HeuristicLab.Parameters/3.3/SubScopesLookupParameter.cs
r2796 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 using System.Xml;26 23 using HeuristicLab.Common; 27 24 using HeuristicLab.Core; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;29 25 30 26 namespace HeuristicLab.Parameters { … … 39 35 40 36 protected override IItem GetActualValue() { 41 string name = LookupParameter< T>.TranslateName(Name, ExecutionContext);37 string name = LookupParameter<ItemArray<T>>.TranslateName(Name, ExecutionContext); 42 38 IScope scope = ExecutionContext.Scope; 43 39 ItemArray<T> values = new ItemArray<T>(scope.SubScopes.Count); … … 68 64 ); 69 65 70 string name = LookupParameter< T>.TranslateName(Name, ExecutionContext);66 string name = LookupParameter<ItemArray<T>>.TranslateName(Name, ExecutionContext); 71 67 IScope scope = ExecutionContext.Scope; 72 68 IVariable var; -
trunk/sources/HeuristicLab.Parameters/3.3/ValueLookupParameter.cs
r2796 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 using System.Xml;26 23 using HeuristicLab.Common; 27 24 using HeuristicLab.Core; … … 85 82 86 83 public override string ToString() { 87 return string.Format("{0}: {1} ({2})", Name, Value != null ? Value.ToString() : ActualName, DataType. Name);84 return string.Format("{0}: {1} ({2})", Name, Value != null ? Value.ToString() : ActualName, DataType.GetPrettyName()); 88 85 } 89 86 -
trunk/sources/HeuristicLab.Parameters/3.3/ValueParameter.cs
r2796 r2818 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 using System.Xml;26 23 using HeuristicLab.Common; 27 24 using HeuristicLab.Core; … … 85 82 86 83 public override string ToString() { 87 return string.Format("{0}: {1} ({2})", Name, Value != null ? Value.ToString() : "null", DataType. Name);84 return string.Format("{0}: {1} ({2})", Name, Value != null ? Value.ToString() : "null", DataType.GetPrettyName()); 88 85 } 89 86 -
trunk/sources/HeuristicLab.Random/3.3/RandomCreator.cs
r2794 r2818 60 60 61 61 public override IExecutionSequence Apply() { 62 bool setSeedRandomly = SetSeedRandomlyParameter.ActualValue == null ? true : SetSeedRandomlyParameter.ActualValue.Value; 62 if (SetSeedRandomlyParameter.ActualValue == null) SetSeedRandomlyParameter.ActualValue = new BoolData(true); 63 bool setSeedRandomly = SetSeedRandomlyParameter.ActualValue.Value; 64 if (SeedParameter.ActualValue == null) SeedParameter.ActualValue = new IntData(0); 63 65 IntData seed = SeedParameter.ActualValue; 64 IRandom random = RandomParameter.ActualValue;65 66 66 if (seed == null) seed = new IntData(0);67 67 if (setSeedRandomly) seed.Value = new System.Random().Next(); 68 68 RandomParameter.ActualValue = new MersenneTwister((uint)seed.Value); -
trunk/sources/HeuristicLab.Selection/3.3/HeuristicLabSelectionPlugin.cs.frame
r2805 r2818 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 22 using HeuristicLab.PluginInfrastructure; 26 23 -
trunk/sources/HeuristicLab.Selection/3.3/LeftReducer.cs
r2817 r2818 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 using HeuristicLab.Parameters;26 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 24 -
trunk/sources/HeuristicLab.Selection/3.3/LeftSelector.cs
r2817 r2818 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 using HeuristicLab.Parameters;26 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 24 -
trunk/sources/HeuristicLab.Selection/3.3/LinearRankSelector.cs
r2817 r2818 21 21 22 22 using System.Linq; 23 using System.Collections.Generic;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; 26 using HeuristicLab.Parameters;27 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 26 … … 54 52 else 55 53 temp = temp.OrderByDescending(x => x.Value); 56 var list = temp.Select((x, lots) => new { x.index, lots}).ToList();54 var list = temp.Select((x, index) => new { x.index, lots = index + 1 }).ToList(); 57 55 58 56 int lotSum = list.Count * (list.Count + 1) / 2; -
trunk/sources/HeuristicLab.Selection/3.3/MergingReducer.cs
r2817 r2818 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 using HeuristicLab.Parameters;26 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 24 -
trunk/sources/HeuristicLab.Selection/3.3/ProportionalSelector.cs
r2817 r2818 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 22 24 using System.Linq; 23 using System.Collections.Generic;24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; 26 27 using HeuristicLab.Parameters; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using System;29 29 30 30 namespace HeuristicLab.Selection { … … 56 56 IRandom random = RandomParameter.ActualValue; 57 57 bool maximization = MaximizationParameter.ActualValue.Value; 58 List<DoubleData> qualities = new List<DoubleData>(QualityParameter.ActualValue);59 58 bool windowing = WindowingParameter.Value.Value; 60 59 ScopeList selected = new ScopeList(); 61 60 62 61 // prepare qualities for proportional selection 63 double minQuality = qualities.Min(x => x.Value); 64 double maxQuality = qualities.Max(x => x.Value); 62 var qualities = QualityParameter.ActualValue.Select(x => x.Value); 63 double minQuality = qualities.Min(); 64 double maxQuality = qualities.Max(); 65 65 if (minQuality == maxQuality) { // all quality values are equal 66 qualities .ForEach(x => x.Value = 1);66 qualities = qualities.Select(x => 1.0); 67 67 } else { 68 68 if (windowing) { 69 69 if (maximization) 70 qualities .ForEach(x => x.Value = x.Value- minQuality);70 qualities = qualities.Select(x => x - minQuality); 71 71 else 72 qualities .ForEach(x => x.Value = maxQuality - x.Value);72 qualities = qualities.Select(x => maxQuality - x); 73 73 } else { 74 74 if (minQuality < 0.0) throw new InvalidOperationException("Proportional selection without windowing does not work with quality values < 0."); 75 75 if (!maximization) { 76 76 double limit = Math.Min(maxQuality * 2, double.MaxValue); 77 qualities .ForEach(x => x.Value = limit - x.Value);77 qualities = qualities.Select(x => limit - x); 78 78 } 79 79 } 80 80 } 81 81 82 double qualitySum = qualities.Sum(x => x.Value); 82 List<double> list = qualities.ToList(); 83 double qualitySum = qualities.Sum(); 83 84 for (int i = 0; i < count; i++) { 84 85 double selectedQuality = random.NextDouble() * qualitySum; 85 86 int index = 0; 86 double currentQuality = qualities[index].Value;87 double currentQuality = list[index]; 87 88 while (currentQuality < selectedQuality) { 88 89 index++; 89 currentQuality += qualities[index].Value;90 currentQuality += list[index]; 90 91 } 91 92 if (copy) … … 94 95 selected.Add(scopes[index]); 95 96 scopes.RemoveAt(index); 96 qualitySum -= qualities[index].Value;97 qualities.RemoveAt(index);97 qualitySum -= list[index]; 98 list.RemoveAt(index); 98 99 } 99 100 } -
trunk/sources/HeuristicLab.Selection/3.3/RandomSelector.cs
r2817 r2818 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 using HeuristicLab.Parameters;26 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 24 -
trunk/sources/HeuristicLab.Selection/3.3/Reducer.cs
r2817 r2818 20 20 #endregion 21 21 22 using System;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 23 using HeuristicLab.Operators; 26 24 using HeuristicLab.Parameters; -
trunk/sources/HeuristicLab.Selection/3.3/RightReducer.cs
r2817 r2818 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 using HeuristicLab.Parameters;26 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 24 -
trunk/sources/HeuristicLab.Selection/3.3/RightSelector.cs
r2817 r2818 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 using HeuristicLab.Parameters;26 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 24 -
trunk/sources/HeuristicLab.Selection/3.3/Selector.cs
r2817 r2818 20 20 #endregion 21 21 22 using System;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Selection/3.3/StochasticSelector.cs
r2805 r2818 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Data;24 using HeuristicLab.Operators;25 23 using HeuristicLab.Parameters; 26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
trunk/sources/HeuristicLab.Selection/3.3/StochasticSingleObjectiveSelector.cs
r2805 r2818 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Data; 24 using HeuristicLab.Operators;25 24 using HeuristicLab.Parameters; 26 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
trunk/sources/HeuristicLab.Selection/3.3/TournamentSelector.cs
r2817 r2818 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 48 49 IRandom random = RandomParameter.ActualValue; 49 50 bool maximization = MaximizationParameter.ActualValue.Value; 50 List< DoubleData> qualities = new List<DoubleData>(QualityParameter.ActualValue);51 List<double> qualities = QualityParameter.ActualValue.Select(x => x.Value).ToList(); 51 52 int groupSize = GroupSizeParameter.ActualValue.Value; 52 53 ScopeList selected = new ScopeList(); … … 57 58 for (int j = 1; j < groupSize; j++) { 58 59 index = random.Next(scopes.Count); 59 if (((maximization) && (qualities[index] .Value > qualities[best].Value)) ||60 ((!maximization) && (qualities[index] .Value < qualities[best].Value))) {60 if (((maximization) && (qualities[index] > qualities[best])) || 61 ((!maximization) && (qualities[index] < qualities[best]))) { 61 62 best = index; 62 63 } -
trunk/sources/HeuristicLab.SequentialEngine/3.3/SequentialEngine.cs
r2790 r2818 62 62 for (int i = coll.Count - 1; i >= 0; i--) 63 63 ExecutionStack.Push(coll[i]); 64 next = ExecutionStack. Pop();64 next = ExecutionStack.Count > 0 ? ExecutionStack.Pop() : null; 65 65 coll = next as ExecutionContextCollection; 66 66 } 67 67 ExecutionContext context = next as ExecutionContext; 68 try { 69 currentOperator = context.Operator; 70 ExecutionStack.Push(context.Operator.Execute(context)); 71 currentOperator = null; 68 if (context != null) { 69 try { 70 currentOperator = context.Operator; 71 ExecutionStack.Push(context.Operator.Execute(context)); 72 currentOperator = null; 73 } 74 catch (Exception ex) { 75 ExecutionStack.Push(context); 76 Stop(); 77 OnExceptionOccurred(ex); 78 } 79 if (context.Operator.Breakpoint) 80 Stop(); 72 81 } 73 catch (Exception ex) {74 ExecutionStack.Push(context);75 Stop();76 OnExceptionOccurred(ex);77 }78 if (context.Operator.Breakpoint)79 Stop();80 82 } 81 83 }
Note: See TracChangeset
for help on using the changeset viewer.