- Timestamp:
- 02/10/15 09:57:29 (10 years ago)
- Location:
- branches/ALPS
- Files:
-
- 8 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS
- Property svn:mergeinfo changed
-
branches/ALPS/HeuristicLab.Encodings.BinaryVectorEncoding
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/HLScript/HeuristicLab.Encodings.BinaryVectorEncoding merged eligible /stable/HeuristicLab.Encodings.BinaryVectorEncoding merged eligible /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.Encodings.BinaryVectorEncoding 10321-10322 /branches/Algorithms.GradientDescent/HeuristicLab.Encodings.BinaryVectorEncoding 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Encodings.BinaryVectorEncoding 6917-7005 /branches/CloningRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding 4656-4721 /branches/CodeEditor/HeuristicLab.Encodings.BinaryVectorEncoding 11700-11806 /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.BinaryVectorEncoding 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Encodings.BinaryVectorEncoding 5815-6180 /branches/DataAnalysis/HeuristicLab.Encodings.BinaryVectorEncoding 4458-4459,4462,4464 /branches/DataPreprocessing/HeuristicLab.Encodings.BinaryVectorEncoding 10085-11101 /branches/GP.Grammar.Editor/HeuristicLab.Encodings.BinaryVectorEncoding 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.BinaryVectorEncoding 5060 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Encodings.BinaryVectorEncoding 6123-9799 /branches/LogResidualEvaluator/HeuristicLab.Encodings.BinaryVectorEncoding 10202-10483 /branches/NET40/sources/HeuristicLab.Encodings.BinaryVectorEncoding 5138-5162 /branches/ParallelEngine/HeuristicLab.Encodings.BinaryVectorEncoding 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Encodings.BinaryVectorEncoding 7568-7810 /branches/ProgrammableProblem/HeuristicLab.Encodings.BinaryVectorEncoding 11774-11959 /branches/QAPAlgorithms/HeuristicLab.Encodings.BinaryVectorEncoding 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Encodings.BinaryVectorEncoding 6828 /branches/RuntimeOptimizer/HeuristicLab.Encodings.BinaryVectorEncoding 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Encodings.BinaryVectorEncoding 7787-8333 /branches/SlaveShutdown/HeuristicLab.Encodings.BinaryVectorEncoding 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Encodings.BinaryVectorEncoding 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.Encodings.BinaryVectorEncoding 5370-5682 /branches/Trunk/HeuristicLab.Encodings.BinaryVectorEncoding 6829-6865 /branches/UnloadJobs/HeuristicLab.Encodings.BinaryVectorEncoding 9168-9215 /branches/VNS/HeuristicLab.Encodings.BinaryVectorEncoding 5594-5752 /branches/histogram/HeuristicLab.Encodings.BinaryVectorEncoding 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/ALPS/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Creators/RandomBinaryVectorCreator.cs
r11411 r11975 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 35 36 private const string TrueProbabilityParameterName = "TruePropability"; 36 37 37 private I FixedValueParameter<DoubleValue> TrueProbabilityParameter {38 get { return (I FixedValueParameter<DoubleValue>)Parameters[TrueProbabilityParameterName]; }38 private IValueLookupParameter<DoubleValue> TrueProbabilityParameter { 39 get { return (IValueLookupParameter<DoubleValue>)Parameters[TrueProbabilityParameterName]; } 39 40 } 40 41 41 public double TrueProbability {42 get { return TrueProbabilityParameter.Value .Value; }43 set { TrueProbabilityParameter.Value .Value= value; }42 public DoubleValue TrueProbability { 43 get { return TrueProbabilityParameter.Value; } 44 set { TrueProbabilityParameter.Value = value; } 44 45 } 45 46 46 47 [StorableConstructor] 47 48 private RandomBinaryVectorCreator(bool deserializing) : base(deserializing) { } 48 49 49 private RandomBinaryVectorCreator(RandomBinaryVectorCreator original, Cloner cloner) : base(original, cloner) { } 50 50 public override IDeepCloneable Clone(Cloner cloner) { return new RandomBinaryVectorCreator(this, cloner); } 51 52 51 public RandomBinaryVectorCreator() 53 52 : base() { 54 Parameters.Add(new FixedValueParameter<DoubleValue>(TrueProbabilityParameterName, "Probability of true value", new DoubleValue(0.5)));53 Parameters.Add(new ValueLookupParameter<DoubleValue>(TrueProbabilityParameterName, "Probability of true value", new DoubleValue(0.5))); 55 54 } 56 55 57 56 [StorableHook(HookType.AfterDeserialization)] 58 57 private void AfterDeserialization() { 58 // BackwardsCompatibility3.3 59 #region Backwards compatible code, remove with 3.4 60 var defaultValue = 0.5; 61 if (Parameters.ContainsKey(TrueProbabilityParameterName) && Parameters[TrueProbabilityParameterName] is IFixedValueParameter<DoubleValue>) { 62 defaultValue = ((IFixedValueParameter<DoubleValue>)Parameters[TrueProbabilityParameterName]).Value.Value; 63 Parameters.Remove(TrueProbabilityParameterName); 64 } 59 65 if (!Parameters.ContainsKey(TrueProbabilityParameterName)) 60 Parameters.Add(new FixedValueParameter<DoubleValue>(TrueProbabilityParameterName, "Probability of true value", new DoubleValue(0.5))); 66 Parameters.Add(new ValueLookupParameter<DoubleValue>(TrueProbabilityParameterName, "Probability of true value", new DoubleValue(defaultValue))); 67 #endregion 61 68 } 62 69 … … 74 81 //remove with HL 3.4 75 82 if (trueProbability.IsAlmost(0.5)) 76 result = new BinaryVector(length, random);83 result = new BinaryVector(length, random); 77 84 else { 78 85 var values = new bool[length]; … … 85 92 86 93 protected override BinaryVector Create(IRandom random, IntValue length) { 87 return Apply(random, length.Value, TrueProbability); 94 if (TrueProbabilityParameter.ActualValue == null) throw new InvalidOperationException("RandomBinaryVectorCreator: Parameter " + TrueProbabilityParameter.ActualName + " could not be found."); 95 return Apply(random, length.Value, TrueProbabilityParameter.ActualValue.Value); 88 96 } 89 97 } -
branches/ALPS/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/NPointCrossover.cs
r11171 r11975 41 41 /// Number of crossover points. 42 42 /// </summary> 43 public ValueLookupParameter<IntValue> NParameter {44 get { return ( ValueLookupParameter<IntValue>)Parameters["N"]; }43 public IValueLookupParameter<IntValue> NParameter { 44 get { return (IValueLookupParameter<IntValue>)Parameters["N"]; } 45 45 } 46 46 … … 137 137 if (NParameter.ActualValue == null) throw new InvalidOperationException("NPointCrossover: Parameter " + NParameter.ActualName + " could not be found."); 138 138 139 return Apply(random, parents[0], parents[1], NParameter. Value);139 return Apply(random, parents[0], parents[1], NParameter.ActualValue); 140 140 } 141 141 } -
branches/ALPS/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj
r11677 r11975 119 119 </ItemGroup> 120 120 <ItemGroup> 121 <Compile Include="BinaryVectorEncoding.cs" /> 121 122 <Compile Include="Creators\RandomBinaryVectorCreator.cs" /> 122 123 <Compile Include="Crossovers\MultiBinaryVectorCrossover.cs" /> -
branches/ALPS/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Manipulators/SomePositionsBitflipManipulator.cs
r11171 r11975 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 39 40 /// Mmutation probability for each position. 40 41 /// </summary> 41 public ValueLookupParameter<DoubleValue> MutationProbabilityParameter {42 get { return ( ValueLookupParameter<DoubleValue>)Parameters["MutationProbability"]; }42 public IValueLookupParameter<DoubleValue> MutationProbabilityParameter { 43 get { return (IValueLookupParameter<DoubleValue>)Parameters["MutationProbability"]; } 43 44 } 44 45 … … 78 79 /// <param name="realVector">The vector of binary values to manipulate.</param> 79 80 protected override void Manipulate(IRandom random, BinaryVector binaryVector) { 80 Apply(random, binaryVector, MutationProbabilityParameter.Value); 81 if (MutationProbabilityParameter.ActualValue == null) throw new InvalidOperationException("SomePositionsBitflipManipulator: Parameter " + MutationProbabilityParameter.ActualName + " could not be found."); 82 Apply(random, binaryVector, MutationProbabilityParameter.ActualValue); 81 83 } 82 84 } -
branches/ALPS/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipMoveMaker.cs
r11171 r11975 31 31 [Item("OneBitflipMoveMaker", "Peforms a one bitflip move on a given BitVector and updates the quality.")] 32 32 [StorableClass] 33 public class OneBitflipMoveMaker : SingleSuccessorOperator, IOneBitflipMoveOperator, IMoveMaker {33 public class OneBitflipMoveMaker : SingleSuccessorOperator, IOneBitflipMoveOperator, IMoveMaker, ISingleObjectiveOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } -
branches/ALPS/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/StochasticOneBitflipMultiMoveGenerator.cs
r11171 r11975 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 30 31 [Item("StochasticOneBitflipMultiMoveGenerator", "Randomly samples n from all possible one bitflip moves from a given BinaryVector.")] 31 32 [StorableClass] 32 public class StochasticOneBitflipMultiMoveGenerator : OneBitflipMoveGenerator, I MultiMoveGenerator {33 public class StochasticOneBitflipMultiMoveGenerator : OneBitflipMoveGenerator, IStochasticOperator, IMultiMoveGenerator { 33 34 public ILookupParameter<IRandom> RandomParameter { 34 35 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 66 67 protected override OneBitflipMove[] GenerateMoves(BinaryVector binaryVector) { 67 68 IRandom random = RandomParameter.ActualValue; 69 if (SampleSizeParameter.ActualValue == null) throw new InvalidOperationException("StochasticOneBitflipMultiMoveGenerator: Parameter " + SampleSizeParameter.ActualName + " could not be found."); 68 70 return Apply(binaryVector, random, SampleSizeParameter.ActualValue.Value); 69 71 }
Note: See TracChangeset
for help on using the changeset viewer.