[Avida-SVN] r2111 - branches/developers/avida-edward/source/python/AvidaGui2
baerb at myxo.css.msu.edu
baerb at myxo.css.msu.edu
Wed Sep 26 09:34:27 PDT 2007
Author: baerb
Date: 2007-09-26 12:34:27 -0400 (Wed, 26 Sep 2007)
New Revision: 2111
Modified:
branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_StatsCtrl.py
Log:
Fixed org fittnes to show correctly on windows computer
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_StatsCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_StatsCtrl.py 2007-09-25 20:07:28 UTC (rev 2110)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_StatsCtrl.py 2007-09-26 16:34:27 UTC (rev 2111)
@@ -300,8 +300,17 @@
m_org_name = m_org_name[hyphen_position+1:]
self.m_org_name.setText(str(m_org_name))
- m_org_fitness = phenotype.GetFitness()
- self.m_org_fitness.setText(QString("%1").arg(m_org_fitness))
+ string_output_length = 6
+ if phenotype.GetFitness()<10000 :
+ org_fitness = str(phenotype.GetFitness())
+ string_length = len(org_fitness)
+ while string_length < string_output_length:
+ org_fitness = org_fitness + '0'
+ string_length = string_length+1
+ self.m_org_fitness.setText(org_fitness[0:string_output_length])
+ else:
+ org_fitness = "%.2g" %(stats.GetAveFitness())
+ self.m_org_fitness.setText(org_fitness)
m_org_merit = phenotype.GetMerit().GetDouble()
self.m_org_merit.setText(str(m_org_merit))
More information about the Avida-cvs
mailing list