daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim Chromolength as integer
  2. Chromolength = varchromolength * aVariables
  3. Dim i as integer, j as integer, counter as integer
  4. Dim Poparr() As Integer
  5. Dim FitValarr() As Integer
  6.    
  7. ReDim Poparr(1 To PopSize, 1 To Chromolength)
  8.  
  9. For i = 1 To PopSize                
  10.   For j = 1 To Chromolength      
  11.     If Rnd < 0.5 Then          
  12.         Poparr(i, j) = 0
  13.     Else
  14.         Poparr(i, j) = 1        
  15.     End If
  16.   Next j
  17. Next i
  18.  
  19. For i = 1 To PopSize                  
  20.  j = 1                          
  21.  counter = Chromolength              
  22.  Do While counter > 0  
  23.    FitValarr(i) = FitValarr(i) + Poparr(i, counter) * 2 ^ (j - 1)          
  24.   j = j + 1                  
  25.   counter = counter - 1      
  26.  Loop
  27. Next i
  28.    
  29. FitValarr(i) = FitValarr(i) + Poparr(i, counter) * 2 ^ (j - 1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top