- Timestamp:
- 03/07/16 10:18:05 (9 years ago)
- Location:
- branches/WebJobManager
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Optimization/3.3/Problems/Problem.cs
r12012 r13656 35 35 public abstract class Problem : ParameterizedNamedItem, IProblem { 36 36 private const string OperatorsParameterName = "Operators"; 37 public IFixedValueParameter<ItemCollection<IItem>> OperatorsParameter { 37 public IFixedValueParameter<ItemCollection<IItem>> OperatorsParameter 38 { 38 39 get { return (IFixedValueParameter<ItemCollection<IItem>>)Parameters[OperatorsParameterName]; } 39 40 } 40 41 41 public static new Image StaticItemImage { 42 get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; } 42 public static new Image StaticItemImage 43 { 44 get { return new Bitmap(25, 25); } 43 45 } 44 46 … … 85 87 #region Backwards compatible code, remove with 3.4 86 88 [Storable(Name = "Operators", AllowOneWay = true)] 87 private IEnumerable<IOperator> StorableOperators { 88 set { 89 private IEnumerable<IOperator> StorableOperators 90 { 91 set 92 { 89 93 IParameter operatorsParam; 90 94 if (Parameters.TryGetValue(OperatorsParameterName, out operatorsParam)) { … … 102 106 } 103 107 #endregion 104 protected ItemCollection<IItem> Operators { 105 get { 108 protected ItemCollection<IItem> Operators 109 { 110 get 111 { 106 112 // BackwardsCompatibility3.3 107 113 #region Backwards compatible code, remove with 3.4 … … 120 126 } 121 127 122 public virtual IEnumerable<IParameterizedItem> ExecutionContextItems { 128 public virtual IEnumerable<IParameterizedItem> ExecutionContextItems 129 { 123 130 get { yield return this; } 124 131 } -
branches/WebJobManager/HeuristicLab.Optimization/3.3/Problems/UserDefinedProblem.cs
r12504 r13656 43 43 public string Filename { get; set; } 44 44 45 public static new Image StaticItemImage { 46 get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; } 47 } 48 public new ParameterCollection Parameters { 45 public static new Image StaticItemImage 46 { 47 get { return new Bitmap(25, 25); } 48 } 49 public new ParameterCollection Parameters 50 { 49 51 get { return base.Parameters; } 50 52 } 51 IKeyedItemCollection<string, IParameter> IParameterizedItem.Parameters { 53 IKeyedItemCollection<string, IParameter> IParameterizedItem.Parameters 54 { 52 55 get { return Parameters; } 53 56 } 54 57 55 58 #region Parameters 56 public IValueParameter<ISingleObjectiveEvaluator> EvaluatorParameter { 59 public IValueParameter<ISingleObjectiveEvaluator> EvaluatorParameter 60 { 57 61 get { return (IValueParameter<ISingleObjectiveEvaluator>)Parameters["Evaluator"]; } 58 62 } 59 public ValueParameter<BoolValue> MaximizationParameter { 63 public ValueParameter<BoolValue> MaximizationParameter 64 { 60 65 get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; } 61 66 } 62 IParameter ISingleObjectiveHeuristicOptimizationProblem.MaximizationParameter { 67 IParameter ISingleObjectiveHeuristicOptimizationProblem.MaximizationParameter 68 { 63 69 get { return MaximizationParameter; } 64 70 } 65 public ValueParameter<ISolutionCreator> SolutionCreatorParameter { 71 public ValueParameter<ISolutionCreator> SolutionCreatorParameter 72 { 66 73 get { return (ValueParameter<ISolutionCreator>)Parameters["SolutionCreator"]; } 67 74 } 68 IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter { 75 IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter 76 { 69 77 get { return SolutionCreatorParameter; } 70 78 } 71 IParameter IHeuristicOptimizationProblem.EvaluatorParameter { 79 IParameter IHeuristicOptimizationProblem.EvaluatorParameter 80 { 72 81 get { return EvaluatorParameter; } 73 82 } 74 public OptionalValueParameter<DoubleValue> BestKnownQualityParameter { 83 public OptionalValueParameter<DoubleValue> BestKnownQualityParameter 84 { 75 85 get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; } 76 86 } 77 IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter { 87 IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter 88 { 78 89 get { return BestKnownQualityParameter; } 79 90 } 80 public OptionalValueParameter<IScope> BestKnownSolutionParameter { 91 public OptionalValueParameter<IScope> BestKnownSolutionParameter 92 { 81 93 get { return (OptionalValueParameter<IScope>)Parameters["BestKnownSolution"]; } 82 94 } 83 public ValueParameter<ItemList<IItem>> OperatorsParameter { 95 public ValueParameter<ItemList<IItem>> OperatorsParameter 96 { 84 97 get { return (ValueParameter<ItemList<IItem>>)Parameters["Operators"]; } 85 98 } … … 87 100 88 101 #region Properties 89 public BoolValue Maximization { 102 public BoolValue Maximization 103 { 90 104 get { return MaximizationParameter.Value; } 91 105 set { MaximizationParameter.Value = value; } 92 106 } 93 public ISolutionCreator SolutionCreator { 107 public ISolutionCreator SolutionCreator 108 { 94 109 get { return SolutionCreatorParameter.Value; } 95 110 set { SolutionCreatorParameter.Value = value; } 96 111 } 97 ISolutionCreator IHeuristicOptimizationProblem.SolutionCreator { 112 ISolutionCreator IHeuristicOptimizationProblem.SolutionCreator 113 { 98 114 get { return SolutionCreatorParameter.Value; } 99 115 } 100 public ISingleObjectiveEvaluator Evaluator { 116 public ISingleObjectiveEvaluator Evaluator 117 { 101 118 get { return EvaluatorParameter.Value; } 102 119 set { EvaluatorParameter.Value = value; } 103 120 } 104 ISingleObjectiveEvaluator ISingleObjectiveHeuristicOptimizationProblem.Evaluator { 121 ISingleObjectiveEvaluator ISingleObjectiveHeuristicOptimizationProblem.Evaluator 122 { 105 123 get { return EvaluatorParameter.Value; } 106 124 } 107 IEvaluator IHeuristicOptimizationProblem.Evaluator { 125 IEvaluator IHeuristicOptimizationProblem.Evaluator 126 { 108 127 get { return EvaluatorParameter.Value; } 109 128 } 110 public DoubleValue BestKnownQuality { 129 public DoubleValue BestKnownQuality 130 { 111 131 get { return BestKnownQualityParameter.Value; } 112 132 set { BestKnownQualityParameter.Value = value; } 113 133 } 114 public IEnumerable<IItem> Operators { 134 public IEnumerable<IItem> Operators 135 { 115 136 get { return OperatorsParameter.Value; } 116 137 } 117 138 118 public IEnumerable<IParameterizedItem> ExecutionContextItems { 139 public IEnumerable<IParameterizedItem> ExecutionContextItems 140 { 119 141 get { yield return this; } 120 142 } … … 250 272 #region ISingleObjectiveEvaluator Members 251 273 252 public ILookupParameter<DoubleValue> QualityParameter { 274 public ILookupParameter<DoubleValue> QualityParameter 275 { 253 276 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } 254 277 } … … 276 299 #endregion 277 300 278 public static new Image StaticItemImage { 279 get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; } 301 public static new Image StaticItemImage 302 { 303 get { return new Bitmap(25, 25); } 280 304 } 281 305 }
Note: See TracChangeset
for help on using the changeset viewer.