Changeset 2891
- Timestamp:
- 03/01/10 04:46:06 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 18 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab 3.3.sln
r2888 r2891 70 70 {DC3D7072-7999-4719-B65D-3997744D5DC1} = {DC3D7072-7999-4719-B65D-3997744D5DC1} 71 71 {F42F3576-7233-4B28-90F7-36AE15F30F92} = {F42F3576-7233-4B28-90F7-36AE15F30F92} 72 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9} = {76945D76-CA61-4147-9DC2-0ACDCDDF87F9} 72 73 {57F38579-409D-4DD8-AB19-3F2C4A665126} = {57F38579-409D-4DD8-AB19-3F2C4A665126} 73 74 {BF7D9494-A586-457B-8DF9-ED599F9E6A71} = {BF7D9494-A586-457B-8DF9-ED599F9E6A71} 74 75 {600287A3-8714-453E-B875-A05F3EB72315} = {600287A3-8714-453E-B875-A05F3EB72315} 76 {887425B4-4348-49ED-A457-B7D2C26DDBF9} = {887425B4-4348-49ED-A457-B7D2C26DDBF9} 75 77 {F4539FB6-4708-40C9-BE64-0A1390AEA197} = {F4539FB6-4708-40C9-BE64-0A1390AEA197} 76 78 {958B43BC-CC5C-4FA2-8628-2B3B01D890B6} = {958B43BC-CC5C-4FA2-8628-2B3B01D890B6} … … 165 167 EndProject 166 168 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.SGA.Views-3.3", "HeuristicLab.Algorithms.SGA.Views\3.3\HeuristicLab.Algorithms.SGA.Views-3.3.csproj", "{35A42EE0-A896-4D7A-A99F-8ED9E925F320}" 169 EndProject 170 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Analysis-3.3", "HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj", "{887425B4-4348-49ED-A457-B7D2C26DDBF9}" 171 EndProject 172 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Analysis.Views-3.3", "HeuristicLab.Analysis.Views\3.3\HeuristicLab.Analysis.Views-3.3.csproj", "{76945D76-CA61-4147-9DC2-0ACDCDDF87F9}" 167 173 EndProject 168 174 Global … … 717 723 {35A42EE0-A896-4D7A-A99F-8ED9E925F320}.Release|x64.ActiveCfg = Release|Any CPU 718 724 {35A42EE0-A896-4D7A-A99F-8ED9E925F320}.Release|x86.ActiveCfg = Release|Any CPU 725 {887425B4-4348-49ED-A457-B7D2C26DDBF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 726 {887425B4-4348-49ED-A457-B7D2C26DDBF9}.Debug|Any CPU.Build.0 = Debug|Any CPU 727 {887425B4-4348-49ED-A457-B7D2C26DDBF9}.Debug|x64.ActiveCfg = Debug|Any CPU 728 {887425B4-4348-49ED-A457-B7D2C26DDBF9}.Debug|x86.ActiveCfg = Debug|Any CPU 729 {887425B4-4348-49ED-A457-B7D2C26DDBF9}.Release|Any CPU.ActiveCfg = Release|Any CPU 730 {887425B4-4348-49ED-A457-B7D2C26DDBF9}.Release|Any CPU.Build.0 = Release|Any CPU 731 {887425B4-4348-49ED-A457-B7D2C26DDBF9}.Release|x64.ActiveCfg = Release|Any CPU 732 {887425B4-4348-49ED-A457-B7D2C26DDBF9}.Release|x86.ActiveCfg = Release|Any CPU 733 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 734 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9}.Debug|Any CPU.Build.0 = Debug|Any CPU 735 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9}.Debug|x64.ActiveCfg = Debug|Any CPU 736 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9}.Debug|x86.ActiveCfg = Debug|Any CPU 737 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9}.Release|Any CPU.ActiveCfg = Release|Any CPU 738 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9}.Release|Any CPU.Build.0 = Release|Any CPU 739 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9}.Release|x64.ActiveCfg = Release|Any CPU 740 {76945D76-CA61-4147-9DC2-0ACDCDDF87F9}.Release|x86.ActiveCfg = Release|Any CPU 719 741 EndGlobalSection 720 742 GlobalSection(SolutionProperties) = preSolution -
trunk/sources/HeuristicLab 3.3/Files.txt
r2888 r2891 6 6 HeuristicLab.Algorithms.SGA\3.3:HeuristicLab.Algorithms.SGA-3.3.dll 7 7 HeuristicLab.Algorithms.SGA.Views\3.3:HeuristicLab.Algorithms.SGA.Views-3.3.dll 8 HeuristicLab.Analysis\3.3:HeuristicLab.Analysis-3.3.dll 9 HeuristicLab.Analysis.Views\3.3:HeuristicLab.Analysis.Views-3.3.dll 8 10 HeuristicLab.Charting\3.3:HeuristicLab.Charting-3.3.dll 9 11 HeuristicLab.Charting.Data\3.3:HeuristicLab.Charting.Data-3.3.dll -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/HeuristicLab.Algorithms.SGA-3.3.csproj
r2884 r2891 88 88 </ItemGroup> 89 89 <ItemGroup> 90 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 91 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 92 <Name>HeuristicLab.Analysis-3.3</Name> 93 </ProjectReference> 90 94 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 91 95 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/HeuristicLabAlgorithmsSGAPlugin.cs.frame
r2884 r2891 28 28 [Plugin("HeuristicLab.Algorithms.SGA", "3.3.0.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Algorithms.SGA-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] 30 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 32 [PluginDependency("HeuristicLab.Core", "3.3")] -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGA.cs
r2890 r2891 43 43 private SGAOperator sgaOperator; 44 44 45 private OptionalValueParameter<IntData> PopulationSizeParameter {46 get { return ( OptionalValueParameter<IntData>)Parameters["PopulationSize"]; }45 private ValueParameter<IntData> PopulationSizeParameter { 46 get { return (ValueParameter<IntData>)Parameters["PopulationSize"]; } 47 47 } 48 48 private ConstrainedValueParameter<ISelector> SelectorParameter { … … 55 55 get { return (ConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; } 56 56 } 57 private OptionalValueParameter<IntData> ElitesParameter {58 get { return ( OptionalValueParameter<IntData>)Parameters["Elites"]; }57 private ValueParameter<IntData> ElitesParameter { 58 get { return (ValueParameter<IntData>)Parameters["Elites"]; } 59 59 } 60 60 … … 69 69 public SGA() 70 70 : base() { 71 Parameters.Add(new OptionalValueParameter<IntData>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntData(0)));72 Parameters.Add(new OptionalValueParameter<BoolData>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolData(true)));73 Parameters.Add(new OptionalValueParameter<IntData>("PopulationSize", "The size of the population of solutions.", new IntData(100)));71 Parameters.Add(new ValueParameter<IntData>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntData(0))); 72 Parameters.Add(new ValueParameter<BoolData>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolData(true))); 73 Parameters.Add(new ValueParameter<IntData>("PopulationSize", "The size of the population of solutions.", new IntData(100))); 74 74 Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction.")); 75 75 Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions.")); 76 Parameters.Add(new OptionalValueParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new DoubleData(0.05)));76 Parameters.Add(new ValueParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new DoubleData(0.05))); 77 77 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 78 Parameters.Add(new OptionalValueParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation.", new IntData(1)));79 Parameters.Add(new OptionalValueParameter<IntData>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntData(1000)));78 Parameters.Add(new ValueParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation.", new IntData(1))); 79 Parameters.Add(new ValueParameter<IntData>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntData(1000))); 80 80 81 81 PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged); -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGAOperator.cs
r2890 r2891 20 20 #endregion 21 21 22 using HeuristicLab.Analysis; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 112 113 IntCounter intCounter = new IntCounter(); 113 114 Comparator comparator = new Comparator(); 115 BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator = new BestAverageWorstQualityCalculator(); 114 116 ResultsCollector resultsCollector = new ResultsCollector(); 115 117 ConditionalBranch conditionalBranch = new ConditionalBranch(); … … 179 181 comparator.ResultParameter.ActualName = "Terminate"; 180 182 comparator.RightSideParameter.ActualName = "MaximumGenerations"; 181 comparator.Successor = resultsCollector; 182 183 SubScopesLookupParameter<DoubleData> quality = new SubScopesLookupParameter<DoubleData>("Qualities"); 184 quality.ActualName = "Quality"; 185 resultsCollector.CollectedValues.Add(quality); 183 comparator.Successor = bestAverageWorstQualityCalculator; 184 185 bestAverageWorstQualityCalculator.AverageQualityParameter.ActualName = "AverageQuality"; 186 bestAverageWorstQualityCalculator.BestQualityParameter.ActualName = "BestQuality"; 187 bestAverageWorstQualityCalculator.MaximizationParameter.ActualName = "Maximization"; 188 bestAverageWorstQualityCalculator.QualityParameter.ActualName = "Quality"; 189 bestAverageWorstQualityCalculator.WorstQualityParameter.ActualName = "WorstQuality"; 190 bestAverageWorstQualityCalculator.Successor = resultsCollector; 191 192 LookupParameter<DoubleData> bestQuality = new LookupParameter<DoubleData>("BestQuality"); 193 bestQuality.ActualName = "BestQuality"; 194 resultsCollector.CollectedValues.Add(bestQuality); 195 LookupParameter<DoubleData> averageQuality = new LookupParameter<DoubleData>("AverageQuality"); 196 averageQuality.ActualName = "AverageQuality"; 197 resultsCollector.CollectedValues.Add(averageQuality); 198 LookupParameter<DoubleData> worstQuality = new LookupParameter<DoubleData>("WorstQuality"); 199 worstQuality.ActualName = "WorstQuality"; 200 resultsCollector.CollectedValues.Add(worstQuality); 186 201 resultsCollector.ResultsParameter.ActualName = "Results"; 187 202 resultsCollector.Successor = conditionalBranch; -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/Tests/HeuristicLab.Algorithms.SGA-3.3.Tests.csproj
r2884 r2891 46 46 </ItemGroup> 47 47 <ItemGroup> 48 <ProjectReference Include="..\..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 49 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 50 <Name>HeuristicLab.Analysis-3.3</Name> 51 </ProjectReference> 48 52 <ProjectReference Include="..\..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 49 53 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/HeuristicLab.Operators.Views.GraphVisualization-3.3.csproj
r2861 r2891 132 132 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.Netron\3.0.2672.12446\HeuristicLab.Netron-3.0.2672.12446\HeuristicLab.Netron-3.0.2672.12446.csproj"> 133 133 <Project>{BB994448-2B21-4564-BB2E-38D8FFF8CF18}</Project> 134 <Name>HeuristicLab.Netron-3.0.2672.12446 </Name>134 <Name>HeuristicLab.Netron-3.0.2672.12446 %28HeuristicLab.ExtLibs\HeuristicLab.Netron\HeuristicLab.Netron-3.0.2672.12446\HeuristicLab.Netron-3.0.2672.12446%29</Name> 135 135 </ProjectReference> 136 136 <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.Netron\3.0.2672.12446\Netron.Diagramming.Core-3.0.2672.12446\Netron.Diagramming.Core-3.0.2672.12446.csproj"> -
trunk/sources/HeuristicLab.Operators/3.3/Comparator.cs
r2890 r2891 40 40 get { return (ValueLookupParameter<IItem>)Parameters["RightSide"]; } 41 41 } 42 private OptionalValueParameter<ComparisonData> ComparisonParameter {43 get { return ( OptionalValueParameter<ComparisonData>)Parameters["Comparison"]; }42 private ValueParameter<ComparisonData> ComparisonParameter { 43 get { return (ValueParameter<ComparisonData>)Parameters["Comparison"]; } 44 44 } 45 45 public LookupParameter<BoolData> ResultParameter { … … 55 55 Parameters.Add(new LookupParameter<IItem>("LeftSide", "The left side of the comparison.")); 56 56 Parameters.Add(new ValueLookupParameter<IItem>("RightSide", "The right side of the comparison.")); 57 Parameters.Add(new OptionalValueParameter<ComparisonData>("Comparison", "The type of comparison.", new ComparisonData()));57 Parameters.Add(new ValueParameter<ComparisonData>("Comparison", "The type of comparison.", new ComparisonData(Data.Comparison.Equal))); 58 58 Parameters.Add(new LookupParameter<BoolData>("Result", "The result of the comparison.")); 59 59 } -
trunk/sources/HeuristicLab.Operators/3.3/SubScopesRemover.cs
r2890 r2891 33 33 [Creatable("Test")] 34 34 public sealed class SubScopesRemover : SingleSuccessorOperator { 35 private OptionalValueParameter<BoolData> RemoveAllSubScopesParameter {36 get { return ( OptionalValueParameter<BoolData>)Parameters["RemoveAllSubScopes"]; }35 private ValueParameter<BoolData> RemoveAllSubScopesParameter { 36 get { return (ValueParameter<BoolData>)Parameters["RemoveAllSubScopes"]; } 37 37 } 38 38 public ValueLookupParameter<IntData> SubScopeIndexParameter { … … 53 53 public SubScopesRemover() 54 54 : base() { 55 Parameters.Add(new OptionalValueParameter<BoolData>("RemoveAllSubScopes", "True if all sub-scopes of the current scope should be removed, otherwise false.", new BoolData(true)));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 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.")); 57 57 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope from which one or all sub-scopes should be removed.")); -
trunk/sources/HeuristicLab.Parameters.Views/3.3/HeuristicLab.Parameters.Views-3.3.csproj
r2852 r2891 74 74 <Compile Include="ConstrainedValueParameterView.Designer.cs"> 75 75 <DependentUpon>ConstrainedValueParameterView.cs</DependentUpon> 76 </Compile> 77 <Compile Include="OptionalValueParameterView.cs"> 78 <SubType>UserControl</SubType> 79 </Compile> 80 <Compile Include="OptionalValueParameterView.Designer.cs"> 81 <DependentUpon>OptionalValueParameterView.cs</DependentUpon> 76 82 </Compile> 77 83 <Compile Include="ValueLookupParameterView.cs"> -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.Designer.cs
r2796 r2891 33 33 protected override void Dispose(bool disposing) { 34 34 if (disposing) { 35 if (typeSelectorDialog != null) typeSelectorDialog.Dispose();36 35 if (components != null) components.Dispose(); 37 36 } … … 46 45 /// </summary> 47 46 private void InitializeComponent() { 48 this.components = new System.ComponentModel.Container();49 47 this.valueGroupBox = new System.Windows.Forms.GroupBox(); 50 48 this.valuePanel = new System.Windows.Forms.Panel(); 51 49 this.viewHost = new HeuristicLab.Core.Views.ViewHost(); 52 this.clearValueButton = new System.Windows.Forms.Button();53 this.setValueButton = new System.Windows.Forms.Button();54 this.toolTip = new System.Windows.Forms.ToolTip(this.components);55 50 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 56 51 this.valueGroupBox.SuspendLayout(); … … 81 76 | System.Windows.Forms.AnchorStyles.Right))); 82 77 this.valueGroupBox.Controls.Add(this.valuePanel); 83 this.valueGroupBox.Controls.Add(this.clearValueButton);84 this.valueGroupBox.Controls.Add(this.setValueButton);85 78 this.valueGroupBox.Location = new System.Drawing.Point(0, 120); 86 79 this.valueGroupBox.Name = "valueGroupBox"; … … 97 90 | System.Windows.Forms.AnchorStyles.Right))); 98 91 this.valuePanel.Controls.Add(this.viewHost); 99 this.valuePanel.Location = new System.Drawing.Point(6, 49);92 this.valuePanel.Location = new System.Drawing.Point(6, 19); 100 93 this.valuePanel.Name = "valuePanel"; 101 this.valuePanel.Size = new System.Drawing.Size(374, 1 40);94 this.valuePanel.Size = new System.Drawing.Size(374, 170); 102 95 this.valuePanel.TabIndex = 0; 103 96 this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver); … … 111 104 this.viewHost.Location = new System.Drawing.Point(0, 0); 112 105 this.viewHost.Name = "viewHost"; 113 this.viewHost.Size = new System.Drawing.Size(374, 1 40);106 this.viewHost.Size = new System.Drawing.Size(374, 170); 114 107 this.viewHost.TabIndex = 0; 115 // 116 // clearValueButton 117 // 118 this.clearValueButton.Enabled = false; 119 this.clearValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove; 120 this.clearValueButton.Location = new System.Drawing.Point(36, 19); 121 this.clearValueButton.Name = "clearValueButton"; 122 this.clearValueButton.Size = new System.Drawing.Size(24, 24); 123 this.clearValueButton.TabIndex = 1; 124 this.toolTip.SetToolTip(this.clearValueButton, "Clear Value"); 125 this.clearValueButton.UseVisualStyleBackColor = true; 126 this.clearValueButton.Click += new System.EventHandler(this.clearValueButton_Click); 127 // 128 // setValueButton 129 // 130 this.setValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Add; 131 this.setValueButton.Location = new System.Drawing.Point(6, 19); 132 this.setValueButton.Name = "setValueButton"; 133 this.setValueButton.Size = new System.Drawing.Size(24, 24); 134 this.setValueButton.TabIndex = 0; 135 this.toolTip.SetToolTip(this.setValueButton, "Set Value"); 136 this.setValueButton.UseVisualStyleBackColor = true; 137 this.setValueButton.Click += new System.EventHandler(this.setValueButton_Click); 108 this.viewHost.ViewType = null; 138 109 // 139 110 // ValueParameterView … … 164 135 protected System.Windows.Forms.Panel valuePanel; 165 136 protected HeuristicLab.Core.Views.ViewHost viewHost; 166 protected System.Windows.Forms.Button setValueButton;167 protected System.Windows.Forms.ToolTip toolTip;168 protected System.Windows.Forms.Button clearValueButton;169 137 } 170 138 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
r2890 r2891 30 30 /// The visual representation of a <see cref="Parameter"/>. 31 31 /// </summary> 32 [Content(typeof(OptionalValueParameter<>), true)] 33 [Content(typeof(IValueParameter<>), false)] 32 [Content(typeof(ValueParameter<>), true)] 34 33 public partial class ValueParameterView<T> : ParameterView where T : class, IItem { 35 protected TypeSelectorDialog typeSelectorDialog;36 37 34 /// <summary> 38 35 /// Gets or sets the variable to represent visually. … … 40 37 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 41 38 /// No own data storage present.</remarks> 42 public new IValueParameter<T> Content {43 get { return ( IValueParameter<T>)base.Content; }39 public new ValueParameter<T> Content { 40 get { return (ValueParameter<T>)base.Content; } 44 41 set { base.Content = value; } 45 42 } … … 57 54 /// <remarks>Calls <see cref="VariableView()"/>.</remarks> 58 55 /// <param name="variable">The variable to represent visually.</param> 59 public ValueParameterView( IValueParameter<T> content)56 public ValueParameterView(ValueParameter<T> content) 60 57 : this() { 61 58 Content = content; … … 84 81 if (Content == null) { 85 82 Caption = "ValueParameter"; 86 setValueButton.Enabled = false;87 clearValueButton.Enabled = false;88 83 viewHost.Content = null; 89 84 valueGroupBox.Enabled = false; 90 85 } else { 91 86 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 92 setValueButton.Enabled = Content.Value == null;93 clearValueButton.Enabled = Content.Value != null;94 87 valueGroupBox.Enabled = true; 95 88 viewHost.Content = Content.Value; … … 101 94 Invoke(new EventHandler(Content_ValueChanged), sender, e); 102 95 else { 103 setValueButton.Enabled = Content.Value == null;104 clearValueButton.Enabled = Content.Value != null;105 96 viewHost.Content = Content.Value; 106 97 } 107 98 } 108 99 109 protected virtual void setValueButton_Click(object sender, EventArgs e) {110 if (typeSelectorDialog == null) {111 typeSelectorDialog = new TypeSelectorDialog();112 typeSelectorDialog.Caption = "Select Value";113 typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, false);114 }115 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK)116 Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();117 }118 protected virtual void clearValueButton_Click(object sender, EventArgs e) {119 Content.Value = null;120 }121 100 protected virtual void valuePanel_DragEnterOver(object sender, DragEventArgs e) { 122 101 e.Effect = DragDropEffects.None; -
trunk/sources/HeuristicLab.Parameters/3.3/HeuristicLab.Parameters-3.3.csproj
r2890 r2891 68 68 <None Include="HeuristicLabParametersPlugin.cs.frame" /> 69 69 <Compile Include="ConstrainedValueParameter.cs" /> 70 <Compile Include="ValueParameter.cs" /> 70 71 <Compile Include="LookupParameter.cs" /> 71 72 <Compile Include="OptionalValueParameter.cs" /> -
trunk/sources/HeuristicLab.Parameters/3.3/OptionalValueParameter.cs
r2890 r2891 27 27 namespace HeuristicLab.Parameters { 28 28 /// <summary> 29 /// A parameter whose value is defined it the parameter itself . The value of the parameter can be null, if the parameter is not set.29 /// A parameter whose value is defined it the parameter itself or is null. 30 30 /// </summary> 31 [Item("OptionalValueParameter<T>", "A parameter whose value is defined it the parameter itself . The value of the parameter can be null, if the parameter is not set.")]31 [Item("OptionalValueParameter<T>", "A parameter whose value is defined it the parameter itself or is null.")] 32 32 public class OptionalValueParameter<T> : Parameter, IValueParameter<T> where T : class, IItem { 33 33 private T value; -
trunk/sources/HeuristicLab.Problems.TSP/3.3/TSP.cs
r2890 r2891 75 75 public TSP() 76 76 : base() { 77 Parameters.Add(new OptionalValueParameter<BoolData>("Maximization", "Set to false as the Traveling Salesman Problem is a minimization problem.", new BoolData(false))); 78 Parameters.Add(new OptionalValueParameter<DoubleMatrixData>("Coordinates", "The x- and y-Coordinates of the cities.", new DoubleMatrixData(0, 0))); 79 Parameters.Add(new OptionalValueParameter<IPermutationCreator>("SolutionCreator", "The operator which should be used to create new TSP solutions.")); 80 Parameters.Add(new OptionalValueParameter<ITSPEvaluator>("Evaluator", "The operator which should be used to evaluate TSP solutions.")); 77 RandomPermutationCreator creator = new RandomPermutationCreator(); 78 TSPRoundedEuclideanPathEvaluator evaluator = new TSPRoundedEuclideanPathEvaluator(); 79 80 Parameters.Add(new ValueParameter<BoolData>("Maximization", "Set to false as the Traveling Salesman Problem is a minimization problem.", new BoolData(false))); 81 Parameters.Add(new ValueParameter<DoubleMatrixData>("Coordinates", "The x- and y-Coordinates of the cities.", new DoubleMatrixData(0, 0))); 82 Parameters.Add(new ValueParameter<IPermutationCreator>("SolutionCreator", "The operator which should be used to create new TSP solutions.", creator)); 83 Parameters.Add(new ValueParameter<ITSPEvaluator>("Evaluator", "The operator which should be used to evaluate TSP solutions.", evaluator)); 81 84 Parameters.Add(new OptionalValueParameter<DoubleData>("BestKnownQuality", "The quality of the best known solution of this TSP instance.")); 85 86 creator.PermutationParameter.ActualName = "TSPTour"; 87 creator.LengthParameter.Value = new IntData(0); 88 evaluator.CoordinatesParameter.ActualName = CoordinatesParameter.Name; 89 evaluator.PermutationParameter.ActualName = creator.PermutationParameter.ActualName; 90 evaluator.QualityParameter.ActualName = "TSPTourLength"; 82 91 83 92 MaximizationParameter.ValueChanged += new EventHandler(MaximizationParameter_ValueChanged); 84 93 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 85 94 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); 86 87 RandomPermutationCreator creator = new RandomPermutationCreator();88 creator.PermutationParameter.ActualName = "TSPTour";89 creator.LengthParameter.Value = new IntData(0);90 SolutionCreatorParameter.Value = creator;91 TSPRoundedEuclideanPathEvaluator evaluator = new TSPRoundedEuclideanPathEvaluator();92 evaluator.CoordinatesParameter.ActualName = CoordinatesParameter.Name;93 evaluator.PermutationParameter.ActualName = creator.PermutationParameter.ActualName;94 evaluator.QualityParameter.ActualName = "TSPTourLength";95 EvaluatorParameter.Value = evaluator;96 95 97 96 var ops = ApplicationManager.Manager.GetInstances<IPermutationOperator>(); -
trunk/sources/HeuristicLab.Selection/3.3/ProportionalSelector.cs
r2890 r2891 36 36 [Creatable("Test")] 37 37 public sealed class ProportionalSelector : StochasticSingleObjectiveSelector { 38 private OptionalValueParameter<BoolData> WindowingParameter {39 get { return ( OptionalValueParameter<BoolData>)Parameters["Windowing"]; }38 private ValueParameter<BoolData> WindowingParameter { 39 get { return (ValueParameter<BoolData>)Parameters["Windowing"]; } 40 40 } 41 41 … … 47 47 public ProportionalSelector() 48 48 : base() { 49 Parameters.Add(new OptionalValueParameter<BoolData>("Windowing", "Apply windowing strategy (selection probability is proportional to the quality differences and not to the total quality).", new BoolData(true)));49 Parameters.Add(new ValueParameter<BoolData>("Windowing", "Apply windowing strategy (selection probability is proportional to the quality differences and not to the total quality).", new BoolData(true))); 50 50 CopySelected.Value = true; 51 51 } -
trunk/sources/HeuristicLab.Selection/3.3/Selector.cs
r2890 r2891 35 35 [EmptyStorableClass] 36 36 public abstract class Selector : SingleSuccessorOperator, ISelector { 37 protected OptionalValueParameter<BoolData> CopySelectedParameter {38 get { return ( OptionalValueParameter<BoolData>)Parameters["CopySelected"]; }37 protected ValueParameter<BoolData> CopySelectedParameter { 38 get { return (ValueParameter<BoolData>)Parameters["CopySelected"]; } 39 39 } 40 40 public IValueLookupParameter<IntData> NumberOfSelectedSubScopesParameter { … … 55 55 protected Selector() 56 56 : base() { 57 Parameters.Add(new OptionalValueParameter<BoolData>("CopySelected", "True if the selected sub-scopes should be copied, otherwise false.", new BoolData(false)));57 Parameters.Add(new ValueParameter<BoolData>("CopySelected", "True if the selected sub-scopes should be copied, otherwise false.", new BoolData(false))); 58 58 Parameters.Add(new ValueLookupParameter<IntData>("NumberOfSelectedSubScopes", "The number of sub-scopes which should be selected.")); 59 59 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope from which sub-scopes should be selected."));
Note: See TracChangeset
for help on using the changeset viewer.