Changeset 2845 for trunk/sources/HeuristicLab.Optimization
- Timestamp:
- 02/20/10 20:04:08 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization/3.3
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r2834 r2845 51 51 <ItemGroup> 52 52 <None Include="HeuristicLabOptimizationPlugin.cs.frame" /> 53 <Compile Include="IAlgorithm.cs" /> 53 54 <Compile Include="HeuristicLabOptimizationPlugin.cs" /> 54 55 <Compile Include="IProblem.cs" /> … … 68 69 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 69 70 <Name>HeuristicLab.Common.Resources-3.2</Name> 71 </ProjectReference> 72 <ProjectReference Include="..\..\HeuristicLab.Common\3.2\HeuristicLab.Common-3.2.csproj"> 73 <Project>{1FC004FC-59AF-4249-B1B6-FF25873A20E4}</Project> 74 <Name>HeuristicLab.Common-3.2</Name> 70 75 </ProjectReference> 71 76 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> -
trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLabOptimizationPlugin.cs.frame
r2834 r2845 29 29 [PluginFile("HeuristicLab.Optimization-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 [PluginDependency("HeuristicLab.Common", "3.2")] 31 32 [PluginDependency("HeuristicLab.Common.Resources", "3.2")] 32 33 [PluginDependency("HeuristicLab.Core", "3.3")] -
trunk/sources/HeuristicLab.Optimization/3.3/IProblem.cs
r2834 r2845 26 26 /// Interface to represent a problem. 27 27 /// </summary> 28 public interface IProblem : I NamedItem, IParameterizedItem { }28 public interface IProblem : IParameterizedNamedItem { } 29 29 } -
trunk/sources/HeuristicLab.Optimization/3.3/Problem.cs
r2834 r2845 21 21 22 22 using System.Drawing; 23 using HeuristicLab.Collections;24 23 using HeuristicLab.Core; 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;26 24 27 25 namespace HeuristicLab.Optimization { … … 30 28 /// </summary> 31 29 [Item("Problem", "Base class for problems.")] 32 public abstract class Problem : NamedItem, IProblem {30 public abstract class Problem : ParameterizedNamedItem, IProblem { 33 31 public override Image ItemImage { 34 32 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; } 35 33 } 36 34 37 private ParameterCollection parameters; 38 [Storable] 39 protected ParameterCollection Parameters { 40 get { return parameters;} 41 private set { 42 if (parameters != null) parameters.Changed -= new ChangedEventHandler(Parameters_Changed); 43 parameters = value; 44 readOnlyParameters = null; 45 if (parameters != null) parameters.Changed += new ChangedEventHandler(Parameters_Changed); 46 } 47 } 48 private ReadOnlyObservableKeyedCollection<string, IParameter> readOnlyParameters; 49 IObservableKeyedCollection<string, IParameter> IParameterizedItem.Parameters { 50 get { 51 if (readOnlyParameters == null) readOnlyParameters = parameters.AsReadOnly(); 52 return readOnlyParameters; 53 } 54 } 55 56 protected Problem() { 57 Name = ItemName; 58 Parameters = new ParameterCollection(); 59 readOnlyParameters = null; 60 } 61 62 public override IDeepCloneable Clone(Cloner cloner) { 63 Problem clone = (Problem)base.Clone(cloner); 64 clone.Parameters = (ParameterCollection)cloner.Clone(parameters); 65 return clone; 66 } 67 68 private void Parameters_Changed(object sender, ChangedEventArgs e) { 69 OnChanged(e); 70 } 35 protected Problem() : base() { } 36 protected Problem(string name) : base(name) { } 37 protected Problem(string name, ParameterCollection parameters) : base(name, parameters) { } 38 protected Problem(string name, string description) : base(name, description) { } 39 protected Problem(string name, string description, ParameterCollection parameters) : base(name, description, parameters) { } 71 40 } 72 41 }
Note: See TracChangeset
for help on using the changeset viewer.