Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/15 22:18:35 (9 years ago)
Author:
abeham
Message:

#2521: Adapted multi-encoding for new infrastructure

TODO: Evaluator, Analyzer, ... need to be copied

Location:
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblems.cs

    r13350 r13351  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Encodings.BinaryVectorEncoding;
     27using HeuristicLab.Optimization;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2829
     
    4950    public override IDeepCloneable Clone(Cloner cloner) {
    5051      return new MultiObjectiveBinaryVectorProgrammableProblem(this, cloner);
     52    }
     53  }
     54
     55  [Item("Multi Solution Programmable Problem (multi-objective)", "Represents a multi solution multi-objective problem that can be programmed with a script.")]
     56  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
     57  [StorableClass]
     58  public sealed class MultiObjectiveMultiSolutionProgrammableProblem : MultiObjectiveProgrammableProblem<MultiEncoding, MultiSolution> {
     59
     60    [StorableConstructor]
     61    private MultiObjectiveMultiSolutionProgrammableProblem(bool deserializing) : base(deserializing) { }
     62    private MultiObjectiveMultiSolutionProgrammableProblem(MultiObjectiveMultiSolutionProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
     63
     64    public MultiObjectiveMultiSolutionProgrammableProblem()
     65      : base() {
     66      var codeTemplate = ScriptTemplates.CompiledSingleObjectiveProblemDefinition_Template;
     67      codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.BinaryVectorEncoding");
     68      codeTemplate = codeTemplate.Replace(ENCODING_CLASS, "MultiEncoding");
     69      codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, "MultiSolution");
     70      ProblemScript.Code = codeTemplate;
     71    }
     72
     73
     74    public override IDeepCloneable Clone(Cloner cloner) {
     75      return new MultiObjectiveMultiSolutionProgrammableProblem(this, cloner);
    5176    }
    5277  }
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblems.cs

    r13350 r13351  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Encodings.BinaryVectorEncoding;
     27using HeuristicLab.Optimization;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2829
     
    4950    public override IDeepCloneable Clone(Cloner cloner) {
    5051      return new SingleObjectiveBinaryVectorProgrammableProblem(this, cloner);
     52    }
     53  }
     54
     55  [Item("Multi Solution Programmable Problem (single-objective)", "Represents a multi solution single-objective problem that can be programmed with a script.")]
     56  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
     57  [StorableClass]
     58  public sealed class SingleObjectiveMultiSolutionProgrammableProblem : SingleObjectiveProgrammableProblem<MultiEncoding, MultiSolution> {
     59
     60    [StorableConstructor]
     61    private SingleObjectiveMultiSolutionProgrammableProblem(bool deserializing) : base(deserializing) { }
     62    private SingleObjectiveMultiSolutionProgrammableProblem(SingleObjectiveMultiSolutionProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
     63
     64    public SingleObjectiveMultiSolutionProgrammableProblem()
     65      : base() {
     66      var codeTemplate = ScriptTemplates.CompiledSingleObjectiveProblemDefinition_Template;
     67      codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.BinaryVectorEncoding");
     68      codeTemplate = codeTemplate.Replace(ENCODING_CLASS, "MultiEncoding");
     69      codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, "MultiSolution");
     70      ProblemScript.Code = codeTemplate;
     71    }
     72
     73
     74    public override IDeepCloneable Clone(Cloner cloner) {
     75      return new SingleObjectiveMultiSolutionProgrammableProblem(this, cloner);
    5176    }
    5277  }
Note: See TracChangeset for help on using the changeset viewer.