Changeset 8086 for branches/ScatterSearch (trunk integration)/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCreator.cs
- Timestamp:
- 06/22/12 11:11:38 (13 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 20 20 bin 21 21 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Encodings.IntegerVectorEncoding
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding merged eligible /branches/Benchmarking/sources/HeuristicLab.Encodings.IntegerVectorEncoding 6917-7005 /branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding 4656-4721 /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.IntegerVectorEncoding 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Encodings.IntegerVectorEncoding 5815-6180 /branches/DataAnalysis/HeuristicLab.Encodings.IntegerVectorEncoding 4458-4459,4462,4464 /branches/GP.Grammar.Editor/HeuristicLab.Encodings.IntegerVectorEncoding 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.IntegerVectorEncoding 5060 /branches/IntegerVectorEncoding/HeuristicLab.Encodings.IntegerVectorEncoding 7681-8018 /branches/NET40/sources/HeuristicLab.Encodings.IntegerVectorEncoding 5138-5162 /branches/ParallelEngine/HeuristicLab.Encodings.IntegerVectorEncoding 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Encodings.IntegerVectorEncoding 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Encodings.IntegerVectorEncoding 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Encodings.IntegerVectorEncoding 6828 /branches/SuccessProgressAnalysis/HeuristicLab.Encodings.IntegerVectorEncoding 5370-5682 /branches/Trunk/HeuristicLab.Encodings.IntegerVectorEncoding 6829-6865 /branches/VNS/HeuristicLab.Encodings.IntegerVectorEncoding 5594-5752 /branches/histogram/HeuristicLab.Encodings.IntegerVectorEncoding 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCreator.cs
r7259 r8086 47 47 get { return (IValueLookupParameter<IntValue>)Parameters["Length"]; } 48 48 } 49 public IValueLookupParameter<IntValue> MinimumParameter { 50 get { return (IValueLookupParameter<IntValue>)Parameters["Minimum"]; } 51 } 52 public IValueLookupParameter<IntValue> MaximumParameter { 53 get { return (IValueLookupParameter<IntValue>)Parameters["Maximum"]; } 49 public IValueLookupParameter<IntMatrix> BoundsParameter { 50 get { return (IValueLookupParameter<IntMatrix>)Parameters["Bounds"]; } 54 51 } 55 52 … … 62 59 Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The vector which should be manipulated.")); 63 60 Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the vector.")); 64 Parameters.Add(new ValueLookupParameter<IntValue>("Minimum", "The inclusive lower bound for each element in the vector.")); 65 Parameters.Add(new ValueLookupParameter<IntValue>("Maximum", "The exclusive upper bound for each element in the vector.")); 61 Parameters.Add(new ValueLookupParameter<IntMatrix>("Bounds", "The bounds matrix can contain one row for each dimension with three columns specifying minimum (inclusive), maximum (exclusive), and step size. If less rows are given the matrix is cycled.")); 66 62 } 67 63 64 // BackwardsCompatibility3.3 65 #region Backwards compatible code, remove with 3.4 66 [StorableHook(HookType.AfterDeserialization)] 67 private void AfterDeserialization() { 68 if (!Parameters.ContainsKey("Bounds")) { 69 var min = ((IValueLookupParameter<IntValue>)Parameters["Minimum"]).Value as IntValue; 70 var max = ((IValueLookupParameter<IntValue>)Parameters["Maximum"]).Value as IntValue; 71 Parameters.Remove("Minimum"); 72 Parameters.Remove("Maximum"); 73 Parameters.Add(new ValueLookupParameter<IntMatrix>("Bounds", "The bounds matrix can contain one row for each dimension with three columns specifying minimum (inclusive), maximum (exclusive), and step size. If less rows are given the matrix is cycled.")); 74 if (min != null && max != null) { 75 BoundsParameter.Value = new IntMatrix(new int[,] { { min.Value, max.Value, 1 } }); 76 } 77 } 78 } 79 #endregion 80 68 81 public sealed override IOperation Apply() { 69 IntegerVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, MinimumParameter.ActualValue, MaximumParameter.ActualValue);82 IntegerVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, BoundsParameter.ActualValue); 70 83 return base.Apply(); 71 84 } 72 85 73 protected abstract IntegerVector Create(IRandom random, IntValue length, Int Value minimum, IntValue maximum);86 protected abstract IntegerVector Create(IRandom random, IntValue length, IntMatrix bounds); 74 87 } 75 88 }
Note: See TracChangeset
for help on using the changeset viewer.