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

dknoester at myxo.css.msu.edu dknoester at myxo.css.msu.edu
Mon May 7 19:11:51 PDT 2007


Author: dknoester
Date: 2007-05-07 22:11:51 -0400 (Mon, 07 May 2007)
New Revision: 1534

Modified:
   branches/dkdev/source/main/cPopulation.cc
Log:
Yet another network fitness function.

Modified: branches/dkdev/source/main/cPopulation.cc
===================================================================
--- branches/dkdev/source/main/cPopulation.cc	2007-05-07 17:37:06 UTC (rev 1533)
+++ branches/dkdev/source/main/cPopulation.cc	2007-05-08 02:11:51 UTC (rev 1534)
@@ -973,11 +973,19 @@
           
           // Now, update this deme's merit.
           // This particular calculation doesn't work well; it rewards small diameter and small number of edges equally.
+          // The end result is a network that favors low edge count, with little bias towards diameter.
           //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));
+          // This fitness function is the opposite of the above.  Here, low diameter is favored, resulting in nearly
+          // full networks.
+          //source_germline.UpdateMerit(pow((max_lsp - mean_lsp + 1) * max_edges - boost::num_edges(network), 2));
+          //
+          // Let's try to balance these out a bit.  We're looking for a network that has both low diameter
+          // and few edges.
+          source_germline.UpdateMerit(pow((max_lsp-mean_lsp+1)*(max_edges-boost::num_edges(network)+1),2));
         }          
         break;
       }




More information about the Avida-cvs mailing list