Changeset 5344 for branches/OKB (trunk integration)
- Timestamp:
- 01/21/11 03:53:10 (14 years ago)
- Location:
- branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3
- Files:
-
- 12 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/HeuristicLab.Clients.OKB-3.3.csproj
r5338 r5344 66 66 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 67 67 </Reference> 68 <Reference Include="HeuristicLab.Operators-3.3"> 69 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath> 70 </Reference> 68 71 <Reference Include="HeuristicLab.Optimization-3.3"> 69 72 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath> … … 74 77 <Reference Include="HeuristicLab.Optimizer-3.3"> 75 78 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimizer-3.3.dll</HintPath> 79 </Reference> 80 <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 81 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath> 76 82 </Reference> 77 83 <Reference Include="HeuristicLab.Persistence-3.3"> … … 94 100 <ItemGroup> 95 101 <Compile Include="AdministratorMenuItem.cs" /> 102 <Compile Include="EmptyAlgorithm.cs" /> 103 <Compile Include="OKBAlgorithm.cs" /> 104 <Compile Include="MultiObjectiveOKBProblem.cs" /> 105 <Compile Include="EmptyMultiObjectiveProblem.cs" /> 106 <Compile Include="EmptyEvaluator.cs" /> 107 <Compile Include="EmptyProblem.cs" /> 108 <Compile Include="EmptyMultiObjectiveEvaluator.cs" /> 109 <Compile Include="EmptySolutionCreator.cs" /> 110 <Compile Include="EmptySingleObjectiveEvaluator.cs" /> 111 <Compile Include="EmptySingleObjectiveProblem.cs" /> 96 112 <Compile Include="SingleObjectiveOKBProblem.cs" /> 97 113 <Compile Include="OKBProblem.cs" /> … … 184 200 <DependentUpon>AlgorithmParameterView.cs</DependentUpon> 185 201 </Compile> 202 <Compile Include="Views\OKBAlgorithmView.cs"> 203 <SubType>UserControl</SubType> 204 </Compile> 205 <Compile Include="Views\OKBAlgorithmView.Designer.cs"> 206 <DependentUpon>OKBAlgorithmView.cs</DependentUpon> 207 </Compile> 186 208 <Compile Include="Views\OKBProblemView.cs"> 187 209 <SubType>UserControl</SubType> … … 390 412 <None Include="HeuristicLab.snk" /> 391 413 <None Include="HeuristicLabClientsOKBPlugin.cs.frame" /> 392 </ItemGroup>393 <ItemGroup>394 <EmbeddedResource Include="Views\OKBProblemView.resx">395 <DependentUpon>OKBProblemView.cs</DependentUpon>396 </EmbeddedResource>397 414 </ItemGroup> 398 415 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/HeuristicLabClientsOKBPlugin.cs.frame
r4943 r5344 37 37 [PluginDependency("HeuristicLab.MainForm", "3.3")] 38 38 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 39 [PluginDependency("HeuristicLab.Operators", "3.3")] 39 40 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 41 [PluginDependency("HeuristicLab.Optimization.Views", "3.3")] 41 42 [PluginDependency("HeuristicLab.Optimizer", "3.3")] 43 [PluginDependency("HeuristicLab.Parameters", "3.3")] 42 44 [PluginDependency("HeuristicLab.Persistence", "3.3")] 43 45 public class HeuristicLabClientsOKBPlugin : PluginBase { -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/OKBProblem.cs
r5338 r5344 24 24 using System.Drawing; 25 25 using System.IO; 26 using System.Linq;27 26 using HeuristicLab.Common; 28 27 using HeuristicLab.Core; … … 32 31 33 32 namespace HeuristicLab.Clients.OKB { 34 [Item("OKB Problem", " Represents a problem which isstored in the OKB.")]33 [Item("OKB Problem", "A base class for problems which are stored in the OKB.")] 35 34 [StorableClass] 36 public class OKBProblem : Item, IProblem, IStorableContent { 37 public string Filename { get; set; } 38 39 public override Image ItemImage { 40 get { return Problem == null ? HeuristicLab.Common.Resources.VSImageLibrary.Type : Problem.ItemImage; } 41 } 42 43 public string Name { 44 get { return Problem == null ? ItemName : Problem.Name; } 45 set { throw new NotSupportedException("Name cannot be changed."); } 46 } 47 public string Description { 48 get { return Problem == null ? ItemDescription : Problem.Description; } 49 set { throw new NotSupportedException("Description cannot be changed."); } 50 } 51 public bool CanChangeName { 52 get { return false; } 53 } 54 public bool CanChangeDescription { 55 get { return false; } 56 } 57 58 public IKeyedItemCollection<string, IParameter> Parameters { 59 get { return Problem == null ? null : Problem.Parameters; } 60 } 61 35 public abstract class OKBProblem : Item, IProblem { 62 36 public virtual Type ProblemType { 63 37 get { return typeof(IProblem); } … … 71 45 get { return problem; } 72 46 private set { 73 if (value == null) throw new ArgumentNullException("Problem" );47 if (value == null) throw new ArgumentNullException("Problem", "Problem cannot be null."); 74 48 if (value != problem) { 75 49 CancelEventArgs<string> e = new CancelEventArgs<string>(value.Name); … … 94 68 } 95 69 70 public override Image ItemImage { 71 get { return Problem.ItemImage; } 72 } 73 74 public string Name { 75 get { return Problem.Name; } 76 set { throw new NotSupportedException("Name cannot be changed."); } 77 } 78 public string Description { 79 get { return Problem.Description; } 80 set { throw new NotSupportedException("Description cannot be changed."); } 81 } 82 public bool CanChangeName { 83 get { return false; } 84 } 85 public bool CanChangeDescription { 86 get { return false; } 87 } 88 89 public IKeyedItemCollection<string, IParameter> Parameters { 90 get { return Problem.Parameters; } 91 } 92 96 93 public IParameter SolutionCreatorParameter { 97 get { return Problem == null ? null : Problem.SolutionCreatorParameter; }94 get { return Problem.SolutionCreatorParameter; } 98 95 } 99 96 public ISolutionCreator SolutionCreator { 100 get { return Problem == null ? null : Problem.SolutionCreator; }97 get { return Problem.SolutionCreator; } 101 98 } 102 99 public IParameter EvaluatorParameter { 103 get { return Problem == null ? null : Problem.EvaluatorParameter; }100 get { return Problem.EvaluatorParameter; } 104 101 } 105 102 public IEvaluator Evaluator { 106 get { return Problem == null ? null : Problem.Evaluator; }103 get { return Problem.Evaluator; } 107 104 } 108 105 public IEnumerable<IOperator> Operators { 109 get { return Problem == null ? Enumerable.Empty<IOperator>() : Problem.Operators; }106 get { return Problem.Operators; } 110 107 } 111 108 … … 118 115 [Storable(Name = "Problem")] 119 116 private IProblem StorableProblem { 120 get { return Problem; } 121 set { Problem = value; } 117 get { return problem; } 118 set { 119 problem = value; 120 RegisterProblemEvents(); 121 } 122 122 } 123 123 #endregion … … 129 129 problemId = original.problemId; 130 130 problem = cloner.Clone(original.problem); 131 } 132 protected OKBProblem() 131 RegisterProblemEvents(); 132 } 133 protected OKBProblem(IProblem initialProblem) 133 134 : base() { 135 if (initialProblem == null) throw new ArgumentNullException("initialProblem", "Initial problem cannot be null."); 134 136 problemId = -1; 135 } 136 137 public override IDeepCloneable Clone(Cloner cloner) { 138 return new OKBProblem(this, cloner); 137 problem = initialProblem; 138 RegisterProblemEvents(); 139 139 } 140 140 … … 154 154 155 155 public void CollectParameterValues(IDictionary<string, IItem> values) { 156 if (Problem != null)Problem.CollectParameterValues(values);156 Problem.CollectParameterValues(values); 157 157 } 158 158 159 159 #region Events 160 public event EventHandler ProblemChanged; 161 protected virtual void OnProblemChanged() { 162 EventHandler handler = ProblemChanged; 163 if (handler != null) handler(this, EventArgs.Empty); 164 } 160 165 public event EventHandler<CancelEventArgs<string>> NameChanging; 161 166 protected virtual void OnNameChanging(CancelEventArgs<string> e) { … … 171 176 protected virtual void OnDescriptionChanged() { 172 177 var handler = DescriptionChanged; 173 if (handler != null) handler(this, EventArgs.Empty);174 }175 public event EventHandler ProblemChanged;176 protected virtual void OnProblemChanged() {177 EventHandler handler = ProblemChanged;178 178 if (handler != null) handler(this, EventArgs.Empty); 179 179 } -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/SingleObjectiveOKBProblem.cs
r5338 r5344 38 38 } 39 39 public IParameter BestKnownQualityParameter { 40 get { return Problem == null ? null : Problem.BestKnownQualityParameter; } 40 get { return Problem.BestKnownQualityParameter; } 41 } 42 public IParameter MaximizationParameter { 43 get { return Problem.MaximizationParameter; } 41 44 } 42 45 public new ISingleObjectiveEvaluator Evaluator { 43 get { return Problem == null ? null : Problem.Evaluator; } 44 } 45 public IParameter MaximizationParameter { 46 get { return Problem == null ? null : Problem.MaximizationParameter; } 46 get { return Problem.Evaluator; } 47 47 } 48 48 … … 50 50 private SingleObjectiveOKBProblem(bool deserializing) : base(deserializing) { } 51 51 private SingleObjectiveOKBProblem(SingleObjectiveOKBProblem original, Cloner cloner) : base(original, cloner) { } 52 public SingleObjectiveOKBProblem() : base( ) { }52 public SingleObjectiveOKBProblem() : base(new EmptySingleObjectiveProblem("No problem selected. Please choose a single-objective problem instance from the OKB.")) { } 53 53 54 54 public override IDeepCloneable Clone(Cloner cloner) { -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Views/OKBProblemView.Designer.cs
r5338 r5344 59 59 this.problemLabel.Name = "problemLabel"; 60 60 this.problemLabel.Size = new System.Drawing.Size(48, 13); 61 this.problemLabel.TabIndex = 7;61 this.problemLabel.TabIndex = 0; 62 62 this.problemLabel.Text = "&Problem:"; 63 63 // … … 71 71 this.problemComboBox.Name = "problemComboBox"; 72 72 this.problemComboBox.Size = new System.Drawing.Size(551, 21); 73 this.problemComboBox.TabIndex = 8;73 this.problemComboBox.TabIndex = 1; 74 74 this.problemComboBox.SelectedValueChanged += new System.EventHandler(this.problemComboBox_SelectedValueChanged); 75 75 // … … 80 80 this.refreshButton.Name = "refreshButton"; 81 81 this.refreshButton.Size = new System.Drawing.Size(24, 24); 82 this.refreshButton.TabIndex = 4;82 this.refreshButton.TabIndex = 2; 83 83 this.toolTip.SetToolTip(this.refreshButton, "Refresh Problems"); 84 84 this.refreshButton.UseVisualStyleBackColor = true; … … 97 97 this.viewHost.ReadOnly = false; 98 98 this.viewHost.Size = new System.Drawing.Size(638, 422); 99 this.viewHost.TabIndex = 9;99 this.viewHost.TabIndex = 3; 100 100 this.viewHost.ViewsLabelVisible = true; 101 101 this.viewHost.ViewType = null; -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Views/OKBProblemView.cs
r5338 r5344 122 122 private void problemComboBox_SelectedValueChanged(object sender, System.EventArgs e) { 123 123 Problem problem = problemComboBox.SelectedValue as Problem; 124 if ((problem != null) && (Content != null)) Content.Load(problem.Id); 124 if ((problem != null) && (Content != null)) { 125 Content.Load(problem.Id); 126 if (Content.ProblemId != problem.Id) // reset selected item if load was not successful 127 problemComboBox.SelectedItem = OKBClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId); 128 } 125 129 } 126 130 #endregion
Note: See TracChangeset
for help on using the changeset viewer.