[Avida-SVN] r1531 - branches/dkdev/source/main

dknoester at myxo.css.msu.edu dknoester at myxo.css.msu.edu
Mon May 7 05:59:52 PDT 2007


Author: dknoester
Date: 2007-05-07 08:59:52 -0400 (Mon, 07 May 2007)
New Revision: 1531

Modified:
   branches/dkdev/source/main/cPopulation.cc
Log:
Changing fitness function for graph diameter.

Modified: branches/dkdev/source/main/cPopulation.cc
===================================================================
--- branches/dkdev/source/main/cPopulation.cc	2007-05-05 19:48:09 UTC (rev 1530)
+++ branches/dkdev/source/main/cPopulation.cc	2007-05-07 12:59:52 UTC (rev 1531)
@@ -972,9 +972,12 @@
           }          
           
           // Now, update this deme's merit.
-          source_germline.UpdateMerit(pow(max_lsp - mean_lsp + 1, 2) // This is for mean lsp.
-                                      + pow(max_edges - boost::num_edges(network) + 1, 2) // This is to reduce edge-count.
-                                      );
+          // This particular calculation doesn't work well; it rewards small diameter and small number of edges equally.
+          //source_germline.UpdateMerit(pow(max_lsp - mean_lsp + 1, 2) // This is for mean lsp.
+          //                          + pow(max_edges - boost::num_edges(network) + 1, 2));
+          // This one however, is perhaps better.  We reward low diameter the most, scaled by the maximum possible
+          // number of edges.  Then, we reduce this number by the actual number of edges, and square it.
+          source_germline.UpdateMerit(pow((max_lsp - mean_lsp + 1) * max_edges - boost::num_edges(network), 2));
         }          
         break;
       }




More information about the Avida-cvs mailing list