- Timestamp:
- 11/25/15 16:22:37 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/CombinedEncoding.cs
r13376 r13396 88 88 } 89 89 90 public override void ConfigureOperators(IEnumerable<I Operator> operators) {90 public override void ConfigureOperators(IEnumerable<IItem> operators) { 91 91 foreach (var encOp in operators.OfType<IMultiEncodingOperator>()) 92 92 encOp.SolutionParameter.ActualName = Name; -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs
r13351 r13396 100 100 } 101 101 102 public void ConfigureOperator(I Operator@operator) { ConfigureOperators(new[] { @operator }); }103 public abstract void ConfigureOperators(IEnumerable<I Operator> operators);102 public void ConfigureOperator(IItem @operator) { ConfigureOperators(new[] { @operator }); } 103 public abstract void ConfigureOperators(IEnumerable<IItem> operators); 104 104 105 105 public event EventHandler SolutionCreatorChanged; -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IEncoding.cs
r13351 r13396 29 29 IEnumerable<IOperator> Operators { get; set; } 30 30 31 void ConfigureOperator(I Operator@operator);32 void ConfigureOperators(IEnumerable<I Operator> operators);31 void ConfigureOperator(IItem @operator); 32 void ConfigureOperators(IEnumerable<IItem> operators); 33 33 34 34 event EventHandler SolutionCreatorChanged; -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
r13376 r13396 35 35 where TEvaluator : class, IEvaluator { 36 36 37 public string Filename { get; set; } 37 public string Filename { get; set; } // TODO: Really okay here? 38 38 39 39 protected IValueParameter<TEncoding> EncodingParameter { … … 71 71 Parameterize(); 72 72 } 73 RegisterEvents(); 74 } 75 protected Problem(TEncoding encoding) { 76 if (encoding == null) throw new ArgumentNullException("encoding"); 77 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.", encoding)); 78 oldEncoding = Encoding; 79 SolutionCreator = Encoding.SolutionCreator; 80 Parameterize(); 81 73 82 RegisterEvents(); 74 83 } -
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs
r13388 r13396 41 41 } 42 42 43 protected IFixedValueParameter<BoolValue> MaximizationParameter { 44 get { return (IFixedValueParameter<BoolValue>)Parameters["Maximization"]; } 45 } 46 43 47 public double BestKnownQuality { 44 48 get { … … 62 66 protected SingleObjectiveProblem() 63 67 : base() { 68 Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true }); 69 Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem.")); 70 71 Operators.Add(Evaluator); 72 Operators.Add(new SingleObjectiveAnalyzer<TSolution>()); 73 Operators.Add(new SingleObjectiveImprover<TSolution>()); 74 Operators.Add(new SingleObjectiveMoveEvaluator<TSolution>()); 75 Operators.Add(new SingleObjectiveMoveGenerator<TSolution>()); 76 Operators.Add(new SingleObjectiveMoveMaker<TSolution>()); 77 78 ParameterizeOperators(); 79 } 80 81 protected SingleObjectiveProblem(TEncoding encoding) 82 : base(encoding) { 64 83 Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true }); 65 84 Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem."));
Note: See TracChangeset
for help on using the changeset viewer.