Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/15/14 15:06:57 (10 years ago)
Author:
abeham
Message:

#2174: Worked on programmable problem

  • Changed ProblemBase to IProblemDefinition and SingleObjectiveProblemBase to ISingleObjectiveProblemDefinition
  • Derived ParameterVectorCreater, -Crossover, and -Manipulator from MultiOperator<> instead of InstrumentedOperator
  • Split the megamoth ScriptOnInstanceChanged to multiple methods dealing with single-vector and multi-vector encodings separately, it's still a lot of tedious code
  • Removed maximization from Configuration again (would not be consistent with multi-objective problems)
Location:
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Operators
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorCreater.cs

    r10850 r10856  
    2020#endregion
    2121
     22using System.Linq;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2930  [Item("ParameterVectorCreater", "Contains solution creators that together create a multi-vector encoding.")]
    3031  [StorableClass]
    31   public class ParameterVectorCreater : InstrumentedOperator, ISolutionCreator {
     32  public class ParameterVectorCreater : MultiOperator<ISolutionCreator>, ISolutionCreator {
    3233
    3334    [StorableConstructor]
     
    3940      return new ParameterVectorCreater(this, cloner);
    4041    }
     42
     43    public override IOperation InstrumentedApply() {
     44      var baseOperations = base.InstrumentedApply();
     45      return new OperationCollection(new[] { baseOperations }.Concat(Operators.Select(x => ExecutionContext.CreateOperation(x))));
     46    }
    4147  }
    4248}
  • branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorCrossover.cs

    r10850 r10856  
    2020#endregion
    2121
     22using System.Linq;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2930  [Item("ParameterVector Crossover", "Applies different crossovers to cross a multi vector encoding.")]
    3031  [StorableClass]
    31   public class ParameterVectorCrossover : InstrumentedOperator, ICrossover {
     32  public class ParameterVectorCrossover : MultiOperator<ICrossover>, ICrossover {
    3233
    3334    [StorableConstructor]
     
    4142      return new ParameterVectorCrossover(this, cloner);
    4243    }
     44
     45    public override IOperation InstrumentedApply() {
     46      var baseOperations = base.InstrumentedApply();
     47      return new OperationCollection(new[] { baseOperations }.Concat(Operators.Select(x => ExecutionContext.CreateOperation(x))));
     48    }
    4349  }
    4450}
  • branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorManipulator.cs

    r10850 r10856  
    2020#endregion
    2121
     22using System.Linq;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2930  [Item("ParameterVector Manipulator", "Applies different manipulators to change a multi vector encoding.")]
    3031  [StorableClass]
    31   public class ParameterVectorManipulator : InstrumentedOperator, IManipulator {
     32  public class ParameterVectorManipulator : MultiOperator<IManipulator>, IManipulator {
    3233
    3334    [StorableConstructor]
     
    4142      return new ParameterVectorManipulator(this, cloner);
    4243    }
     44
     45    public override IOperation InstrumentedApply() {
     46      var baseOperations = base.InstrumentedApply();
     47      return new OperationCollection(new[] { baseOperations }.Concat(Operators.Select(x => ExecutionContext.CreateOperation(x))));
     48    }
    4349  }
    4450}
Note: See TracChangeset for help on using the changeset viewer.