linear csacutoff fix
[unres.git] / source / ga / GA.f
index 8e2225d..13af8fe 100644 (file)
@@ -229,7 +229,7 @@ c --- debug begin ---
 c --- debug end ---
 
          call WriteBank(bank)
-         csacutoff=csacutoff-(cicutoff/maxgen)
+         csacutoff=csacutoff-(generation*cicutoff/maxgen)
 c       csacutoff=cicutoff*(0.8**(iter-1))
 
          write(tmptext,'(F7.5)') csacutoff
@@ -462,7 +462,7 @@ c ======================================================================
 c  GetNBest subroutine
 c ======================================================================
 c Fills up the bank population up to banksize with individuals from
-c inputpop heving the best(lowest) score
+c inputpop having the best(lowest) score
 c ----------------------------------------------------------------------
 
       subroutine GetNBest(inputpop,bank,banksize)
@@ -475,7 +475,7 @@ c ----------------------------------------------------------------------
        last=0.0
        idx=1
        do j=1,banksize
-       best=100000000000000000.0
+       best=huge(0.0d0)
         do i=1,banksize*BANK_MULTIPLIER
          if ((inputpop(i,20).lt.best).and.(inputpop(i,20).gt.last)) then
           best=inputpop(i,20)
@@ -1521,6 +1521,8 @@ c ----------------------------------------------------------------------
          endif
         end do
         if (pop(i,20).eq.0) then
+c Setting FFV to a realy big valiue or otherwise CalcFittness will have problems
+         pop(i,20)=huge(0.0d0)
          call write2log("ERROR while reading FFV from "//filename)
         endif 
         close(izenergy)