Changeset 1791 for trunk/sources
- Timestamp:
- 05/13/09 20:55:58 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.SimOpt/3.2/SimOptSelfAdaptiveNumericVectorNormalMutation.cs
r1530 r1791 48 48 49 49 ConstrainedItemList parameters = GetVariableValue<ConstrainedItemList>("Items", scope, false); 50 int tries;51 50 ConstrainedItemList temp = null; 52 51 ICollection<IConstraint> tmp; … … 54 53 NormalDistributedRandom nd = new NormalDistributedRandom(random, 0.0, 1.0); 55 54 56 for (tries = 0; tries < 10000; tries++){55 do { 57 56 temp = (ConstrainedItemList)parameters.Clone(); 58 57 … … 73 72 } 74 73 } 75 if (temp.EndCombinedOperation(out tmp)) break; 76 } 74 } while (!temp.EndCombinedOperation(out tmp)); 77 75 78 if (tries < 10000) { 79 parameters.BeginCombinedOperation(); 80 for (int i = 0; i < temp.Count; i++) 81 parameters.TrySetAt(i, temp[i], out tmp); 82 parameters.EndCombinedOperation(out tmp); 83 } else throw new InvalidOperationException("ERROR in SimOptSelfAdaptiveNumericVectorProbabilityMutation: no feasible result in 10000 tries"); 76 parameters.BeginCombinedOperation(); 77 for (int i = 0; i < temp.Count; i++) 78 parameters.TrySetAt(i, temp[i], out tmp); 79 parameters.EndCombinedOperation(out tmp); 84 80 85 81 return null;
Note: See TracChangeset
for help on using the changeset viewer.