[Avida-cvs] [Avida2-svn] r103 - trunk/source/python/AvidaGui2
jclune at myxo.css.msu.edu
jclune at myxo.css.msu.edu
Tue Apr 5 12:43:25 PDT 2005
Author: jclune
Date: 2005-04-05 15:43:25 -0400 (Tue, 05 Apr 2005)
New Revision: 103
Modified:
trunk/source/python/AvidaGui2/pyFreezerView.py
trunk/source/python/AvidaGui2/pyNavBarView.py
trunk/source/python/AvidaGui2/pyOnePop_StatsCtrl.py
trunk/source/python/AvidaGui2/pyOnePop_StatsView.py
trunk/source/python/AvidaGui2/pyOnePop_StatsView.ui
Log:
The GUI no longer shifts around based on statistical information...and some other cosmetic changes.
Modified: trunk/source/python/AvidaGui2/pyFreezerView.py
===================================================================
--- trunk/source/python/AvidaGui2/pyFreezerView.py 2005-04-05 19:39:00 UTC (rev 102)
+++ trunk/source/python/AvidaGui2/pyFreezerView.py 2005-04-05 19:43:25 UTC (rev 103)
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file 'pyFreezerView.ui'
+# Form implementation generated from reading ui file './pyFreezerView.ui'
#
-# Created: Thu Mar 31 04:19:19 2005
+# Created: Mon Apr 4 12:34:57 2005
# by: The PyQt User Interface Compiler (pyuic) 3.13
#
# WARNING! All changes made in this file will be lost!
@@ -467,6 +467,9 @@
self.m_list_view.header().setClickEnabled(0,self.m_list_view.header().count() - 1)
self.m_list_view.header().setResizeEnabled(0,self.m_list_view.header().count() - 1)
self.m_list_view.setSizePolicy(QSizePolicy(5,5,0,0,self.m_list_view.sizePolicy().hasHeightForWidth()))
+ m_list_view_font = QFont(self.m_list_view.font())
+ m_list_view_font.setPointSize(9)
+ self.m_list_view.setFont(m_list_view_font)
self.m_list_view.setAcceptDrops(1)
self.m_list_view.setFrameShape(QListView.StyledPanel)
self.m_list_view.setFrameShadow(QListView.Sunken)
Modified: trunk/source/python/AvidaGui2/pyNavBarView.py
===================================================================
--- trunk/source/python/AvidaGui2/pyNavBarView.py 2005-04-05 19:39:00 UTC (rev 102)
+++ trunk/source/python/AvidaGui2/pyNavBarView.py 2005-04-05 19:43:25 UTC (rev 103)
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file 'pyNavBarView.ui'
+# Form implementation generated from reading ui file './pyNavBarView.ui'
#
-# Created: Thu Mar 31 04:19:20 2005
+# Created: Mon Apr 4 12:34:58 2005
# by: The PyQt User Interface Compiler (pyuic) 3.13
#
# WARNING! All changes made in this file will be lost!
@@ -443,6 +443,9 @@
self.m_list_view.header().setClickEnabled(0,self.m_list_view.header().count() - 1)
self.m_list_view.header().setResizeEnabled(0,self.m_list_view.header().count() - 1)
self.m_list_view.setSizePolicy(QSizePolicy(5,5,0,0,self.m_list_view.sizePolicy().hasHeightForWidth()))
+ m_list_view_font = QFont(self.m_list_view.font())
+ m_list_view_font.setPointSize(9)
+ self.m_list_view.setFont(m_list_view_font)
self.m_list_view.setAcceptDrops(1)
self.m_list_view.setFrameShape(QListView.StyledPanel)
self.m_list_view.setFrameShadow(QListView.Sunken)
Modified: trunk/source/python/AvidaGui2/pyOnePop_StatsCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_StatsCtrl.py 2005-04-05 19:39:00 UTC (rev 102)
+++ trunk/source/python/AvidaGui2/pyOnePop_StatsCtrl.py 2005-04-05 19:43:25 UTC (rev 103)
@@ -37,76 +37,105 @@
stats = self.m_avida.m_population.GetStats()
#STATISTICS WINDOW
- avg_fitness = stats.GetAveFitness()
- self.m_avg_fitness.setText(QString("%1").arg(avg_fitness))
+ string_output_length = 7
- dom_fitness = stats.GetDomFitness()
- self.m_dom_fitness.setText(QString("%1").arg(dom_fitness))
+ if stats.GetAveFitness()<100000 :
+ avg_fitness = str(stats.GetAveFitness())
+ string_length = len(avg_fitness)
+ while string_length < string_output_length:
+ avg_fitness = avg_fitness + '0'
+ string_length = string_length+1
+ self.m_avg_fitness.setText(avg_fitness[0:string_output_length])
+ else:
+ avg_fitness = "%.2g" %(stats.GetAveFitness())
+ self.m_avg_fitness.setText(avg_fitness)
+
+ dom_fitness = str(stats.GetDomFitness())
+# string_length = len(dom_fitness)
+# while string_length < string_output_length:
+# dom_fitness = dom_fitness + '0'
+# string_length = string_length+1
+ self.m_dom_fitness.setText(dom_fitness[0:string_output_length])
+
num_orgs = stats.GetNumCreatures()
self.m_num_orgs.setText(QString("%1").arg(num_orgs))
- avg_gest = stats.GetAveGestation()
+ avg_gest = "%d" %(stats.GetAveGestation())
+# string_length = len(avg_gest)
+# while string_length < string_output_length:
+# avg_gest = avg_gest + '0'
+# string_length = string_length+1
self.m_avg_gest.setText(QString("%1").arg(avg_gest))
+
#TASK OUTLOOK
#if num_orgs_doing_a_given_task is above this number, we say the pop is doing this task
m_org_threshold = 1
- num_not = stats.GetTaskLastCount(0)
- if num_not > m_org_threshold:
- self.m_num_not.setText(QString("yes"))
- else:
- self.m_num_not.setText(QString("no"))
+ num_not = str(stats.GetTaskLastCount(0))
+# if num_not > m_org_threshold:
+# self.m_num_not.setText(QString("yes"))
+# else:
+# self.m_num_not.setText(QString("no"))
+ self.m_num_not.setText(num_not)
+
+ num_nand = str(stats.GetTaskLastCount(1))
+# if num_nand > m_org_threshold:
+# self.m_num_nand.setText(QString("yes"))
+# else:
+# self.m_num_nand.setText(QString("no"))
+ self.m_num_nand.setText(num_nand)
- num_nand = stats.GetTaskLastCount(1)
- if num_nand > m_org_threshold:
- self.m_num_nand.setText(QString("yes"))
- else:
- self.m_num_nand.setText(QString("no"))
+ num_and = str(stats.GetTaskLastCount(2))
+# if num_and > m_org_threshold:
+# self.m_num_and.setText(QString("yes"))
+# else:
+# self.m_num_and.setText(QString("no"))
+ self.m_num_and.setText(num_and)
- num_and = stats.GetTaskLastCount(2)
- if num_and > m_org_threshold:
- self.m_num_and.setText(QString("yes"))
- else:
- self.m_num_and.setText(QString("no"))
+ num_ornot = str(stats.GetTaskLastCount(3))
+# if num_ornot > m_org_threshold:
+# self.m_num_ornot.setText(QString("yes"))
+# else:
+# self.m_num_ornot.setText(QString("no"))
+ self.m_num_ornot.setText(num_ornot)
- num_ornot = stats.GetTaskLastCount(3)
- if num_ornot > m_org_threshold:
- self.m_num_ornot.setText(QString("yes"))
- else:
- self.m_num_ornot.setText(QString("no"))
+ num_or = str(stats.GetTaskLastCount(4))
+# if num_or > m_org_threshold:
+# self.m_num_or.setText(QString("yes"))
+# else:
+# self.m_num_or.setText(QString("no"))
+ self.m_num_or.setText(num_or)
- num_or = stats.GetTaskLastCount(4)
- if num_or > m_org_threshold:
- self.m_num_or.setText(QString("yes"))
- else:
- self.m_num_or.setText(QString("no"))
+ num_andnot = str(stats.GetTaskLastCount(5))
+# if num_andnot > m_org_threshold:
+# self.m_num_andnot.setText(QString("yes"))
+# else:
+# self.m_num_andnot.setText(QString("no"))
+ self.m_num_andnot.setText(num_andnot)
- num_andnot = stats.GetTaskLastCount(5)
- if num_andnot > m_org_threshold:
- self.m_num_andnot.setText(QString("yes"))
- else:
- self.m_num_andnot.setText(QString("no"))
+ num_nor = str(stats.GetTaskLastCount(6))
+# if num_nor > m_org_threshold:
+# self.m_num_nor.setText(QString("yes"))
+# else:
+# self.m_num_nor.setText(QString("no"))
+ self.m_num_nor.setText(num_nor)
- num_nor = stats.GetTaskLastCount(6)
- if num_nor > m_org_threshold:
- self.m_num_nor.setText(QString("yes"))
- else:
- self.m_num_nor.setText(QString("no"))
+ num_xor = str(stats.GetTaskLastCount(7))
+# if num_xor > m_org_threshold:
+# self.m_num_xor.setText(QString("yes"))
+# else:
+# self.m_num_xor.setText(QString("no"))
+ self.m_num_xor.setText(num_xor)
- num_xor = stats.GetTaskLastCount(7)
- if num_xor > m_org_threshold:
- self.m_num_xor.setText(QString("yes"))
- else:
- self.m_num_xor.setText(QString("no"))
-
- num_equals = stats.GetTaskLastCount(8)
- if num_equals > m_org_threshold:
- self.m_num_equals.setText(QString("yes"))
- else:
- self.m_num_equals.setText(QString("no"))
+ num_equals = str(stats.GetTaskLastCount(8))
+# if num_equals > m_org_threshold:
+# self.m_num_equals.setText(QString("yes"))
+# else:
+# self.m_num_equals.setText(QString("no"))
+ self.m_num_equals.setText(num_equals)
if self.clickedCellNumber>= 0:
self.updateOrgReportSlot(self.clickedCellNumber)
Modified: trunk/source/python/AvidaGui2/pyOnePop_StatsView.py
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_StatsView.py 2005-04-05 19:39:00 UTC (rev 102)
+++ trunk/source/python/AvidaGui2/pyOnePop_StatsView.py 2005-04-05 19:43:25 UTC (rev 103)
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file 'pyOnePop_StatsView.ui'
+# Form implementation generated from reading ui file './pyOnePop_StatsView.ui'
#
-# Created: Fri Apr 1 00:24:13 2005
+# Created: Tue Apr 5 15:43:51 2005
# by: The PyQt User Interface Compiler (pyuic) 3.13
#
# WARNING! All changes made in this file will be lost!
@@ -205,10 +205,13 @@
groupBox5Layout.addWidget(self.m_dom_fitness,1,1)
self.m_avg_fitness = QLabel(self.groupBox5,"m_avg_fitness")
- self.m_avg_fitness.setSizePolicy(QSizePolicy(5,5,0,0,self.m_avg_fitness.sizePolicy().hasHeightForWidth()))
+ self.m_avg_fitness.setSizePolicy(QSizePolicy(0,0,0,0,self.m_avg_fitness.sizePolicy().hasHeightForWidth()))
+ self.m_avg_fitness.setMinimumSize(QSize(45,10))
+ self.m_avg_fitness.setMaximumSize(QSize(45,5))
m_avg_fitness_font = QFont(self.m_avg_fitness.font())
m_avg_fitness_font.setPointSize(10)
self.m_avg_fitness.setFont(m_avg_fitness_font)
+ self.m_avg_fitness.setLineWidth(7)
groupBox5Layout.addWidget(self.m_avg_fitness,0,1)
@@ -280,7 +283,9 @@
layout80 = QGridLayout(None,1,1,0,6,"layout80")
self.m_org_name = QLabel(self.groupBox4,"m_org_name")
- self.m_org_name.setSizePolicy(QSizePolicy(5,5,0,0,self.m_org_name.sizePolicy().hasHeightForWidth()))
+ self.m_org_name.setSizePolicy(QSizePolicy(0,0,0,0,self.m_org_name.sizePolicy().hasHeightForWidth()))
+ self.m_org_name.setMinimumSize(QSize(70,15))
+ self.m_org_name.setMaximumSize(QSize(70,15))
m_org_name_font = QFont(self.m_org_name.font())
m_org_name_font.setPointSize(10)
self.m_org_name.setFont(m_org_name_font)
@@ -305,14 +310,6 @@
layout80.addWidget(self.textLabel14_3_3_3,0,0)
- self.textLabel14_3_3_3_3_2 = QLabel(self.groupBox4,"textLabel14_3_3_3_3_2")
- self.textLabel14_3_3_3_3_2.setSizePolicy(QSizePolicy(5,5,0,0,self.textLabel14_3_3_3_3_2.sizePolicy().hasHeightForWidth()))
- textLabel14_3_3_3_3_2_font = QFont(self.textLabel14_3_3_3_3_2.font())
- textLabel14_3_3_3_3_2_font.setPointSize(10)
- self.textLabel14_3_3_3_3_2.setFont(textLabel14_3_3_3_3_2_font)
-
- layout80.addWidget(self.textLabel14_3_3_3_3_2,4,1)
-
self.m_org_age = QLabel(self.groupBox4,"m_org_age")
m_org_age_font = QFont(self.m_org_age.font())
m_org_age_font.setPointSize(10)
@@ -328,15 +325,6 @@
layout80.addWidget(self.m_org_fitness,1,1)
- self.textLabel14_3_3_2_3 = QLabel(self.groupBox4,"textLabel14_3_3_2_3")
- self.textLabel14_3_3_2_3.setSizePolicy(QSizePolicy(5,5,0,0,self.textLabel14_3_3_2_3.sizePolicy().hasHeightForWidth()))
- self.textLabel14_3_3_2_3.setMaximumSize(QSize(32767,40))
- textLabel14_3_3_2_3_font = QFont(self.textLabel14_3_3_2_3.font())
- textLabel14_3_3_2_3_font.setPointSize(10)
- self.textLabel14_3_3_2_3.setFont(textLabel14_3_3_2_3_font)
-
- layout80.addWidget(self.textLabel14_3_3_2_3,4,0)
-
self.textLabel1 = QLabel(self.groupBox4,"textLabel1")
textLabel1_font = QFont(self.textLabel1.font())
textLabel1_font.setPointSize(10)
@@ -375,7 +363,7 @@
self.setCaption(self.__tr("pyOnePop_StatsView"))
self.groupBox3.setTitle(self.__tr("Population Task Report"))
self.textLabel14.setText(self.__tr("Task"))
- self.textLabel14_2.setText(self.__tr("being done?"))
+ self.textLabel14_2.setText(self.__tr("orgs performing"))
self.textLabel14_3.setText(self.__tr("not"))
self.m_num_not.setText(self.__tr("-"))
self.textLabel4.setText(self.__tr("nand"))
@@ -394,23 +382,21 @@
self.m_num_xor.setText(self.__tr("-"))
self.textLabel18.setText(self.__tr("equals"))
self.m_num_equals.setText(self.__tr("-"))
- self.groupBox5.setTitle(self.__tr("Statistics"))
- self.m_dom_fitness.setText(self.__tr("0000"))
- self.m_avg_fitness.setText(self.__tr("0000"))
+ self.groupBox5.setTitle(self.__tr("Population Statistics"))
+ self.m_dom_fitness.setText(self.__tr("-"))
+ self.m_avg_fitness.setText(self.__tr("-"))
self.textLabel14_3_3_2.setText(self.__tr("Dominant Org. Fitness:"))
- self.m_num_orgs.setText(self.__tr("0000"))
+ self.m_num_orgs.setText(self.__tr("-"))
self.textLabel14_3_3.setText(self.__tr("Avg. Fitness:"))
self.textLabel14_3_3_2_2_2.setText(self.__tr("Avg. Gestation (instructions):"))
- self.m_avg_gest.setText(self.__tr("0000"))
+ self.m_avg_gest.setText(self.__tr("-"))
self.textLabel14_3_3_2_2.setText(self.__tr("Population Size:"))
self.groupBox4.setTitle(self.__tr("Org. Clicked on Report"))
self.m_org_name.setText(self.__tr("-"))
self.textLabel14_3_3_2_2_2_2.setText(self.__tr("Gestation (instructions):"))
self.textLabel14_3_3_3.setText(self.__tr("Name:"))
- self.textLabel14_3_3_3_3_2.setText(self.__tr("-"))
self.m_org_age.setText(self.__tr("-"))
self.m_org_fitness.setText(self.__tr("-"))
- self.textLabel14_3_3_2_3.setText(self.__tr("Tasks:"))
self.textLabel1.setText(self.__tr("Age (updates):"))
self.textLabel14_3_3_2_2_3.setText(self.__tr("Fitness:"))
self.m_org_gestation_time.setText(self.__tr("-"))
Modified: trunk/source/python/AvidaGui2/pyOnePop_StatsView.ui
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_StatsView.ui 2005-04-05 19:39:00 UTC (rev 102)
+++ trunk/source/python/AvidaGui2/pyOnePop_StatsView.ui 2005-04-05 19:43:25 UTC (rev 103)
@@ -100,7 +100,7 @@
</font>
</property>
<property name="text">
- <string>being done?</string>
+ <string>orgs performing</string>
</property>
</widget>
</hbox>
@@ -490,7 +490,7 @@
</font>
</property>
<property name="title">
- <string>Statistics</string>
+ <string>Population Statistics</string>
</property>
<grid>
<property name="name">
@@ -514,7 +514,7 @@
</font>
</property>
<property name="text">
- <string>0000</string>
+ <string>-</string>
</property>
</widget>
<widget class="QLabel" row="0" column="1">
@@ -523,19 +523,34 @@
</property>
<property name="sizePolicy">
<sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>45</width>
+ <height>10</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>45</width>
+ <height>5</height>
+ </size>
+ </property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
+ <property name="lineWidth">
+ <number>7</number>
+ </property>
<property name="text">
- <string>0000</string>
+ <string>-</string>
</property>
</widget>
<widget class="QLabel" row="1" column="0">
@@ -583,7 +598,7 @@
</font>
</property>
<property name="text">
- <string>0000</string>
+ <string>-</string>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
@@ -658,7 +673,7 @@
</font>
</property>
<property name="text">
- <string>0000</string>
+ <string>-</string>
</property>
</widget>
<widget class="QLabel" row="2" column="0">
@@ -730,12 +745,24 @@
</property>
<property name="sizePolicy">
<sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>70</width>
+ <height>15</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>70</width>
+ <height>15</height>
+ </size>
+ </property>
<property name="font">
<font>
<pointsize>10</pointsize>
@@ -799,27 +826,6 @@
<string>Name:</string>
</property>
</widget>
- <widget class="QLabel" row="4" column="1">
- <property name="name">
- <cstring>textLabel14_3_3_3_3_2</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="font">
- <font>
- <pointsize>10</pointsize>
- </font>
- </property>
- <property name="text">
- <string>-</string>
- </property>
- </widget>
<widget class="QLabel" row="3" column="1">
<property name="name">
<cstring>m_org_age</cstring>
@@ -854,33 +860,6 @@
<string>-</string>
</property>
</widget>
- <widget class="QLabel" row="4" column="0">
- <property name="name">
- <cstring>textLabel14_3_3_2_3</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>32767</width>
- <height>40</height>
- </size>
- </property>
- <property name="font">
- <font>
- <pointsize>10</pointsize>
- </font>
- </property>
- <property name="text">
- <string>Tasks:</string>
- </property>
- </widget>
<widget class="QLabel" row="3" column="0">
<property name="name">
<cstring>textLabel1</cstring>
More information about the Avida-cvs
mailing list