[Avida-SVN] r1069 - branches/developers/avida-edward/source/python/AvidaGui2

avidaedward at myxo.css.msu.edu avidaedward at myxo.css.msu.edu
Thu Nov 2 10:54:41 PST 2006


Author: avidaedward
Date: 2006-11-02 13:54:41 -0500 (Thu, 02 Nov 2006)
New Revision: 1069

Modified:
   branches/developers/avida-edward/source/python/AvidaGui2/pyOneOrganismCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismConfigureCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismConfigureView.ui
   branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismScopeCtrl.py
Log:
Added "repeatable" versus "experimental" mode of organism viewer
mutations.


Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOneOrganismCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOneOrganismCtrl.py	2006-11-01 22:10:09 UTC (rev 1068)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOneOrganismCtrl.py	2006-11-02 18:54:41 UTC (rev 1069)
@@ -21,6 +21,8 @@
     self.connect(self.m_organism_scope_toggle, SIGNAL("clicked()"),
       self.ToggleScopeSlot)
 
+    self.m_organism_configure_ctrl.SetRandomGeneratedRadioButton(True);
+
   def aboutToBeLowered(self):
     """does nothing yet."""
     descr()

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismConfigureCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismConfigureCtrl.py	2006-11-01 22:10:09 UTC (rev 1068)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismConfigureCtrl.py	2006-11-02 18:54:41 UTC (rev 1069)
@@ -1,8 +1,7 @@
 
 from pyOrganismConfigureView import pyOrganismConfigureView
-
+from descr import *
 from qt import *
-
 import math
 
 class pyOrganismConfigureCtrl(pyOrganismConfigureView):
@@ -17,6 +16,9 @@
     self.connect(self.m_mutation_rate_lineedit, SIGNAL("returnPressed()"), 
       self.ChangeMutationSliderSlot)
 
+    self.connect(self.RandomGeneratedRadioButton, SIGNAL("toggled(bool)"), 
+      self.ChangeRandomGeneratedRadioButtonSlot)
+
     #self.connect(self.m_mutation_slider, SIGNAL("valueChanged(int)"), self.m_session_mdl.m_session_mdtr,
     #  PYSIGNAL("ScopeConfig_MutationSliderValueChangedSig"))
 
@@ -115,3 +117,8 @@
 
     self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("ScopeConfig_MutationSliderValueChangedSig"),(mutValue,))
   
+  def SetRandomGeneratedRadioButton(self, is_down):
+    self.RandomGeneratedRadioButton.setDown(is_down);
+
+  def ChangeRandomGeneratedRadioButtonSlot(self, value):
+    self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("ScopeConfig_RandomSeedSig"),(value,))

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismConfigureView.ui
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismConfigureView.ui	2006-11-01 22:10:09 UTC (rev 1068)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismConfigureView.ui	2006-11-02 18:54:41 UTC (rev 1069)
@@ -9,7 +9,7 @@
             <x>0</x>
             <y>0</y>
             <width>492</width>
-            <height>487</height>
+            <height>465</height>
         </rect>
     </property>
     <property name="caption">
@@ -19,12 +19,6 @@
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
-        <property name="margin">
-            <number>2</number>
-        </property>
-        <property name="spacing">
-            <number>2</number>
-        </property>
         <widget class="QLabel">
             <property name="name">
                 <cstring>textLabel1</cstring>
@@ -39,7 +33,7 @@
             </property>
             <property name="font">
                 <font>
-                    <pointsize>14</pointsize>
+                    <family>Arial</family>
                     <bold>1</bold>
                 </font>
             </property>
@@ -67,7 +61,9 @@
                     </property>
                     <property name="font">
                         <font>
+                            <family>Arial</family>
                             <pointsize>9</pointsize>
+                            <bold>1</bold>
                         </font>
                     </property>
                     <property name="text">
@@ -160,6 +156,12 @@
                                     <height>32767</height>
                                 </size>
                             </property>
+                            <property name="font">
+                                <font>
+                                    <family>Arial</family>
+                                    <pointsize>9</pointsize>
+                                </font>
+                            </property>
                             <property name="text">
                                 <string>%</string>
                             </property>
@@ -174,6 +176,101 @@
                 </widget>
             </vbox>
         </widget>
+        <widget class="QButtonGroup">
+            <property name="name">
+                <cstring>buttonGroup2</cstring>
+            </property>
+            <property name="title">
+                <string></string>
+            </property>
+            <hbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>RandomHeadTextLabel</cstring>
+                    </property>
+                    <property name="enabled">
+                        <bool>true</bool>
+                    </property>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                            <pointsize>9</pointsize>
+                        </font>
+                    </property>
+                    <property name="text">
+                        <string>Repeatablity Mode:</string>
+                    </property>
+                    <property name="alignment">
+                        <set>AlignCenter</set>
+                    </property>
+                </widget>
+                <spacer>
+                    <property name="name">
+                        <cstring>spacer16_2</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>132</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget class="QRadioButton">
+                    <property name="name">
+                        <cstring>RandomGeneratedRadioButton</cstring>
+                    </property>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                            <pointsize>9</pointsize>
+                        </font>
+                    </property>
+                    <property name="focusPolicy">
+                        <enum>TabFocus</enum>
+                    </property>
+                    <property name="text">
+                        <string>Experimental
+(natural variation)</string>
+                    </property>
+                    <property name="checked">
+                        <bool>true</bool>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string>&lt;p&gt;Each time this petri dish is run the mutations will be different&lt;/p&gt;</string>
+                    </property>
+                </widget>
+                <widget class="QRadioButton">
+                    <property name="name">
+                        <cstring>RandomFixedRadioButton</cstring>
+                    </property>
+                    <property name="font">
+                        <font>
+                            <family>Arial</family>
+                            <pointsize>9</pointsize>
+                        </font>
+                    </property>
+                    <property name="focusPolicy">
+                        <enum>NoFocus</enum>
+                    </property>
+                    <property name="text">
+                        <string>Demo
+(forces exact replay)</string>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string>&lt;p&gt;Each time this petri dish is run the mutations will be exactly the same&lt;/p&gt;</string>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
         <spacer>
             <property name="name">
                 <cstring>spacer53</cstring>
@@ -187,7 +284,7 @@
             <property name="sizeHint">
                 <size>
                     <width>410</width>
-                    <height>50</height>
+                    <height>110</height>
                 </size>
             </property>
         </spacer>

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismScopeCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismScopeCtrl.py	2006-11-01 22:10:09 UTC (rev 1068)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOrganismScopeCtrl.py	2006-11-02 18:54:41 UTC (rev 1069)
@@ -24,6 +24,7 @@
     if not name: self.setName("pyOrganismScopeCtrl")
 
     self.m_test_cpu_mutation_rate = 0.0
+    self.m_seed_based_on_time = True
 
   def construct(self, session_mdl):
     print "pyOrganismScopeCtrl.construct()."
@@ -37,6 +38,9 @@
     self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("ScopeConfig_MutationSliderValueChangedSig"),
       self.MutationSliderValueChangedSlot)
 
+    self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("ScopeConfig_RandomSeedSig"),
+      self.RandomSeedSlot)
+
     #self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("ScopeConfig_HeadsTypeCBActivatedSig"),
     #  self.HeadsTypeCBActivatedSlot)
 
@@ -161,6 +165,11 @@
 
       # Save random number generator state.
       random_number_generator_state = cRandom(cTools.globalRandom())
+      # Reset random number generator state.
+      if self.m_seed_based_on_time:
+        cTools.globalRandom().ResetSeed(-1)
+      else:
+        cTools.globalRandom().ResetSeed(1)
 
       # Tell user we're about to start organism analysis.
       self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("setOneOrganismViewNameLabelTextSig"), (organism_filename,))
@@ -225,6 +234,10 @@
     self.m_test_cpu_mutation_rate = value / 100.
     descr("self.m_test_cpu_mutation_rate", self.m_test_cpu_mutation_rate)
 
+  def RandomSeedSlot(self, value):
+    self.m_seed_based_on_time = value
+    descr("self.m_seed_based_on_time", self.m_seed_based_on_time)
+
   #def HeadsTypeCBActivatedSlot(self, index):
   #  self.anim.setDisplayHeadsAs(index)
 




More information about the Avida-cvs mailing list