Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1923


Ignore:
Timestamp:
05/27/09 23:56:19 (15 years ago)
Author:
dtraxing
Message:

Added debugging code (ticket #580)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs

    r1900 r1923  
    6363    Thread executionThread;
    6464    Thread cancelThread;
     65    StringBuilder output = new StringBuilder();
    6566
    6667
     
    160161      int tempExePointer = 0;
    161162      int tempPersExePointer = 0;
     163      double randomNumber;
     164     
    162165      // fetch variables from scope for create children
    163166      InitializeExecuteCreateChildren(scope);
     
    167170            persistedExecutionPointer.Data = 0;
    168171          executionPointer = 0;
    169          
     172
    170173          Execute(selector, scope);
    171174
     
    174177          s = scope.SubScopes[1];
    175178          Execute(ci, s);
    176          
     179
    177180          tempExePointer = executionPointer;
    178181          tempPersExePointer = persistedExecutionPointer.Data;
    179182          // UniformSequentialSubScopesProcessor
    180           for (int j = subscopeNr.Data; j < s.SubScopes.Count; j++ ) {
     183          for (int j = subscopeNr.Data; j < s.SubScopes.Count; j++) {
    181184            if (executionPointer == persistedExecutionPointer.Data)
    182185              persistedExecutionPointer.Data = tempExePointer;
    183186            executionPointer = tempExePointer;
    184            
     187
    185188            s2 = s.SubScopes[j];
    186189            Execute(crossover, s2);
    187190            // Stochastic Branch
    188             if (random.NextDouble() < probability.Data)
     191
     192            randomNumber = random.NextDouble();
     193            //output.AppendLine(randomNumber.ToString());
     194            if (randomNumber < probability.Data)
    189195              Execute(mutator, s2);
    190196            else
     
    195201            subscopeNr.Data++;
    196202          } // foreach
    197          
     203
    198204
    199205          Execute(sorter, s);
     
    208214          nrOfGenerations.Data++;
    209215        } // for i
     216
     217
     218
    210219      } // try
    211220      catch (CancelException) {
    212221        Console.WriteLine("Micro engine aborted by cancel flag.");
     222      }
     223      catch (Exception) {
     224         
    213225      }
    214226
Note: See TracChangeset for help on using the changeset viewer.