- Timestamp:
- 11/20/14 15:12:27 (10 years ago)
- 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 35 35 [Item("BinaryEncoding", "Describes a binary vector encoding.")] 36 36 [StorableClass] 37 public sealed class BinaryEncoding : Encoding {37 public sealed class BinaryEncoding : Encoding<IBinaryVectorCreator> { 38 38 #region Encoding Parameters 39 39 [Storable] … … 53 53 #endregion 54 54 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 66 55 public int Length { 67 56 get { return LengthParameter.Value.Value; } … … 80 69 : base(original, cloner) { 81 70 lengthParameter = cloner.Clone(original.lengthParameter); 82 encodingOperators = original.Operators.Select(cloner.Clone).ToList();83 71 RegisterParameterEvents(); 84 72 } … … 123 111 #endregion 124 112 125 public void ConfigureOperators(IEnumerable<IOperator> operators) {113 public override void ConfigureOperators(IEnumerable<IOperator> operators) { 126 114 ConfigureCreators(operators.OfType<IBinaryVectorCreator>()); 127 115 ConfigureCrossovers(operators.OfType<IBinaryVectorCrossover>()); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/Encoding.cs
r11553 r11559 31 31 [Item("Encoding", "Base class for describing different encodings.")] 32 32 [StorableClass] 33 public abstract class Encoding : NamedItem, IEncoding { 33 public abstract class Encoding<T> : NamedItem, IEncoding 34 where T : class,ISolutionCreator { 34 35 public override sealed bool CanChangeName { 35 36 get { return false; } … … 40 41 } 41 42 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); } 45 48 } 46 49 47 public virtual ISolutionCreator DefaultSolutionCreator { 50 51 ISolutionCreator IEncoding.DefaultSolutionCreator { get { return DefaultSolutionCreator; } } 52 public virtual T DefaultSolutionCreator { 48 53 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 } 49 76 } 50 77 51 78 [StorableConstructor] 52 79 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 } 55 86 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 56 101 57 102 public event EventHandler ParameterConfigurationChanged; -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerEncoding.cs
r11484 r11559 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Encodings.IntegerVectorEncoding; 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 30 … … 31 32 [Item("IntegerEncoding", "Describes an integer vector encoding.")] 32 33 [StorableClass] 33 public class IntegerEncoding : Encoding {34 public class IntegerEncoding : Encoding<IIntegerVectorCreator> { 34 35 [Storable] 35 36 private IntValue length; -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/MultiEncoding.cs
r11484 r11559 30 30 [Item("MultiEncoding", "Describes a combined encoding consisting of multiple simpler encodings.")] 31 31 [StorableClass] 32 public class MultiEncoding : Encoding {32 public class MultiEncoding : Encoding<MultiEncodingCreator> { 33 33 [Storable] 34 public KeyedItemCollection<string, Encoding> Encodings { get; protected set; }34 public KeyedItemCollection<string, IEncoding> Encodings { get; protected set; } 35 35 36 36 [StorableConstructor] … … 42 42 public MultiEncoding() 43 43 : base("MultiEncoding") { 44 Encodings = new NamedItemCollection< Encoding>();44 Encodings = new NamedItemCollection<IEncoding>(); 45 45 } 46 46 -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/PermutationEncoding.cs
r11484 r11559 29 29 [Item("PermutationEncoding", "Describes a permutation encoding.")] 30 30 [StorableClass] 31 public class PermutationEncoding : Encoding {31 public class PermutationEncoding : Encoding<IPermutationCreator> { 32 32 [Storable] 33 33 private IntValue length; -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs
r11553 r11559 21 21 22 22 using System; 23 using System.Collections;24 23 using System.Collections.Generic; 25 24 using System.Linq; 26 using System.Runtime.CompilerServices;27 using System.Text;28 25 using HeuristicLab.Common; 29 26 using HeuristicLab.Core; … … 38 35 [Item("RealEncoding", "Describes a real vector encoding.")] 39 36 [StorableClass] 40 public sealed class RealEncoding : Encoding {37 public sealed class RealEncoding : Encoding<IRealVectorCreator> { 41 38 #region Encoding Parameters 42 39 [Storable] … … 69 66 #endregion 70 67 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 82 68 public int Length { 83 69 get { return LengthParameter.Value.Value; } … … 88 74 set { BoundsParameter.Value = value; } 89 75 } 90 91 92 76 93 77 [StorableConstructor] … … 104 88 lengthParameter = cloner.Clone(original.lengthParameter); 105 89 boundsParameter = cloner.Clone(original.boundsParameter); 106 encodingOperators = original.Operators.Select(cloner.Clone).ToList();107 90 RegisterParameterEvents(); 108 91 } 109 110 111 92 112 93 public RealEncoding(string name, int length, double min, double max) … … 149 130 ConfigureOperators(Operators); 150 131 } 132 151 133 private void RegisterParameterEvents() { 152 134 RegisterLengthParameterEvents(); … … 166 148 static RealEncoding() { 167 149 encodingSpecificOperatorTypes = new List<Type>() { 168 169 170 171 172 173 174 175 176 177 178 179 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 }; 181 163 } 182 164 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); 185 166 var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t)); 186 167 var newOperators = operators.Except(encodingOperators, new TypeEqualityComparer<IOperator>()).ToList(); … … 188 169 ConfigureOperators(newOperators); 189 170 encodingOperators.AddRange(newOperators); 171 172 foreach (var strategyVectorCreator in Operators.OfType<IRealVectorStdDevStrategyParameterCreator>()) 173 strategyVectorCreator.BoundsParameter.ValueChanged += strategyVectorCreator_BoundsParameter_ValueChanged; 190 174 } 191 175 #endregion 192 176 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) { 194 186 ConfigureCreators(operators.OfType<IRealVectorCreator>()); 195 187 ConfigureCrossovers(operators.OfType<IRealVectorCrossover>()); … … 201 193 ConfigureShakingOperators(operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>()); 202 194 ConfigureBoundsCheckers(operators.OfType<IRealVectorBoundsChecker>()); 195 ConfigureMoveGenerators(operators.OfType<IRealVectorMoveGenerator>()); 203 196 ConfigureMoveOperators(operators.OfType<IRealVectorMoveOperator>()); 204 Configure MoveGenerators(operators.OfType<IRealVectorMoveGenerator>());197 ConfigureAdditiveMoveOperator(operators.OfType<IAdditiveRealVectorMoveOperator>()); 205 198 } 206 199 … … 236 229 } 237 230 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++) { 241 233 bounds[i, 0] = 0; 234 bounds[i, 1] = 0.1 * (Bounds[i, 1] - Bounds[i, 0]); 242 235 } 243 236 foreach (var s in strategyOperators) { … … 303 296 moveGenerator.BoundsParameter.ActualName = BoundsParameter.Name; 304 297 } 298 299 private void ConfigureAdditiveMoveOperator(IEnumerable<IAdditiveRealVectorMoveOperator> additiveMoveOperators) { 300 foreach (var additiveMoveOperator in additiveMoveOperators) { 301 additiveMoveOperator.AdditiveMoveParameter.ActualName = Name + "_AdditiveMove"; 302 } 303 } 305 304 #endregion 306 305 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Helper.cs
r11484 r11559 30 30 namespace HeuristicLab.Problems.Programmable { 31 31 internal static class Helper { 32 internal static Individual Extract(IScope scope, Encoding encoding) {32 internal static Individual Extract(IScope scope, IEncoding encoding) { 33 33 Dictionary<string, BinaryVector> binDict = null; 34 34 Dictionary<string, IntegerVector> intDict = null; -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IEncoding.cs
r11553 r11559 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Dynamic; 24 25 using System.Linq; 25 26 using System.Text; … … 30 31 public interface IEncoding : INamedItem 31 32 { 33 32 34 ISolutionCreator DefaultSolutionCreator { get; } 35 ISolutionCreator SolutionCreator { get; set; } 36 37 33 38 IEnumerable<IValueParameter> Parameters { get; } 34 39 IEnumerable<IOperator> Operators { get; } 35 40 //event EventHandler ParameterConfigurationChanged; 41 42 void ConfigureOperator(IOperator @operator); 43 void ConfigureOperators(IEnumerable<IOperator> operators); 36 44 } 37 45 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IMultiObjectiveProgrammableProblemAnalyzer.cs
r11484 r11559 27 27 public interface IMultiObjectiveProgrammableProblemAnalyzer : IAnalyzer { 28 28 ILookupParameter<IMultiObjectiveProblemDefinition> ProblemDefinitionParameter { get; } 29 ILookupParameter< Encoding> EncodingParameter { get; }29 ILookupParameter<IEncoding> EncodingParameter { get; } 30 30 IScopeTreeLookupParameter<DoubleArray> QualitiesParameter { get; } 31 31 ILookupParameter<ResultCollection> ResultsParameter { get; } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IMultiObjectiveProgrammableProblemEvaluator.cs
r11484 r11559 26 26 public interface IMultiObjectiveProgrammableProblemEvaluator : IMultiObjectiveEvaluator { 27 27 ILookupParameter<IMultiObjectiveProblemDefinition> ProblemDefinitionParameter { get; } 28 ILookupParameter< Encoding> EncodingParameter { get; }28 ILookupParameter<IEncoding> EncodingParameter { get; } 29 29 } 30 30 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProgrammableProblemAnalyzer.cs
r11484 r11559 27 27 public interface ISingleObjectiveProgrammableProblemAnalyzer : IAnalyzer { 28 28 ILookupParameter<ISingleObjectiveProblemDefinition> ProblemDefinitionParameter { get; } 29 ILookupParameter< Encoding> EncodingParameter { get; }29 ILookupParameter<IEncoding> EncodingParameter { get; } 30 30 IScopeTreeLookupParameter<DoubleValue> QualityParameter { get; } 31 31 ILookupParameter<ResultCollection> ResultsParameter { get; } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/ISingleObjectiveProgrammableProblemEvaluator.cs
r11484 r11559 26 26 public interface ISingleObjectiveProgrammableProblemEvaluator : ISingleObjectiveEvaluator { 27 27 ILookupParameter<ISingleObjectiveProblemDefinition> ProblemDefinitionParameter { get; } 28 ILookupParameter< Encoding> EncodingParameter { get; }28 ILookupParameter<IEncoding> EncodingParameter { get; } 29 29 } 30 30 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinition.cs
r11485 r11559 36 36 protected MultiObjectiveProblemDefinition(bool deserializing) : base(deserializing) { } 37 37 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) { } 41 41 } 42 42 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiObjectiveAnalyzer.cs
r11484 r11559 20 20 } 21 21 22 public ILookupParameter< Encoding> EncodingParameter {23 get { return (ILookupParameter< Encoding>)Parameters["Encoding"]; }22 public ILookupParameter<IEncoding> EncodingParameter { 23 get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; } 24 24 } 25 25 … … 38 38 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 39 39 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.")); 41 41 Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The qualities of the parameter vector.")); 42 42 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The results collection to write to.")); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiObjectiveEvaluator.cs
r11484 r11559 42 42 } 43 43 44 public ILookupParameter< Encoding> EncodingParameter {45 get { return (ILookupParameter< Encoding>)Parameters["Encoding"]; }44 public ILookupParameter<IEncoding> EncodingParameter { 45 get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; } 46 46 } 47 47 … … 56 56 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 57 57 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.")); 59 59 Parameters.Add(new LookupParameter<DoubleArray>("Qualities", "The qualities of the parameter vector.")); 60 60 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveAnalyzer.cs
r11484 r11559 20 20 } 21 21 22 public ILookupParameter< Encoding> EncodingParameter {23 get { return (ILookupParameter< Encoding>)Parameters["Encoding"]; }22 public ILookupParameter<IEncoding> EncodingParameter { 23 get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; } 24 24 } 25 25 … … 38 38 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 39 39 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.")); 41 41 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The quality of the parameter vector.")); 42 42 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The results collection to write to.")); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveEvaluator.cs
r11484 r11559 42 42 } 43 43 44 public ILookupParameter< Encoding> EncodingParameter {45 get { return (ILookupParameter< Encoding>)Parameters["Encoding"]; }44 public ILookupParameter<IEncoding> EncodingParameter { 45 get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; } 46 46 } 47 47 … … 56 56 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 57 57 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.")); 59 59 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector.")); 60 60 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveImprover.cs
r11484 r11559 25 25 } 26 26 27 public ILookupParameter< Encoding> EncodingParameter {28 get { return (ILookupParameter< Encoding>)Parameters["Encoding"]; }27 public ILookupParameter<IEncoding> EncodingParameter { 28 get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; } 29 29 } 30 30 … … 55 55 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 56 56 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.")); 58 58 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector.")); 59 59 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 42 42 } 43 43 44 public ILookupParameter< Encoding> EncodingParameter {45 get { return (ILookupParameter< Encoding>)Parameters["Encoding"]; }44 public ILookupParameter<IEncoding> EncodingParameter { 45 get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; } 46 46 } 47 47 … … 60 60 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 61 61 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.")); 63 63 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector.")); 64 64 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the move.")); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveGenerator.cs
r11484 r11559 48 48 } 49 49 50 public ILookupParameter< Encoding> EncodingParameter {51 get { return (ILookupParameter< Encoding>)Parameters["Encoding"]; }50 public ILookupParameter<IEncoding> EncodingParameter { 51 get { return (ILookupParameter<IEncoding>)Parameters["Encoding"]; } 52 52 } 53 53 … … 60 60 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to sample.")); 61 61 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.")); 63 63 } 64 64 -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveMaker.cs
r11484 r11559 33 33 [StorableClass] 34 34 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"]; } 37 37 } 38 38 … … 49 49 protected SingleObjectiveMoveMaker(SingleObjectiveMoveMaker original, Cloner cloner) : base(original, cloner) { } 50 50 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.")); 52 52 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector.")); 53 53 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the move.")); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinition.cs
r11485 r11559 36 36 protected SingleObjectiveProblemDefinition(bool deserializing) : base(deserializing) { } 37 37 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) { } 41 41 } 42 42 }
Note: See TracChangeset
for help on using the changeset viewer.