Changeset 13350


Ignore:
Timestamp:
11/23/15 21:38:35 (3 years ago)
Author:
mkommend
Message:

#2521: Adapted multi-objective programmable problem.

Location:
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3
Files:
1 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj

    r13348 r13350  
    9090    </Compile>
    9191    <Compile Include="Interfaces\IProgrammableProblem.cs" />
     92    <Compile Include="MultiObjectiveProblemDefinitionScript.cs" />
     93    <Compile Include="MultiObjectiveProgrammableProblem.cs" />
    9294    <Compile Include="ProblemDefinitionScript.cs">
    9395      <SubType>Code</SubType>
    9496    </Compile>
    9597    <Compile Include="ProblemDefinitionScriptException.cs" />
     98    <Compile Include="MultiObjectiveProgrammableProblems.cs" />
    9699    <Compile Include="SingleObjectiveProgrammableProblems.cs" />
    97100    <Content Include="Templates\CompiledSingleObjectiveProblemDefinition_Template.cs" />
     101    <Content Include="Templates\CompiledMultiObjectiveProblemDefinition_Template.cs">
     102      <SubType>Code</SubType>
     103    </Content>
    98104    <Compile Include="Templates\ScriptTemplates.Designer.cs">
    99105      <AutoGen>True</AutoGen>
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs

    r13218 r13350  
    2828  [Item("Multi-objective Problem Definition Script", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
    2929  [StorableClass]
    30   public sealed class MultiObjectiveProblemDefinitionScript : ProblemDefinitionScript, IMultiObjectiveProblemDefinition, IStorableContent {
     30  public sealed class MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, IMultiObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent
     31    where TEncoding : class, IEncoding<TSolution>
     32    where TSolution : class, ISolution {
    3133    public string Filename { get; set; }
    3234
    33     private new IMultiObjectiveProblemDefinition CompiledProblemDefinition {
    34       get { return (IMultiObjectiveProblemDefinition)base.CompiledProblemDefinition; }
     35    private new IMultiObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition {
     36      get { return (IMultiObjectiveProblemDefinition<TEncoding, TSolution>)base.CompiledProblemDefinition; }
    3537    }
    3638
    3739    [StorableConstructor]
    3840    private MultiObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
    39     private MultiObjectiveProblemDefinitionScript(MultiObjectiveProblemDefinitionScript original, Cloner cloner) : base(original, cloner) { }
    40     public MultiObjectiveProblemDefinitionScript() : base(ScriptTemplates.CompiledMultiObjectiveProblemDefinition) { }
     41    private MultiObjectiveProblemDefinitionScript(MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { }
     42    public MultiObjectiveProblemDefinitionScript() : base(ScriptTemplates.CompiledMultiObjectiveProblemDefinition_Template) { }
    4143
    4244    public override IDeepCloneable Clone(Cloner cloner) {
    43       return new MultiObjectiveProblemDefinitionScript(this, cloner);
     45      return new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>(this, cloner);
    4446    }
    4547
    46     bool[] IMultiObjectiveProblemDefinition.Maximization {
     48    bool[] IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Maximization {
    4749      get { return CompiledProblemDefinition.Maximization; }
    4850    }
    4951
    50     double[] IMultiObjectiveProblemDefinition.Evaluate(Individual individual, IRandom random) {
     52    double[] IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Evaluate(TSolution individual, IRandom random) {
    5153      return CompiledProblemDefinition.Evaluate(individual, random);
    5254    }
    5355
    54     void IMultiObjectiveProblemDefinition.Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
     56    void IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Analyze(TSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
    5557      CompiledProblemDefinition.Analyze(individuals, qualities, results, random);
    5658    }
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs

    r13336 r13350  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Scripting;
    3031
    3132namespace HeuristicLab.Problems.Programmable {
     
    3334  [Creatable(CreatableAttribute.Categories.Problems, Priority = 120)]
    3435  [StorableClass]
    35   public sealed class MultiObjectiveProgrammableProblem : MultiObjectiveProblem<IEncoding>, IProgrammableItem {
     36  public class MultiObjectiveProgrammableProblem<TEncoding, TSolution> : MultiObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem
     37    where TEncoding : class, IEncoding<TSolution>
     38    where TSolution : class, ISolution {
     39    protected static readonly string ENCODING_NAMESPACE = "ENCODING_NAMESPACE";
     40    protected static readonly string ENCODING_CLASS = "ENCODING_CLASS";
     41    protected static readonly string SOLUTION_CLASS = "SOLUTION_CLASS";
     42
    3643    public static new Image StaticItemImage {
    3744      get { return VSImageLibrary.Script; }
    3845    }
    3946
    40     private FixedValueParameter<MultiObjectiveProblemDefinitionScript> MultiObjectiveProblemScriptParameter {
    41       get { return (FixedValueParameter<MultiObjectiveProblemDefinitionScript>)Parameters["ProblemScript"]; }
     47    private FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>> MultiObjectiveProblemScriptParameter {
     48      get { return (FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>>)Parameters["ProblemScript"]; }
    4249    }
    4350
    44     public MultiObjectiveProblemDefinitionScript ProblemScript {
     51    Script IProgrammableProblem.ProblemScript {
     52      get { return ProblemScript; }
     53    }
     54    public MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> ProblemScript {
    4555      get { return MultiObjectiveProblemScriptParameter.Value; }
    4656    }
    4757
    48     public IMultiObjectiveProblemDefinition ProblemDefinition {
     58    public IMultiObjectiveProblemDefinition<TEncoding, TSolution> ProblemDefinition {
    4959      get { return MultiObjectiveProblemScriptParameter.Value; }
    5060    }
    5161
    52     private MultiObjectiveProgrammableProblem(MultiObjectiveProgrammableProblem original, Cloner cloner)
     62    protected MultiObjectiveProgrammableProblem(MultiObjectiveProgrammableProblem<TEncoding, TSolution> original, Cloner cloner)
    5363      : base(original, cloner) {
    5464      RegisterEvents();
    5565    }
    56     public override IDeepCloneable Clone(Cloner cloner) { return new MultiObjectiveProgrammableProblem(this, cloner); }
     66    public override IDeepCloneable Clone(Cloner cloner) { return new MultiObjectiveProgrammableProblem<TEncoding, TSolution>(this, cloner); }
    5767
    5868    [StorableConstructor]
    59     private MultiObjectiveProgrammableProblem(bool deserializing) : base(deserializing) { }
     69    protected MultiObjectiveProgrammableProblem(bool deserializing) : base(deserializing) { }
    6070    public MultiObjectiveProgrammableProblem()
    6171      : base() {
    62       Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript>("ProblemScript", "Defines the problem.", new MultiObjectiveProblemDefinitionScript() { Name = Name }));
     72      Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.",
     73        new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
    6374      RegisterEvents();
    6475    }
     
    7788      Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly()) { Hidden = true });
    7889
    79       Encoding = ProblemDefinition.Encoding;
     90      ProblemScript.Initialize();
    8091      OnOperatorsChanged();
    8192      OnReset();
     
    8697    }
    8798
    88     public override double[] Evaluate(Individual individual, IRandom random) {
     99    public override double[] Evaluate(TSolution individual, IRandom random) {
    89100      return ProblemDefinition.Evaluate(individual, random);
    90101    }
    91102
    92     public override void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
     103    public override void Analyze(TSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
    93104      ProblemDefinition.Analyze(individuals, qualities, results, random);
    94105    }
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblems.cs

    r13348 r13350  
    2828
    2929namespace HeuristicLab.Problems.Programmable {
    30   [Item("Binary Vector Programmable Problem (single-objective)", "Represents a binary vector single-objective problem that can be programmed with a script.")]
     30  [Item("Binary Vector Programmable Problem (multi-objective)", "Represents a binary vector multi-objective problem that can be programmed with a script.")]
    3131  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
    3232  [StorableClass]
    33   public sealed class SingleObjectiveBinaryVectorProgrammableProblem : SingleObjectiveProgrammableProblem<BinaryVectorEncoding, BinaryVector> {
     33  public sealed class MultiObjectiveBinaryVectorProgrammableProblem : MultiObjectiveProgrammableProblem<BinaryVectorEncoding, BinaryVector> {
    3434
    3535    [StorableConstructor]
    36     private SingleObjectiveBinaryVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
    37     private SingleObjectiveBinaryVectorProgrammableProblem(SingleObjectiveBinaryVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
     36    private MultiObjectiveBinaryVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
     37    private MultiObjectiveBinaryVectorProgrammableProblem(MultiObjectiveBinaryVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
    3838
    39     public SingleObjectiveBinaryVectorProgrammableProblem()
     39    public MultiObjectiveBinaryVectorProgrammableProblem()
    4040      : base() {
    41       var codeTemplate = ScriptTemplates.CompiledSingleObjectiveProblemDefinition_Template;
     41      var codeTemplate = ScriptTemplates.CompiledMultiObjectiveProblemDefinition_Template;
    4242      codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.BinaryVectorEncoding");
    4343      codeTemplate = codeTemplate.Replace(ENCODING_CLASS, "BinaryVectorEncoding");
     
    4848
    4949    public override IDeepCloneable Clone(Cloner cloner) {
    50       return new SingleObjectiveBinaryVectorProgrammableProblem(this, cloner);
    51     }
    52   }
    53   /*
    54   [Item("Integer Vector Programmable Problem (single-objective)", "Represents an integer vector single-objective problem that can be programmed with a script.")]
    55   [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
    56   [StorableClass]
    57   public sealed class SingleObjectiveIntegerVectorProgrammableProblem : SingleObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> {
    58 
    59     [StorableConstructor]
    60     private SingleObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
    61     private SingleObjectiveIntegerVectorProgrammableProblem(SingleObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
    62     public SingleObjectiveIntegerVectorProgrammableProblem()
    63       : base(string.Format(ScriptTemplates.CompiledSingleObjectiveProblemDefinition, "HeuristicLab.Encodings.IntegerVectorEncoding", "IntegerVectorEncoding", "IntegerVector")) { }
    64 
    65     public override IDeepCloneable Clone(Cloner cloner) {
    66       return new SingleObjectiveIntegerVectorProgrammableProblem(this, cloner);
     50      return new MultiObjectiveBinaryVectorProgrammableProblem(this, cloner);
    6751    }
    6852  }
    6953
    70   [Item("Real Vector Programmable Problem (single-objective)", "Represents a real vector single-objective problem that can be programmed with a script.")]
     54  //TODO
     55  /*
     56  [Item("Integer Vector Programmable Problem (multi-objective)", "Represents an integer vector multi-objective problem that can be programmed with a script.")]
    7157  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
    7258  [StorableClass]
    73   public sealed class SingleObjectiveRealVectorProgrammableProblem : SingleObjectiveProgrammableProblem<RealVectorEncoding, RealVector> {
     59  public sealed class MultiObjectiveIntegerVectorProgrammableProblem : MultiObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> {
    7460
    7561    [StorableConstructor]
    76     private SingleObjectiveRealVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
    77     private SingleObjectiveRealVectorProgrammableProblem(SingleObjectiveRealVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
    78     public SingleObjectiveRealVectorProgrammableProblem()
    79       : base(string.Format(ScriptTemplates.CompiledSingleObjectiveProblemDefinition, "HeuristicLab.Encodings.RealVectorEncoding", "RealVectorEncoding", "RealVector")) { }
     62    private MultiObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
     63    private MultiObjectiveIntegerVectorProgrammableProblem(MultiObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
     64    public MultiObjectiveIntegerVectorProgrammableProblem()
     65      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.IntegerVectorEncoding", "IntegerVectorEncoding", "IntegerVector")) { }
    8066
    8167    public override IDeepCloneable Clone(Cloner cloner) {
    82       return new SingleObjectiveRealVectorProgrammableProblem(this, cloner);
     68      return new MultiObjectiveIntegerVectorProgrammableProblem(this, cloner);
    8369    }
    8470  }
    8571
    86   [Item("Permutation Programmable Problem (single-objective)", "Represents a permutation single-objective problem that can be programmed with a script.")]
     72  [Item("Real Vector Programmable Problem (multi-objective)", "Represents a real vector multi-objective problem that can be programmed with a script.")]
    8773  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
    8874  [StorableClass]
    89   public sealed class SingleObjectivePermutationProgrammableProblem : SingleObjectiveProgrammableProblem<PermutationEncoding, Permutation> {
     75  public sealed class MultiObjectiveRealVectorProgrammableProblem : MultiObjectiveProgrammableProblem<RealVectorEncoding, RealVector> {
    9076
    9177    [StorableConstructor]
    92     private SingleObjectivePermutationProgrammableProblem(bool deserializing) : base(deserializing) { }
    93     private SingleObjectivePermutationProgrammableProblem(SingleObjectivePermutationProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
    94     public SingleObjectivePermutationProgrammableProblem()
    95       : base(string.Format(ScriptTemplates.CompiledSingleObjectiveProblemDefinition, "HeuristicLab.Encodings.PermutationEncoding", "PermutationEncoding", "Permutation")) { }
     78    private MultiObjectiveRealVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
     79    private MultiObjectiveRealVectorProgrammableProblem(MultiObjectiveRealVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
     80    public MultiObjectiveRealVectorProgrammableProblem()
     81      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.RealVectorEncoding", "RealVectorEncoding", "RealVector")) { }
    9682
    9783    public override IDeepCloneable Clone(Cloner cloner) {
    98       return new SingleObjectivePermutationProgrammableProblem(this, cloner);
     84      return new MultiObjectiveRealVectorProgrammableProblem(this, cloner);
    9985    }
    10086  }
    10187
    102   [Item("Symbolic Expression Tree Programmable Problem (single-objective)", "Represents a symbolic expression tree single-objective problem that can be programmed with a script.")]
     88  [Item("Permutation Programmable Problem (multi-objective)", "Represents a permutation multi-objective problem that can be programmed with a script.")]
    10389  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
    10490  [StorableClass]
    105   public sealed class SingleObjectiveSymbolicExpressionTreeProgrammableProblem : SingleObjectiveProgrammableProblem<SymbolicExpressionTreeEncoding, SymbolicExpressionTree> {
     91  public sealed class MultiObjectivePermutationProgrammableProblem : MultiObjectiveProgrammableProblem<PermutationEncoding, Permutation> {
    10692
    10793    [StorableConstructor]
    108     private SingleObjectiveSymbolicExpressionTreeProgrammableProblem(bool deserializing) : base(deserializing) { }
    109     private SingleObjectiveSymbolicExpressionTreeProgrammableProblem(SingleObjectiveSymbolicExpressionTreeProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
    110     public SingleObjectiveSymbolicExpressionTreeProgrammableProblem()
    111       : base(string.Format(ScriptTemplates.CompiledSingleObjectiveProblemDefinition, "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "SymbolicExpressionTreeEncoding", "SymbolicExpressionTree")) { }
     94    private MultiObjectivePermutationProgrammableProblem(bool deserializing) : base(deserializing) { }
     95    private MultiObjectivePermutationProgrammableProblem(MultiObjectivePermutationProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
     96    public MultiObjectivePermutationProgrammableProblem()
     97      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.PermutationEncoding", "PermutationEncoding", "Permutation")) { }
    11298
    11399    public override IDeepCloneable Clone(Cloner cloner) {
    114       return new SingleObjectiveSymbolicExpressionTreeProgrammableProblem(this, cloner);
     100      return new MultiObjectivePermutationProgrammableProblem(this, cloner);
    115101    }
    116102  }
    117103
    118   [Item("Linear Linkage Programmable Problem (single-objective)", "Represents a linear linkage single-objective problem that can be programmed with a script.")]
     104  [Item("Symbolic Expression Tree Programmable Problem (multi-objective)", "Represents a symbolic expression tree multi-objective problem that can be programmed with a script.")]
    119105  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
    120106  [StorableClass]
    121   public sealed class SingleObjectiveLinearLinkageProgrammableProblem : SingleObjectiveProgrammableProblem<LinearLinkageEncoding, LinearLinkage> {
     107  public sealed class MultiObjectiveSymbolicExpressionTreeProgrammableProblem : MultiObjectiveProgrammableProblem<SymbolicExpressionTreeEncoding, SymbolicExpressionTree> {
    122108
    123109    [StorableConstructor]
    124     private SingleObjectiveLinearLinkageProgrammableProblem(bool deserializing) : base(deserializing) { }
    125     private SingleObjectiveLinearLinkageProgrammableProblem(SingleObjectiveLinearLinkageProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
    126     public SingleObjectiveLinearLinkageProgrammableProblem()
    127       : base(string.Format(ScriptTemplates.CompiledSingleObjectiveProblemDefinition, "HeuristicLab.Encodings.LinearLinkageEncoding", "LinearLinkageEncoding", "LinearLinkage")) { }
     110    private MultiObjectiveSymbolicExpressionTreeProgrammableProblem(bool deserializing) : base(deserializing) { }
     111    private MultiObjectiveSymbolicExpressionTreeProgrammableProblem(MultiObjectiveSymbolicExpressionTreeProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
     112    public MultiObjectiveSymbolicExpressionTreeProgrammableProblem()
     113      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "SymbolicExpressionTreeEncoding", "SymbolicExpressionTree")) { }
    128114
    129115    public override IDeepCloneable Clone(Cloner cloner) {
    130       return new SingleObjectiveLinearLinkageProgrammableProblem(this, cloner);
     116      return new MultiObjectiveSymbolicExpressionTreeProgrammableProblem(this, cloner);
     117    }
     118  }
     119
     120  [Item("Linear Linkage Programmable Problem (multi-objective)", "Represents a linear linkage multi-objective problem that can be programmed with a script.")]
     121  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
     122  [StorableClass]
     123  public sealed class MultiObjectiveLinearLinkageProgrammableProblem : MultiObjectiveProgrammableProblem<LinearLinkageEncoding, LinearLinkage> {
     124
     125    [StorableConstructor]
     126    private MultiObjectiveLinearLinkageProgrammableProblem(bool deserializing) : base(deserializing) { }
     127    private MultiObjectiveLinearLinkageProgrammableProblem(MultiObjectiveLinearLinkageProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
     128    public MultiObjectiveLinearLinkageProgrammableProblem()
     129      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.LinearLinkageEncoding", "LinearLinkageEncoding", "LinearLinkage")) { }
     130
     131    public override IDeepCloneable Clone(Cloner cloner) {
     132      return new MultiObjectiveLinearLinkageProgrammableProblem(this, cloner);
    131133    }
    132134  }*/
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs

    r13345 r13350  
    2929  [Item("Single-objective Problem Definition Script", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")]
    3030  [StorableClass]
    31   public class SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent
     31  public sealed class SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent
    3232    where TEncoding : class, IEncoding<TSolution>
    3333    where TSolution : class, ISolution {
    3434    public string Filename { get; set; }
    3535
    36     protected new ISingleObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition {
     36    private new ISingleObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition {
    3737      get { return (ISingleObjectiveProblemDefinition<TEncoding, TSolution>)base.CompiledProblemDefinition; }
    3838    }
    3939
    4040    [StorableConstructor]
    41     protected SingleObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
    42     protected SingleObjectiveProblemDefinitionScript(SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { }
     41    private SingleObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }
     42    private SingleObjectiveProblemDefinitionScript(SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { }
    4343    public SingleObjectiveProblemDefinitionScript(string codeTemplate) : base(codeTemplate) { }
    4444    public SingleObjectiveProblemDefinitionScript() { }
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs

    r13348 r13350  
    3030using HeuristicLab.Parameters;
    3131using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     32using HeuristicLab.Scripting;
    3233
    3334namespace HeuristicLab.Problems.Programmable {
     
    4950    }
    5051
     52
     53    Script IProgrammableProblem.ProblemScript {
     54      get { return ProblemScript; }
     55    }
    5156    public SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> ProblemScript {
    5257      get { return SingleObjectiveProblemScriptParameter.Value; }
     
    6772    public SingleObjectiveProgrammableProblem()
    6873      : base() {
    69       Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
     74      Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.",
     75        new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
    7076      Operators.Add(new BestScopeSolutionAnalyzer());
    7177      RegisterEvents();
     
    104110      return ProblemDefinition.GetNeighbors(individual, random);
    105111    }
    106 
    107     #region IProgrammableProblem Members
    108     Scripting.Script IProgrammableProblem.ProblemScript {
    109       get { return ProblemScript; }
    110     }
    111     #endregion
    112112  }
    113113}
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblems.cs

    r13348 r13350  
    5151    }
    5252  }
     53  //TODO
    5354  /*
    5455  [Item("Integer Vector Programmable Problem (single-objective)", "Represents an integer vector single-objective problem that can be programmed with a script.")]
Note: See TracChangeset for help on using the changeset viewer.