- Timestamp:
- 05/27/09 23:56:19 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs
r1900 r1923 63 63 Thread executionThread; 64 64 Thread cancelThread; 65 StringBuilder output = new StringBuilder(); 65 66 66 67 … … 160 161 int tempExePointer = 0; 161 162 int tempPersExePointer = 0; 163 double randomNumber; 164 162 165 // fetch variables from scope for create children 163 166 InitializeExecuteCreateChildren(scope); … … 167 170 persistedExecutionPointer.Data = 0; 168 171 executionPointer = 0; 169 172 170 173 Execute(selector, scope); 171 174 … … 174 177 s = scope.SubScopes[1]; 175 178 Execute(ci, s); 176 179 177 180 tempExePointer = executionPointer; 178 181 tempPersExePointer = persistedExecutionPointer.Data; 179 182 // UniformSequentialSubScopesProcessor 180 for (int j = subscopeNr.Data; j < s.SubScopes.Count; j++ 183 for (int j = subscopeNr.Data; j < s.SubScopes.Count; j++) { 181 184 if (executionPointer == persistedExecutionPointer.Data) 182 185 persistedExecutionPointer.Data = tempExePointer; 183 186 executionPointer = tempExePointer; 184 187 185 188 s2 = s.SubScopes[j]; 186 189 Execute(crossover, s2); 187 190 // Stochastic Branch 188 if (random.NextDouble() < probability.Data) 191 192 randomNumber = random.NextDouble(); 193 //output.AppendLine(randomNumber.ToString()); 194 if (randomNumber < probability.Data) 189 195 Execute(mutator, s2); 190 196 else … … 195 201 subscopeNr.Data++; 196 202 } // foreach 197 203 198 204 199 205 Execute(sorter, s); … … 208 214 nrOfGenerations.Data++; 209 215 } // for i 216 217 218 210 219 } // try 211 220 catch (CancelException) { 212 221 Console.WriteLine("Micro engine aborted by cancel flag."); 222 } 223 catch (Exception) { 224 213 225 } 214 226
Note: See TracChangeset
for help on using the changeset viewer.