Implement write_mod and esc_all for non-epitope WF run.
authorDariusz Murakowski <murakdar@mit.edu>
Tue, 23 Jun 2015 03:49:38 +0000 (23:49 -0400)
committerDariusz Murakowski <murakdar@mit.edu>
Tue, 23 Jun 2015 03:49:38 +0000 (23:49 -0400)
Conflicts:
wf.cpp

1  2 
wf.cpp

diff --cc wf.cpp
--- 1/wf.cpp
--- 2/wf.cpp
+++ b/wf.cpp
@@@ -174,33 -165,9 +174,36 @@@ void run(RunParameters &r, unsigned see
              
          }
          
 -    }
 +        
 +        // Run (w/out targeted epitope)
 +        
 +        else {
 +
 +            for (unsigned int n=0; n<r.num_runs; n++) {
 +            
 +                Hamiltonian H(r.couplingsInfile);
 +                H.set_temp(r.bh, r.bJ);
 +                Population P(H, r.n, r.mu, r.initPop, r.initFrac);
 +                
 +                unsigned int i;
 +                for (i=0; i<r.g; ++i) {
 +                
 +                    P.next_generation(H, rnd, r.useRelative, r.useVerbose);
-                     P.write_population(popout,i+1);
++                    if ((i+1) % r.write_mod == 0) {
++                        P.write_population(popout,i+1);
++                    }
  
 +                    if (r.runUntilEscape && P.escaped(H)) break;
++                    if (r.runUntilEscape_all && P.escaped_all(H)) break;
  
 +                }
 +                
 +            }
 +            
 +        }
 +
 +    }
 +    
      gsl_rng_free(rnd);  //Free up memory from random number generator
  
      // close file handles