[Quantproject-developers] QuantProject/b1_ADT/Optimizing/Genetic GenomeManagement.cs,1.4,1.5
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-07-25 22:30:40
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20838/b1_ADT/Optimizing/Genetic Modified Files: GenomeManagement.cs Log Message: - Added new public method SetRandomGenerator, for setting the Random generator used by the other public methods. Index: GenomeManagement.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic/GenomeManagement.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GenomeManagement.cs 13 Jul 2005 16:37:04 -0000 1.4 --- GenomeManagement.cs 25 Jul 2005 22:30:32 -0000 1.5 *************** *** 43,48 **** static GenomeManagement() { ! RandomGenerator = new Random((int)DateTime.Now.Ticks); ! childs = new Genome[2]; } --- 43,48 ---- static GenomeManagement() { ! RandomGenerator = new Random((int)DateTime.Now.Ticks); ! childs = new Genome[2]; } *************** *** 64,68 **** } } ! /// <summary> /// Returns an array of genome (length = 2) based /// on classical one point crossover genes recombination --- 64,80 ---- } } ! ! /// <summary> ! /// It sets randomGenerator used by all other public methods ! /// provided by the class. ! /// If random generation process has to be controlled, ! /// it needs to be called before all the other public methods ! /// </summary> ! public static void SetRandomGenerator(int seedForRandomGenerator) ! { ! GenomeManagement.RandomGenerator = new Random(seedForRandomGenerator); ! } ! ! /// <summary> /// Returns an array of genome (length = 2) based /// on classical one point crossover genes recombination |