From c581ffc389af4c82c1f709cc372e158dc20e398f Mon Sep 17 00:00:00 2001
From: Vincent Liard <vincent.liard@inria.fr>
Date: Mon, 26 Jan 2015 14:23:37 +0100
Subject: [PATCH] fix overoptimization genome < promoter + terminator

The code used to be optimized to bypass phenotype computation when the
genome was smaller than the length of a promoter plus the length of a
terminator. But terminators can overlap promoters when they share a
chunk of DNA. Viruses showed that this actually happens. The condition
has thus been relaxed to bypasse genomes that are smaller than a
promoter.
---
 src/libaevol/ae_genetic_unit.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libaevol/ae_genetic_unit.cpp b/src/libaevol/ae_genetic_unit.cpp
index 5340b5717..09d16ee87 100644
--- a/src/libaevol/ae_genetic_unit.cpp
+++ b/src/libaevol/ae_genetic_unit.cpp
@@ -526,7 +526,9 @@ void ae_genetic_unit::do_transcription( void )
 
   // If the genome is not long enough to bear a promoter and a terminator,
   // we set all its RNAs to a length of -1
-  if ( genome_length < PROM_SIZE + TERM_SIZE )
+  // (NB but a terminator can share code with the promoter, making it
+  // possible for the genome to be no longer than the promoter)
+  if ( genome_length < PROM_SIZE )
   {
     rna_node = _rna_list[LEADING]->get_first();
     while ( rna_node != NULL )
-- 
GitLab