Changeset 7724 for branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPoolUpdateMethod.cs
- Timestamp:
- 04/12/12 16:42:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPoolUpdateMethod.cs
r7722 r7724 42 42 get { return (ValueLookupParameter<BoolValue>)Parameters["NewSolutions"]; } 43 43 } 44 private ValueLookupParameter<IntValue> ReferenceSetSizeParameter { 45 get { return (ValueLookupParameter<IntValue>)Parameters["ReferenceSetSize"]; } 46 } 44 47 #endregion 45 48 46 49 #region Properties 47 p ublicIScope CurrentScope {50 private IScope CurrentScope { 48 51 get { return CurrentScopeParameter.ActualValue; } 49 52 } 50 p ublicBoolValue NewSolutions {53 private BoolValue NewSolutions { 51 54 get { return NewSolutionsParameter.ActualValue; } 55 } 56 private IntValue ReferenceSetSize { 57 get { return ReferenceSetSizeParameter.ActualValue; } 58 set { ReferenceSetSizeParameter.ActualValue = value; } 52 59 } 53 60 #endregion … … 64 71 private void Initialize() { 65 72 #region Create parameters 73 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope to which the new solutions are added as sub-scopes.")); 66 74 Parameters.Add(new ValueLookupParameter<BoolValue>("NewSolutions", "Indicates if new solutions have been found.")); 67 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope to which the new solutions are added as sub-scopes."));75 Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize", "The size of the reference set.")); 68 76 #endregion 69 77 … … 86 94 if ((offspring.SubScopes.OrderByDescending(o => o.Variables["Quality"].Value).First().Variables["Quality"].Value as DoubleValue).Value 87 95 > (parents.SubScopes.OrderByDescending(o => o.Variables["Quality"].Value).First().Variables["Quality"].Value as DoubleValue).Value) { 88 CurrentScope.SubScopes.Replace(CurrentScope.SubScopes.Union(offspring.SubScopes).OrderByDescending(o => o.Variables["Quality"].Value).Take( 10));96 CurrentScope.SubScopes.Replace(CurrentScope.SubScopes.Union(offspring.SubScopes).OrderByDescending(o => o.Variables["Quality"].Value).Take(ReferenceSetSize.Value)); 89 97 NewSolutions.Value = true; 90 98 }
Note: See TracChangeset
for help on using the changeset viewer.