Changeset 13339 for branches/ProblemRefactoring/HeuristicLab.Optimization
- Timestamp:
- 11/23/15 16:14:57 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Optimization/3.3
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IMultiObjectiveProblemDefinition.cs
r13336 r13339 23 23 24 24 namespace HeuristicLab.Optimization { 25 public interface IMultiObjectiveProblemDefinition<TSolution> : IProblemDefinition 26 where TSolution : class, ISolution { 25 public interface IMultiObjectiveProblemDefinition<TEncoding, TSolution> : IProblemDefinition<TEncoding, TSolution> 26 where TEncoding : class, IEncoding<TSolution> 27 where TSolution : class, ISolution { 27 28 bool[] Maximization { get; } 28 29 double[] Evaluate(TSolution individual, IRandom random); -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IProblemDefinition.cs
r13336 r13339 21 21 22 22 namespace HeuristicLab.Optimization { 23 public interface IProblemDefinition { 24 //IEncoding Encoding { get; } 23 public interface IProblemDefinition<TEncoding, TSolution> 24 where TEncoding : class, IEncoding<TSolution> 25 where TSolution : class, ISolution { 26 TEncoding Encoding { get; } 25 27 } 26 28 } -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblem.cs
r13337 r13339 24 24 25 25 namespace HeuristicLab.Optimization { 26 public interface ISingleObjectiveProblem<TSolution> : IProblem<TSolution>, ISingleObjectiveProblemDefinition<TSolution>, ISingleObjectiveHeuristicOptimizationProblem 26 public interface ISingleObjectiveProblem<TEncoding, TSolution> : IProblem<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>, ISingleObjectiveHeuristicOptimizationProblem 27 where TEncoding : class, IEncoding<TSolution> 27 28 where TSolution : class, ISolution { 28 29 bool IsBetter(double quality, double bestQuality); -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblemDefinition.cs
r13336 r13339 24 24 25 25 namespace HeuristicLab.Optimization { 26 public interface ISingleObjectiveProblemDefinition<TSolution> : IProblemDefinition 27 where TSolution : class, ISolution { 26 public interface ISingleObjectiveProblemDefinition<TEncoding, TSolution> : IProblemDefinition<TEncoding, TSolution> 27 where TEncoding : class, IEncoding<TSolution> 28 where TSolution : class, ISolution { 28 29 bool Maximization { get; } 29 30 double Evaluate(TSolution individual, IRandom random); -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveProblem.cs
r13336 r13339 29 29 namespace HeuristicLab.Optimization { 30 30 [StorableClass] 31 public abstract class MultiObjectiveProblem<TSolution> : Problem<TSolution, MultiObjectiveEvaluator<TSolution>>, IMultiObjectiveHeuristicOptimizationProblem, IMultiObjectiveProblemDefinition<TSolution> 32 where TSolution : class, ISolution { 31 public abstract class MultiObjectiveProblem<TEncoding, TSolution> : Problem<TEncoding, TSolution, MultiObjectiveEvaluator<TSolution>>, IMultiObjectiveHeuristicOptimizationProblem, IMultiObjectiveProblemDefinition<TEncoding, TSolution> 32 where TEncoding : class, IEncoding<TSolution> 33 where TSolution : class, ISolution { 33 34 [StorableConstructor] 34 35 protected MultiObjectiveProblem(bool deserializing) : base(deserializing) { } 35 36 36 protected MultiObjectiveProblem(MultiObjectiveProblem<T Solution> original, Cloner cloner)37 protected MultiObjectiveProblem(MultiObjectiveProblem<TEncoding, TSolution> original, Cloner cloner) 37 38 : base(original, cloner) { 38 39 ParameterizeOperators(); -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
r13336 r13339 30 30 namespace HeuristicLab.Optimization { 31 31 [StorableClass] 32 public abstract class Problem<TSolution, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator<TSolution>>, IProblemDefinition, IStorableContent 32 public abstract class Problem<TEncoding, TSolution, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator<TSolution>>, IProblemDefinition<TEncoding, TSolution>, IStorableContent 33 where TEncoding : class, IEncoding<TSolution> 33 34 where TSolution : class, ISolution 34 35 where TEvaluator : class, IEvaluator { … … 36 37 public string Filename { get; set; } 37 38 38 protected IValueParameter< IEncoding<TSolution>> EncodingParameter {39 get { return (IValueParameter< IEncoding<TSolution>>)Parameters["Encoding"]; }39 protected IValueParameter<TEncoding> EncodingParameter { 40 get { return (IValueParameter<TEncoding>)Parameters["Encoding"]; } 40 41 } 41 42 42 public IEncoding<TSolution>Encoding {43 public TEncoding Encoding { 43 44 get { return EncodingParameter.Value; } 44 45 protected set { … … 61 62 protected Problem() 62 63 : base() { 63 Parameters.Add(new ValueParameter<IEncoding<TSolution>>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any.")); 64 if (Encoding != null) Parameterize(); 64 Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any.")); 65 if (Encoding != null) { 66 SolutionCreator = Encoding.SolutionCreator; 67 Parameterize(); 68 } 65 69 RegisterEvents(); 66 70 } 67 71 68 protected Problem(Problem<T Solution, TEvaluator> original, Cloner cloner)72 protected Problem(Problem<TEncoding, TSolution, TEvaluator> original, Cloner cloner) 69 73 : base(original, cloner) { 70 74 RegisterEvents(); -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs
r13336 r13339 30 30 namespace HeuristicLab.Optimization { 31 31 [StorableClass] 32 public abstract class SingleObjectiveProblem<T Solution> : Problem<TSolution, SingleObjectiveEvaluator<TSolution>>,33 ISingleObjectiveProblemDefinition<TSolution>, ISingleObjectiveHeuristicOptimizationProblem34 where TSolution : class, ISolution {32 public abstract class SingleObjectiveProblem<TEncoding, TSolution> : Problem<TEncoding, TSolution, SingleObjectiveEvaluator<TSolution>>, ISingleObjectiveProblem<TEncoding, TSolution> 33 where TEncoding : class, IEncoding<TSolution> 34 where TSolution : class, ISolution { 35 35 36 36 protected IValueParameter<DoubleValue> BestKnownQualityParameter { … … 52 52 protected SingleObjectiveProblem(bool deserializing) : base(deserializing) { } 53 53 54 protected SingleObjectiveProblem(SingleObjectiveProblem<T Solution> original, Cloner cloner)54 protected SingleObjectiveProblem(SingleObjectiveProblem<TEncoding, TSolution> original, Cloner cloner) 55 55 : base(original, cloner) { 56 56 ParameterizeOperators(); -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Interfaces/IProblem.cs
r13336 r13339 36 36 } 37 37 38 public interface IProblem<TSolution> : IHeuristicOptimizationProblem where TSolution : class, ISolution { 39 IEncoding<TSolution> Encoding { get; } 38 public interface IProblem<TEncoding, TSolution> : IHeuristicOptimizationProblem, IProblemDefinition<TEncoding, TSolution> 39 where TEncoding : class, IEncoding<TSolution> 40 where TSolution : class, ISolution { 40 41 } 41 42 } -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/Problems/HeuristicOptimizationProblem.cs
r12012 r13339 99 99 } 100 100 101 pr otected virtualvoid SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {101 private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) { 102 102 OnSolutionCreatorChanged(); 103 103 }
Note: See TracChangeset
for help on using the changeset viewer.