Changeset 77 for trunk/sources/HeuristicLab.Evolutionary
- Timestamp:
- 03/18/08 16:00:00 (17 years ago)
- Location:
- trunk/sources/HeuristicLab.Evolutionary
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Evolutionary/CrossoverBase.cs
r72 r77 42 42 for (int i = 0; i < children; i++) { 43 43 IScope parent1 = scope.SubScopes[0]; 44 IScope parent2 = scope.SubScopes[1]; 45 IScope child = new Scope(i.ToString()); 46 scope.AddSubScope(child); 47 Cross(scope, random, parent1, parent2, child); 44 48 scope.RemoveSubScope(parent1); 45 IScope parent2 = scope.SubScopes[0];46 49 scope.RemoveSubScope(parent2); 47 IScope child = new Scope(i.ToString());48 Cross(scope, random, parent1, parent2, child);49 scope.AddSubScope(child);50 50 } 51 51 -
trunk/sources/HeuristicLab.Evolutionary/SubScopesStorer.cs
r40 r77 49 49 AddVariable(new Variable(info.ActualName, subScopesStore)); 50 50 else 51 scope.AddVariable(new Variable( info.ActualName, subScopesStore));51 scope.AddVariable(new Variable(scope.TranslateName(info.FormalName), subScopesStore)); 52 52 } 53 53 … … 64 64 RemoveVariable(info.ActualName); 65 65 else 66 scope.RemoveVariable( info.ActualName);66 scope.RemoveVariable(scope.TranslateName(info.FormalName)); 67 67 } 68 68 return null; -
trunk/sources/HeuristicLab.Evolutionary/SuccessRuleMutationStrengthAdjuster.cs
r2 r77 47 47 if (successProb == null) { 48 48 IVariableInfo successProbInfo = GetVariableInfo("SuccessProbability"); 49 Variable successProbVar = new Variable(successProbInfo.ActualName, new DoubleData(targetSuccessProb.Data)); 50 if (successProbInfo.Local) 49 IVariable successProbVar; 50 if (successProbInfo.Local) { 51 successProbVar = new Variable(successProbInfo.ActualName, new DoubleData(targetSuccessProb.Data)); 51 52 AddVariable(successProbVar); 52 else 53 } else { 54 successProbVar = new Variable(scope.TranslateName(successProbInfo.FormalName), new DoubleData(targetSuccessProb.Data)); 53 55 scope.AddVariable(successProbVar); 56 } 54 57 successProb = (DoubleData)successProbVar.Value; 55 58 } … … 59 62 double success = 0.0; 60 63 for (int i = 0 ; i < scope.SubScopes.Count ; i++) { 61 if (scope.SubScopes[i].GetVariableValue<BoolData>( GetVariableInfo("SuccessfulChild").ActualName, false).Data) {64 if (scope.SubScopes[i].GetVariableValue<BoolData>("SuccessfulChild", false).Data) { 62 65 success++; 63 66 } 64 scope.SubScopes[i].RemoveVariable( GetVariableInfo("SuccessfulChild").ActualName);67 scope.SubScopes[i].RemoveVariable(scope.SubScopes[i].TranslateName("SuccessfulChild")); 65 68 } 66 69 if (scope.SubScopes.Count > 0) success /= scope.SubScopes.Count;
Note: See TracChangeset
for help on using the changeset viewer.