Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/20/14 15:12:27 (10 years ago)
Author:
mkommend
Message:

#2174: Adapted IEncoding and Encoding base class.

Location:
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryEncoding.cs

    r11553 r11559  
    3535  [Item("BinaryEncoding", "Describes a binary vector encoding.")]
    3636  [StorableClass]
    37   public sealed class BinaryEncoding : Encoding {
     37  public sealed class BinaryEncoding : Encoding<IBinaryVectorCreator> {
    3838    #region Encoding Parameters
    3939    [Storable]
     
    5353    #endregion
    5454
    55     private List<IOperator> encodingOperators = new List<IOperator>();
    56     [Storable]
    57     public override IEnumerable<IOperator> Operators {
    58       get { return encodingOperators; }
    59       protected set { encodingOperators = new List<IOperator>(value); }
    60     }
    61 
    62     public override ISolutionCreator DefaultSolutionCreator {
    63       get { return Operators.OfType<RandomBinaryVectorCreator>().First(); }
    64     }
    65 
    6655    public int Length {
    6756      get { return LengthParameter.Value.Value; }
     
    8069      : base(original, cloner) {
    8170      lengthParameter = cloner.Clone(original.lengthParameter);
    82       encodingOperators = original.Operators.Select(cloner.Clone).ToList();
    8371      RegisterParameterEvents();
    8472    }
     
    123111    #endregion
    124112
    125     public void ConfigureOperators(IEnumerable<IOperator> operators) {
     113    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
    126114      ConfigureCreators(operators.OfType<IBinaryVectorCreator>());
    127115      ConfigureCrossovers(operators.OfType<IBinaryVectorCrossover>());
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/Encoding.cs

    r11553 r11559  
    3131  [Item("Encoding", "Base class for describing different encodings.")]
    3232  [StorableClass]
    33   public abstract class Encoding : NamedItem, IEncoding {
     33  public abstract class Encoding<T> : NamedItem, IEncoding
     34    where T : class,ISolutionCreator {
    3435    public override sealed bool CanChangeName {
    3536      get { return false; }
     
    4041    }
    4142
    42     public virtual IEnumerable<IOperator> Operators {
    43       get { return Enumerable.Empty<IOperator>(); }
    44       protected set { }
     43    protected List<IOperator> encodingOperators = new List<IOperator>();
     44    [Storable]
     45    public IEnumerable<IOperator> Operators {
     46      get { return encodingOperators; }
     47      protected set { encodingOperators = new List<IOperator>(value); }
    4548    }
    4649
    47     public virtual ISolutionCreator DefaultSolutionCreator {
     50
     51    ISolutionCreator IEncoding.DefaultSolutionCreator { get { return DefaultSolutionCreator; } }
     52    public virtual T DefaultSolutionCreator {
    4853      get { return null; }
     54    }
     55
     56
     57    ISolutionCreator IEncoding.SolutionCreator {
     58      get { return SolutionCreator; }
     59      set {
     60        if (!(value is T)) throw new ArgumentException("???");
     61        SolutionCreator = (T)value;
     62      }
     63    }
     64    private T solutionCreator;
     65    public T SolutionCreator {
     66      get {
     67        if (solutionCreator == null) return DefaultSolutionCreator;
     68        return solutionCreator;
     69      }
     70      set {
     71        if (value == null) throw new ArgumentNullException("SolutionCreator must not be null.");
     72        if (solutionCreator == value) return;
     73        solutionCreator = value;
     74        OnSolutionCreatorChanged();
     75      }
    4976    }
    5077
    5178    [StorableConstructor]
    5279    protected Encoding(bool deserializing) : base(deserializing) { }
    53     protected Encoding(Encoding original, Cloner cloner)
    54       : base(original, cloner) { }
     80
     81    protected Encoding(Encoding<T> original, Cloner cloner)
     82      : base(original, cloner) {
     83      encodingOperators = original.Operators.Select(cloner.Clone).ToList();
     84      solutionCreator = cloner.Clone(original.solutionCreator);
     85    }
    5586    protected Encoding(string name) : base(name) { }
     87
     88
     89
     90    public void ConfigureOperator(IOperator @operator) {
     91      ConfigureOperators(new[] { @operator });
     92    }
     93    public virtual void ConfigureOperators(IEnumerable<IOperator> operators) {
     94
     95    }
     96
     97    protected virtual void OnSolutionCreatorChanged() {
     98      ConfigureOperator(SolutionCreator);
     99    }
     100
    56101
    57102    public event EventHandler ParameterConfigurationChanged;
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerEncoding.cs

    r11484 r11559  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Encodings.IntegerVectorEncoding;
    2829using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2930
     
    3132  [Item("IntegerEncoding", "Describes an integer vector encoding.")]
    3233  [StorableClass]
    33   public class IntegerEncoding : Encoding {
     34  public class IntegerEncoding : Encoding<IIntegerVectorCreator> {
    3435    [Storable]
    3536    private IntValue length;
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/MultiEncoding.cs

    r11484 r11559  
    3030  [Item("MultiEncoding", "Describes a combined encoding consisting of multiple simpler encodings.")]
    3131  [StorableClass]
    32   public class MultiEncoding : Encoding {
     32  public class MultiEncoding : Encoding<MultiEncodingCreator> {
    3333    [Storable]
    34     public KeyedItemCollection<string, Encoding> Encodings { get; protected set; }
     34    public KeyedItemCollection<string, IEncoding> Encodings { get; protected set; }
    3535
    3636    [StorableConstructor]
     
    4242    public MultiEncoding()
    4343      : base("MultiEncoding") {
    44       Encodings = new NamedItemCollection<Encoding>();
     44      Encodings = new NamedItemCollection<IEncoding>();
    4545    }
    4646
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/PermutationEncoding.cs

    r11484 r11559  
    2929  [Item("PermutationEncoding", "Describes a permutation encoding.")]
    3030  [StorableClass]
    31   public class PermutationEncoding : Encoding {
     31  public class PermutationEncoding : Encoding<IPermutationCreator> {
    3232    [Storable]
    3333    private IntValue length;
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs

    r11553 r11559  
    2121
    2222using System;
    23 using System.Collections;
    2423using System.Collections.Generic;
    2524using System.Linq;
    26 using System.Runtime.CompilerServices;
    27 using System.Text;
    2825using HeuristicLab.Common;
    2926using HeuristicLab.Core;
     
    3835  [Item("RealEncoding", "Describes a real vector encoding.")]
    3936  [StorableClass]
    40   public sealed class RealEncoding : Encoding {
     37  public sealed class RealEncoding : Encoding<IRealVectorCreator> {
    4138    #region Encoding Parameters
    4239    [Storable]
     
    6966    #endregion
    7067
    71     private List<IOperator> encodingOperators = new List<IOperator>();
    72     [Storable]
    73     public override IEnumerable<IOperator> Operators {
    74       get { return encodingOperators; }
    75       protected set { encodingOperators = new List<IOperator>(value); }
    76     }
    77 
    78     public override ISolutionCreator DefaultSolutionCreator {
    79       get { return Operators.OfType<UniformRandomRealVectorCreator>().First(); }
    80     }
    81 
    8268    public int Length {
    8369      get { return LengthParameter.Value.Value; }
     
    8874      set { BoundsParameter.Value = value; }
    8975    }
    90 
    91 
    9276
    9377    [StorableConstructor]
     
    10488      lengthParameter = cloner.Clone(original.lengthParameter);
    10589      boundsParameter = cloner.Clone(original.boundsParameter);
    106       encodingOperators = original.Operators.Select(cloner.Clone).ToList();
    10790      RegisterParameterEvents();
    10891    }
    109 
    110 
    11192
    11293    public RealEncoding(string name, int length, double min, double max)
     
    149130      ConfigureOperators(Operators);
    150131    }
     132
    151133    private void RegisterParameterEvents() {
    152134      RegisterLengthParameterEvents();
     
    166148    static RealEncoding() {
    167149      encodingSpecificOperatorTypes = new List<Type>() {
    168         typeof (IRealVectorOperator),
    169         typeof (IRealVectorCreator),
    170         typeof (IRealVectorCrossover),
    171         typeof (IRealVectorManipulator),
    172         typeof (IRealVectorStdDevStrategyParameterOperator),
    173         typeof (IRealVectorSwarmUpdater),
    174         typeof (IRealVectorParticleCreator),
    175         typeof (IRealVectorParticleUpdater),
    176         typeof (IRealVectorMultiNeighborhoodShakingOperator),
    177         typeof (IRealVectorBoundsChecker),
    178         typeof (IRealVectorMoveOperator),
    179         typeof (IRealVectorMoveGenerator)
    180       };
     150  typeof (IRealVectorOperator),
     151  typeof (IRealVectorCreator),
     152  typeof (IRealVectorCrossover),
     153  typeof (IRealVectorManipulator),
     154  typeof (IRealVectorStdDevStrategyParameterOperator),
     155  typeof (IRealVectorSwarmUpdater),
     156  typeof (IRealVectorParticleCreator),
     157  typeof (IRealVectorParticleUpdater),
     158  typeof (IRealVectorMultiNeighborhoodShakingOperator),
     159  typeof (IRealVectorBoundsChecker),
     160  typeof (IRealVectorMoveOperator),
     161  typeof (IRealVectorMoveGenerator)
     162  };
    181163    }
    182164    private void DiscoverOperators() {
    183       var pluginDescription = ApplicationManager.Manager.GetDeclaringPlugin(typeof(IRealVectorOperator));
    184       var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, pluginDescription, true, false, false);
     165      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, true, false, false);
    185166      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
    186167      var newOperators = operators.Except(encodingOperators, new TypeEqualityComparer<IOperator>()).ToList();
     
    188169      ConfigureOperators(newOperators);
    189170      encodingOperators.AddRange(newOperators);
     171
     172      foreach (var strategyVectorCreator in Operators.OfType<IRealVectorStdDevStrategyParameterCreator>())
     173        strategyVectorCreator.BoundsParameter.ValueChanged += strategyVectorCreator_BoundsParameter_ValueChanged;
    190174    }
    191175    #endregion
    192176
    193     public void ConfigureOperators(IEnumerable<IOperator> operators) {
     177
     178    private void strategyVectorCreator_BoundsParameter_ValueChanged(object sender, EventArgs e) {
     179      var boundsParameter = (IValueLookupParameter<DoubleMatrix>)sender;
     180      if (boundsParameter.Value == null) return;
     181      foreach (var strategyVectorManipulator in Operators.OfType<IRealVectorStdDevStrategyParameterManipulator>())
     182        strategyVectorManipulator.BoundsParameter.Value = (DoubleMatrix)boundsParameter.Value.Clone();
     183    }
     184
     185    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
    194186      ConfigureCreators(operators.OfType<IRealVectorCreator>());
    195187      ConfigureCrossovers(operators.OfType<IRealVectorCrossover>());
     
    201193      ConfigureShakingOperators(operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>());
    202194      ConfigureBoundsCheckers(operators.OfType<IRealVectorBoundsChecker>());
     195      ConfigureMoveGenerators(operators.OfType<IRealVectorMoveGenerator>());
    203196      ConfigureMoveOperators(operators.OfType<IRealVectorMoveOperator>());
    204       ConfigureMoveGenerators(operators.OfType<IRealVectorMoveGenerator>());
     197      ConfigureAdditiveMoveOperator(operators.OfType<IAdditiveRealVectorMoveOperator>());
    205198    }
    206199
     
    236229    }
    237230    private void ConfigureStdDevStrategyParameterOperators(IEnumerable<IRealVectorStdDevStrategyParameterOperator> strategyOperators) {
    238       var bounds = (DoubleMatrix)Bounds.Clone();
    239       for (var i = 0; i < bounds.Rows; i++) {
    240         bounds[i, 1] = 0.1 * (bounds[i, 1] - bounds[i, 0]);
     231      var bounds = new DoubleMatrix(Bounds.Rows, Bounds.Columns);
     232      for (var i = 0; i < Bounds.Rows; i++) {
    241233        bounds[i, 0] = 0;
     234        bounds[i, 1] = 0.1 * (Bounds[i, 1] - Bounds[i, 0]);
    242235      }
    243236      foreach (var s in strategyOperators) {
     
    303296        moveGenerator.BoundsParameter.ActualName = BoundsParameter.Name;
    304297    }
     298
     299    private void ConfigureAdditiveMoveOperator(IEnumerable<IAdditiveRealVectorMoveOperator> additiveMoveOperators) {
     300      foreach (var additiveMoveOperator in additiveMoveOperators) {
     301        additiveMoveOperator.AdditiveMoveParameter.ActualName = Name + "_AdditiveMove";
     302      }
     303    }
    305304    #endregion
    306305  }
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Helper.cs

    r11484 r11559  
    3030namespace HeuristicLab.Problems.Programmable {
    3131  internal static class Helper {
    32     internal static Individual Extract(IScope scope, Encoding encoding) {
     32    internal static Individual Extract(IScope scope, IEncoding encoding) {
    3333      Dictionary<string, BinaryVector> binDict = null;
    3434      Dictionary<string, IntegerVector> intDict = null;
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IEncoding.cs

    r11553 r11559  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Dynamic;
    2425using System.Linq;
    2526using System.Text;
     
    3031  public interface IEncoding : INamedItem
    3132  {
     33   
    3234    ISolutionCreator DefaultSolutionCreator { get; }
     35    ISolutionCreator SolutionCreator { get; set; }
     36
     37
    3338    IEnumerable<IValueParameter> Parameters { get; }
    3439    IEnumerable<IOperator> Operators { get; }
    3540    //event EventHandler ParameterConfigurationChanged;
     41
     42    void ConfigureOperator(IOperator @operator);
     43    void ConfigureOperators(IEnumerable<IOperator> operators);   
    3644  }
    3745}
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IMultiObjectiveProgrammableProblemAnalyzer.cs

    r11484 r11559  
    2727  public interface IMultiObjectiveProgrammableProblemAnalyzer : IAnalyzer {
    2828    ILookupParameter<IMultiObjectiveProblemDefinition> ProblemDefinitionParameter { get; }
    29     ILookupParameter<Encoding> EncodingParameter { get; }
     29    ILookupParameter<IEncoding> EncodingParameter { get; }
    3030    IScopeTreeLookupParameter<DoubleArray> QualitiesParameter { get; }
    3131    ILookupParameter<ResultCollection> ResultsParameter { get; }
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IMultiObjectiveProgrammableProblemEvaluator.cs

    r11484 r11559  
    2626  public interface IMultiObjectiveProgrammableProblemEvaluator : IMultiObjectiveEvaluator {
    2727    ILookupParameter<IMultiObjectiveProblemDefinition> ProblemDefinitionParameter { get; }
    28     ILookupParameter<Encoding> EncodingParameter { get; }
     28    ILookupParameter<IEncoding> EncodingParameter { get; }
    2929  }
    3030}
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProgrammableProblemAnalyzer.cs

    r11484 r11559  
    2727  public interface ISingleObjectiveProgrammableProblemAnalyzer : IAnalyzer {
    2828    ILookupParameter<ISingleObjectiveProblemDefinition> ProblemDefinitionParameter { get; }
    29     ILookupParameter<Encoding> EncodingParameter { get; }
     29    ILookupParameter<IEncoding> EncodingParameter { get; }
    3030    IScopeTreeLookupParameter<DoubleValue> QualityParameter { get; }
    3131    ILookupParameter<ResultCollection> ResultsParameter { get; }
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProgrammableProblemEvaluator.cs

    r11484 r11559  
    2626  public interface ISingleObjectiveProgrammableProblemEvaluator : ISingleObjectiveEvaluator {
    2727    ILookupParameter<ISingleObjectiveProblemDefinition> ProblemDefinitionParameter { get; }
    28     ILookupParameter<Encoding> EncodingParameter { get; }
     28    ILookupParameter<IEncoding> EncodingParameter { get; }
    2929  }
    3030}
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinition.cs

    r11485 r11559  
    3636    protected MultiObjectiveProblemDefinition(bool deserializing) : base(deserializing) { }
    3737    protected MultiObjectiveProblemDefinition(MultiObjectiveProblemDefinition original, Cloner cloner) : base(original, cloner) { }
    38     protected MultiObjectiveProblemDefinition(Encoding encoding) : this(encoding, "MultiObjectiveProblemDefinition", null) { }
    39     protected MultiObjectiveProblemDefinition(Encoding encoding, string name) : this(encoding, name, null) { }
    40     protected MultiObjectiveProblemDefinition(Encoding encoding, string name, string description) : base(encoding, name, description) { }
     38    protected MultiObjectiveProblemDefinition(IEncoding encoding) : this(encoding, "MultiObjectiveProblemDefinition", null) { }
     39    protected MultiObjectiveProblemDefinition(IEncoding encoding, string name) : this(encoding, name, null) { }
     40    protected MultiObjectiveProblemDefinition(IEncoding encoding, string name, string description) : base(encoding, name, description) { }
    4141  }
    4242}
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiObjectiveAnalyzer.cs

    r11484 r11559  
    2020    }
    2121
    22     public ILookupParameter<Encoding> EncodingParameter {
    23       get { return (ILookupParameter<Encoding>)Parameters["Encoding"]; }
     22    public ILookupParameter<IEncoding> EncodingParameter {
     23      get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; }
    2424    }
    2525
     
    3838      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    3939      Parameters.Add(new LookupParameter<IMultiObjectiveProblemDefinition>("ProblemDefinition", "The host that holds the problem definition."));
    40       Parameters.Add(new LookupParameter<Encoding>("Encoding", "An item that holds the problem's encoding."));
     40      Parameters.Add(new LookupParameter<IEncoding>("Encoding", "An item that holds the problem's encoding."));
    4141      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The qualities of the parameter vector."));
    4242      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The results collection to write to."));
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiObjectiveEvaluator.cs

    r11484 r11559  
    4242    }
    4343
    44     public ILookupParameter<Encoding> EncodingParameter {
    45       get { return (ILookupParameter<Encoding>)Parameters["Encoding"]; }
     44    public ILookupParameter<IEncoding> EncodingParameter {
     45      get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; }
    4646    }
    4747
     
    5656      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    5757      Parameters.Add(new LookupParameter<IMultiObjectiveProblemDefinition>("ProblemDefinition", "The host that holds the problem definition."));
    58       Parameters.Add(new LookupParameter<Encoding>("Encoding", "An item that holds the problem's encoding."));
     58      Parameters.Add(new LookupParameter<IEncoding>("Encoding", "An item that holds the problem's encoding."));
    5959      Parameters.Add(new LookupParameter<DoubleArray>("Qualities", "The qualities of the parameter vector."));
    6060    }
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveAnalyzer.cs

    r11484 r11559  
    2020    }
    2121
    22     public ILookupParameter<Encoding> EncodingParameter {
    23       get { return (ILookupParameter<Encoding>)Parameters["Encoding"]; }
     22    public ILookupParameter<IEncoding> EncodingParameter {
     23      get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; }
    2424    }
    2525
     
    3838      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    3939      Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinition>("ProblemDefinition", "The host that holds the problem definition."));
    40       Parameters.Add(new LookupParameter<Encoding>("Encoding", "An item that holds the problem's encoding."));
     40      Parameters.Add(new LookupParameter<IEncoding>("Encoding", "An item that holds the problem's encoding."));
    4141      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
    4242      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The results collection to write to."));
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveEvaluator.cs

    r11484 r11559  
    4242    }
    4343
    44     public ILookupParameter<Encoding> EncodingParameter {
    45       get { return (ILookupParameter<Encoding>)Parameters["Encoding"]; }
     44    public ILookupParameter<IEncoding> EncodingParameter {
     45      get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; }
    4646    }
    4747
     
    5656      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    5757      Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinition>("ProblemDefinition", "The host that holds the problem definition."));
    58       Parameters.Add(new LookupParameter<Encoding>("Encoding", "An item that holds the problem's encoding."));
     58      Parameters.Add(new LookupParameter<IEncoding>("Encoding", "An item that holds the problem's encoding."));
    5959      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
    6060    }
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveImprover.cs

    r11484 r11559  
    2525    }
    2626
    27     public ILookupParameter<Encoding> EncodingParameter {
    28       get { return (ILookupParameter<Encoding>)Parameters["Encoding"]; }
     27    public ILookupParameter<IEncoding> EncodingParameter {
     28      get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; }
    2929    }
    3030
     
    5555      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    5656      Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinition>("ProblemDefinition", "The host that holds the problem definition."));
    57       Parameters.Add(new LookupParameter<Encoding>("Encoding", "An item that holds the problem's encoding."));
     57      Parameters.Add(new LookupParameter<IEncoding>("Encoding", "An item that holds the problem's encoding."));
    5858      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
    5959      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "Whether the problem should be minimized or maximized."));
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveEvaluator.cs

    r11484 r11559  
    4242    }
    4343
    44     public ILookupParameter<Encoding> EncodingParameter {
    45       get { return (ILookupParameter<Encoding>)Parameters["Encoding"]; }
     44    public ILookupParameter<IEncoding> EncodingParameter {
     45      get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; }
    4646    }
    4747
     
    6060      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    6161      Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinition>("ProblemDefinition", "The host that holds the problem definition."));
    62       Parameters.Add(new LookupParameter<Encoding>("Encoding", "An item that holds the problem's encoding."));
     62      Parameters.Add(new LookupParameter<IEncoding>("Encoding", "An item that holds the problem's encoding."));
    6363      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
    6464      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the move."));
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveGenerator.cs

    r11484 r11559  
    4848    }
    4949
    50     public ILookupParameter<Encoding> EncodingParameter {
    51       get { return (ILookupParameter<Encoding>)Parameters["Encoding"]; }
     50    public ILookupParameter<IEncoding> EncodingParameter {
     51      get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; }
    5252    }
    5353
     
    6060      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to sample."));
    6161      Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinition>("ProblemDefinition", "The host that holds the problem definition."));
    62       Parameters.Add(new LookupParameter<Encoding>("Encoding", "An item that holds the problem's encoding."));
     62      Parameters.Add(new LookupParameter<IEncoding>("Encoding", "An item that holds the problem's encoding."));
    6363    }
    6464
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveMaker.cs

    r11484 r11559  
    3333  [StorableClass]
    3434  public class SingleObjectiveMoveMaker : InstrumentedOperator, ISingleObjectiveMoveOperator, IMoveMaker {
    35     public ILookupParameter<Encoding> EncodingParameter {
    36       get { return (ILookupParameter<Encoding>)Parameters["Encoding"]; }
     35    public ILookupParameter<IEncoding> EncodingParameter {
     36      get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; }
    3737    }
    3838
     
    4949    protected SingleObjectiveMoveMaker(SingleObjectiveMoveMaker original, Cloner cloner) : base(original, cloner) { }
    5050    public SingleObjectiveMoveMaker() {
    51       Parameters.Add(new LookupParameter<Encoding>("Encoding", "An item that holds the problem's encoding."));
     51      Parameters.Add(new LookupParameter<IEncoding>("Encoding", "An item that holds the problem's encoding."));
    5252      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
    5353      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the move."));
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinition.cs

    r11485 r11559  
    3636    protected SingleObjectiveProblemDefinition(bool deserializing) : base(deserializing) { }
    3737    protected SingleObjectiveProblemDefinition(SingleObjectiveProblemDefinition original, Cloner cloner) : base(original, cloner) { }
    38     protected SingleObjectiveProblemDefinition(Encoding encoding) : this(encoding, "SingleObjectiveProblemDefinition", null) { }
    39     protected SingleObjectiveProblemDefinition(Encoding encoding, string name) : this(encoding, name, null) { }
    40     protected SingleObjectiveProblemDefinition(Encoding encoding, string name, string description) : base(encoding, name, description) { }
     38    protected SingleObjectiveProblemDefinition(IEncoding encoding) : this(encoding, "SingleObjectiveProblemDefinition", null) { }
     39    protected SingleObjectiveProblemDefinition(IEncoding encoding, string name) : this(encoding, name, null) { }
     40    protected SingleObjectiveProblemDefinition(IEncoding encoding, string name, string description) : base(encoding, name, description) { }
    4141  }
    4242}
Note: See TracChangeset for help on using the changeset viewer.