[Avida-cvs] [Avida2-svn] r94 - branches/developers/kaben/source/python/AvidaGui2

kaben at myxo.css.msu.edu kaben at myxo.css.msu.edu
Wed Mar 30 11:51:28 PST 2005


Author: kaben
Date: 2005-03-30 14:51:28 -0500 (Wed, 30 Mar 2005)
New Revision: 94

Modified:
   branches/developers/kaben/source/python/AvidaGui2/pyPetriDishCtrl.py
Log:

* Map updates work again in experiment to move some gui work to the
  processing thread.



Modified: branches/developers/kaben/source/python/AvidaGui2/pyPetriDishCtrl.py
===================================================================
--- branches/developers/kaben/source/python/AvidaGui2/pyPetriDishCtrl.py	2005-03-30 19:45:57 UTC (rev 93)
+++ branches/developers/kaben/source/python/AvidaGui2/pyPetriDishCtrl.py	2005-03-30 19:51:28 UTC (rev 94)
@@ -253,8 +253,22 @@
 
 
   def avidaUpdatedSlot(self):
-    print "pyPetriDishCtrl.avidaUpdatedSlot() : called."
+    def temp_normalized_index_functor(population_cell):
+      dbl = 0.0
+      if population_cell.IsOccupied():
+        dbl = population_cell.GetOrganism().GetPhenotype().GetFitness()
+      return dbl
 
+    def temp_color_functor(index):
+      def sigmoid(w, midpoint, steepness):
+        val = steepness*(w-midpoint)
+        return exp(val)/(1+exp(val))     
+      h = (index*360.0 + 100.0) % 360.0
+      v = sigmoid(index, 0.3, 10.0) * 255.0
+      s = sigmoid(1.0 - index, 0.1, 30.0) * 255.0
+      return QColor(h, s, v, QColor.Hsv)
+      
+
     def temp_normalized_index_functor(population_cell):
       dbl = 0.0
       if population_cell.IsOccupied():




More information about the Avida-cvs mailing list