[Avida-cvs] [Avida2-svn] r81 - trunk/source/python/AvidaGui2
jclune at myxo.css.msu.edu
jclune at myxo.css.msu.edu
Wed Mar 30 09:23:17 PST 2005
Author: jclune
Date: 2005-03-30 12:23:16 -0500 (Wed, 30 Mar 2005)
New Revision: 81
Modified:
trunk/source/python/AvidaGui2/pyAvidaStatsInterface.py
trunk/source/python/AvidaGui2/pyAvidaThreadedDriver.py
trunk/source/python/AvidaGui2/pyEduWorkspaceView.ui
trunk/source/python/AvidaGui2/pyOnePop_GraphView.ui
trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
trunk/source/python/AvidaGui2/pyOnePop_PetriDishView.ui
trunk/source/python/AvidaGui2/pyOnePop_StatsCtrl.py
trunk/source/python/AvidaGui2/pyOnePop_StatsView.ui
trunk/source/python/AvidaGui2/pyPetriDishCtrl.py
Log:
A lot of cosmetic changes to the viewer.
Modified: trunk/source/python/AvidaGui2/pyAvidaStatsInterface.py
===================================================================
--- trunk/source/python/AvidaGui2/pyAvidaStatsInterface.py 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyAvidaStatsInterface.py 2005-03-30 17:23:16 UTC (rev 81)
@@ -9,18 +9,18 @@
('Average Gestation Time', 'average.dat', 3, lambda s: s.GetAveGestation()),
('Average Fitness', 'average.dat', 4, lambda s: s.GetAveFitness()),
('Average Size', 'average.dat', 6, lambda s: s.GetAveSize()),
- ('Average Generation', 'average.dat', 13, lambda s: s.SumGeneration().Average()),
- ('Average Neutral Metric', 'average.dat', 14, lambda s: s.GetAveNeutralMetric()),
- ('Average Lineage Label', 'average.dat', 15, lambda s: s.GetAveLineageLabel()),
- ('Dominant Merit', 'dominant.dat', 2, lambda s: s.GetDomMerit()),
- ('Dominant Gestation Time', 'dominant.dat', 3, lambda s: s.GetDomGestation()),
- ('Dominant Fitness', 'dominant.dat', 4, lambda s: s.GetDomFitness()),
- ('Dominant Size', 'dominant.dat', 6, lambda s: s.GetDomSize()),
+# ('Average Generation', 'average.dat', 13, lambda s: s.SumGeneration().Average()),
+# ('Average Neutral Metric', 'average.dat', 14, lambda s: s.GetAveNeutralMetric()),
+# ('Average Lineage Label', 'average.dat', 15, lambda s: s.GetAveLineageLabel()),
+# ('Dominant Merit', 'dominant.dat', 2, lambda s: s.GetDomMerit()),
+# ('Dominant Gestation Time', 'dominant.dat', 3, lambda s: s.GetDomGestation()),
+# ('Dominant Fitness', 'dominant.dat', 4, lambda s: s.GetDomFitness()),
+# ('Dominant Size', 'dominant.dat', 6, lambda s: s.GetDomSize()),
('Number of Organisms', 'count.dat', 3, lambda s: s.GetNumCreatures()),
- ('Number of Genotypes', 'count.dat', 4, lambda s: s.GetNumGenotypes()),
- ('Number of Threshold Genotypes', 'count.dat', 5, lambda s: s.GetNumThreshold()),
- ('Number of Births', 'count.dat', 9, lambda s: s.GetNumBirths()),
- ('Number of Deaths', 'count.dat', 10, lambda s: s.GetNumDeaths()),
+# ('Number of Genotypes', 'count.dat', 4, lambda s: s.GetNumGenotypes()),
+# ('Number of Threshold Genotypes', 'count.dat', 5, lambda s: s.GetNumThreshold()),
+# ('Number of Births', 'count.dat', 9, lambda s: s.GetNumBirths()),
+# ('Number of Deaths', 'count.dat', 10, lambda s: s.GetNumDeaths()),
)
def getValue(self, entry_index, stats):
if entry_index:
Modified: trunk/source/python/AvidaGui2/pyAvidaThreadedDriver.py
===================================================================
--- trunk/source/python/AvidaGui2/pyAvidaThreadedDriver.py 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyAvidaThreadedDriver.py 2005-03-30 17:23:16 UTC (rev 81)
@@ -31,9 +31,9 @@
pass
def __del__(self):
- print("pyAvidaThreadedDriver.__del__()...")
+# print("pyAvidaThreadedDriver.__del__()...")
self.doExit()
- print("pyAvidaThreadedDriver.__del__() done.")
+# print("pyAvidaThreadedDriver.__del__() done.")
def ___threadloop___(self):
while True:
@@ -56,17 +56,17 @@
return
def doExit(self):
- print("pyAvidaThreadedDriver.doExit()...")
+# print("pyAvidaThreadedDriver.doExit()...")
self.m_lock.acquire()
self.setDoneFlag()
self.m_lock.release()
self.doUpdate()
- print("pyAvidaThreadedDriver.doExit() done.")
+# print("pyAvidaThreadedDriver.doExit() done.")
def doUpdate(self):
- print("pyAvidaThreadedDriver.doUpdate()...")
+# print("pyAvidaThreadedDriver.doUpdate()...")
self.m_do_update_semaphore.release()
- print("pyAvidaThreadedDriver.doUpdate() done.")
+# print("pyAvidaThreadedDriver.doUpdate() done.")
def doSetProcessBitesize(self, bitesize):
self.m_lock.acquire()
Modified: trunk/source/python/AvidaGui2/pyEduWorkspaceView.ui
===================================================================
--- trunk/source/python/AvidaGui2/pyEduWorkspaceView.ui 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyEduWorkspaceView.ui 2005-03-30 17:23:16 UTC (rev 81)
@@ -42,7 +42,7 @@
</size>
</property>
<property name="caption">
- <string>pyEduWorkspaceView</string>
+ <string>Avida-ED</string>
</property>
<vbox>
<property name="name">
Modified: trunk/source/python/AvidaGui2/pyOnePop_GraphView.ui
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_GraphView.ui 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyOnePop_GraphView.ui 2005-03-30 17:23:16 UTC (rev 81)
@@ -67,7 +67,7 @@
</font>
</property>
<property name="text">
- <string>Graph</string>
+ <string></string>
</property>
</widget>
<widget class="QLayoutWidget">
Modified: trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py 2005-03-30 17:23:16 UTC (rev 81)
@@ -13,6 +13,7 @@
def construct(self, session_mdl):
self.m_session_mdl = session_mdl
+ self.m_avida = None
self.m_petri_dish_ctrl.construct(self.m_session_mdl)
self.m_gradient_scale_ctrl.construct(self.m_session_mdl)
self.m_live_controls_ctrl.construct(self.m_session_mdl)
@@ -21,7 +22,24 @@
self.m_petri_dish_ctrl.extractPopulationSlot)
self.connect(self.m_petri_dish_ctrl, PYSIGNAL("freezeDishPhaseIISig"),
self.m_petri_configure_ctrl.FreezePetriSlot)
+ self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("setAvidaSig"),
+ self.setAvidaSlot)
+ def setAvidaSlot(self, avida):
+ old_avida = self.m_avida
+ self.m_avida = avida
+ if(old_avida):
+ self.disconnect(
+ self.m_avida.m_avida_thread_mdtr, PYSIGNAL("AvidaUpdatedSig"),
+ self.avidaUpdatedSlot)
+ del old_avida
+ if(self.m_avida):
+ self.connect(
+ self.m_avida.m_avida_thread_mdtr, PYSIGNAL("AvidaUpdatedSig"),
+ self.avidaUpdatedSlot)
+
+
+
def ToogleDish (self):
current_page = self.m_petri_dish_widget_stack.visibleWidget()
current_page_int = self.m_petri_dish_widget_stack.id(current_page)
@@ -29,3 +47,9 @@
self.m_petri_dish_widget_stack.raiseWidget(1)
else:
self.m_petri_dish_widget_stack.raiseWidget(0)
+
+ def avidaUpdatedSlot (self):
+ stats = self.m_avida.m_population.GetStats()
+ update = stats.GetUpdate()
+ self.m_update_label.setText(QString("%1").arg(update))
+
Modified: trunk/source/python/AvidaGui2/pyOnePop_PetriDishView.ui
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_PetriDishView.ui 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyOnePop_PetriDishView.ui 2005-03-30 17:23:16 UTC (rev 81)
@@ -253,7 +253,7 @@
</sizepolicy>
</property>
<property name="text">
- <string><font size="-1">10000</font></string>
+ <string><font size="-1">-</font></string>
</property>
</widget>
<widget class="QComboBox">
Modified: trunk/source/python/AvidaGui2/pyOnePop_StatsCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_StatsCtrl.py 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyOnePop_StatsCtrl.py 2005-03-30 17:23:16 UTC (rev 81)
@@ -145,7 +145,7 @@
# self.m_org_name.setText(('-'))
-# m_cur_task_count = phenotype.GetCurTaskCount().GetSize()
+# m_cur_task_count = phenotype.GetCurTaskCount()
# print "m_cur_task_count is "
# print m_cur_task_count(1)
Modified: trunk/source/python/AvidaGui2/pyOnePop_StatsView.ui
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_StatsView.ui 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyOnePop_StatsView.ui 2005-03-30 17:23:16 UTC (rev 81)
@@ -53,7 +53,7 @@
</font>
</property>
<property name="title">
- <string>Task Outlook</string>
+ <string>Population Task Report</string>
</property>
<vbox>
<property name="name">
@@ -777,7 +777,7 @@
</font>
</property>
<property name="text">
- <string>abcdef</string>
+ <string>-</string>
</property>
</widget>
</hbox>
Modified: trunk/source/python/AvidaGui2/pyPetriDishCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyPetriDishCtrl.py 2005-03-28 20:30:48 UTC (rev 80)
+++ trunk/source/python/AvidaGui2/pyPetriDishCtrl.py 2005-03-30 17:23:16 UTC (rev 81)
@@ -36,8 +36,8 @@
self.m_avida.m_avida_thread_mdtr, PYSIGNAL("AvidaUpdatedSig"),
self.avidaUpdatedSlot)
- self.m_map_cell_w = 2
- self.m_map_cell_h = 2
+ self.m_map_cell_w = 5
+ self.m_map_cell_h = 5
world_w = cConfig.GetWorldX()
world_h = cConfig.GetWorldY()
@@ -68,15 +68,16 @@
if self.m_avida == None:
return
- a = e.x()
- b = e.y()
-
world_w = cConfig.GetWorldX()
world_h = cConfig.GetWorldY()
- clicked_map_cell_w = round(float(e.x())/2.0)
- clicked_map_cell_h = round(float(e.y())/2.0)
+ clicked_map_cell_w = round(float(e.x()-3)/self.m_map_cell_w)
+ clicked_map_cell_h = round(float(e.y()-3)/self.m_map_cell_h)
+ print "clicked_map_cell_w is %f, clicked_map_cell_h is %f" %(clicked_map_cell_w,clicked_map_cell_h)
+
+
+
#if the user clicks outside the area that has organisms, do nothing
if (clicked_map_cell_w > world_w) or (clicked_map_cell_h > world_h):
return
@@ -152,7 +153,7 @@
return state
def avidaUpdatedSlot(self):
- print "pyPetriDishCtrl.avidaUpdatedSlot() : called."
+# print "pyPetriDishCtrl.avidaUpdatedSlot() : called."
self.calcColorScale()
world_w = cConfig.GetWorldX()
world_h = cConfig.GetWorldY()
More information about the Avida-cvs
mailing list