Changeset 8086 for branches/ScatterSearch (trunk integration)/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVector.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/IntegerVector.cs
r7259 r8086 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 49 50 } 50 51 51 public virtual void Randomize(IRandom random, int startIndex, int length, int min, int max ) {52 public virtual void Randomize(IRandom random, int startIndex, int length, int min, int max, int step = 1) { 52 53 if (length > 0) { 53 for (int i = 0; i < length; i++) 54 array[startIndex + i] = random.Next(min, max); 54 int numbers = (int)Math.Floor((max - min) / (double)step); 55 for (int i = startIndex; i < startIndex + length; i++) { 56 array[i] = random.Next(numbers) * step + min; 57 } 55 58 OnReset(); 56 59 } 57 60 } 58 public void Randomize(IRandom random, int min, int max) { 59 Randomize(random, 0, Length, min, max); 61 public virtual void Randomize(IRandom random, int startIndex, int length, IntMatrix bounds) { 62 if (length > 0) { 63 for (int i = startIndex; i < startIndex + length; i++) { 64 int min = bounds[i % bounds.Rows, 0], max = bounds[i % bounds.Rows, 1], step = 1; 65 if (bounds.Columns > 2) step = bounds[i % bounds.Rows, 2]; 66 int numbers = (int)Math.Floor((max - min) / (double)step); 67 array[i] = random.Next(numbers) * step + min; 68 } 69 OnReset(); 70 } 71 } 72 public void Randomize(IRandom random, int min, int max, int step = 1) { 73 Randomize(random, 0, Length, min, max, step); 74 } 75 public void Randomize(IRandom random, IntMatrix bounds) { 76 Randomize(random, 0, Length, bounds); 60 77 } 61 78 }
Note: See TracChangeset
for help on using the changeset viewer.