Changeset 12326 for branches/OptimizationNetworks/HeuristicLab.Networks/3.3/FeatureSelection Network/SelectionProblem.cs
- Timestamp:
- 04/17/15 19:23:51 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/FeatureSelection Network/SelectionProblem.cs
r12323 r12326 7 7 using HeuristicLab.Parameters; 8 8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 using HeuristicLab.Problems.Binary; 9 10 10 11 namespace HeuristicLab.Networks.FeatureSelection_Network { 11 public class SelectionProblem : SingleObjectiveBasicProblem<BinaryVectorEncoding>{12 public class SelectionProblem : BinaryProblem { 12 13 private Func<BinaryVector, double> eval; 13 14 public virtual int Length {15 get { return Encoding.Length; }16 set { Encoding.Length = value; }17 }18 14 19 15 protected SelectionProblem(SelectionProblem original, Cloner cloner) … … 30 26 31 27 var lengthParam = new ValueParameter<IntValue>("Length"); 28 29 32 30 lengthParam.ValueChanged += (o, s) => { Length = lengthParam.Value.Value; }; 31 // we cannot use the fixed value parameter from BinaryProblem in the network 32 Parameters.Remove("Length"); 33 33 Parameters.Add(lengthParam); 34 34 } … … 38 38 } 39 39 40 public override double Evaluate(Individual individual, IRandom random) { 41 return eval(individual.BinaryVector()); 40 public override double Evaluate(BinaryVector vector, IRandom random) { 41 return eval(vector); 42 42 43 } 43 44
Note: See TracChangeset
for help on using the changeset viewer.