! Check to see if we should exit Avida based on the average generation. The average generation is calculated differently based on whether demes / germlines are used. This method is called based on the events file. */
| 127 | are used. This method is called based on the events file. |
| 128 | */ |
| 129 | void Process(cAvidaContext&) { |
| 130 | if(m_world->GetConfig().NUM_DEMES.Get() > 1) { |
| 131 | // Using demes; generation might be different. |
| 132 | if(m_world->GetConfig().DEMES_USE_GERMLINE.Get() |
| 133 | && (m_world->GetStats().GetAveGermlineGeneration() > m_tgt_gen)) { |
| 134 | m_world->GetDriver().Finish(); |
| 135 | } |
| 136 | } else { |
| 137 | // No demes; generation is calculated in cStats. |
| 138 | if(m_world->GetStats().GetGeneration() > m_tgt_gen) { |
| 139 | m_world->GetDriver().Finish(); |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | protected: |
| 145 | double m_tgt_gen; //!< Target generation above which Avida should exit. |
nothing calls this directly
no test coverage detected