[Quantproject-developers] QuantProject/b4_Business/a2_Strategies/InSample GeneticChooser.cs, 1.2,
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2008-02-22 20:59:24
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25672/a2_Strategies/InSample Modified Files: GeneticChooser.cs Log Message: Removed parameter from the constructor (it created only confusion) Index: GeneticChooser.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample/GeneticChooser.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GeneticChooser.cs 13 Feb 2008 21:46:59 -0000 1.2 --- GeneticChooser.cs 22 Feb 2008 20:59:19 -0000 1.3 *************** *** 52,57 **** protected bool choosePositionsWithAtLeastOneDifferentTicker; //the genetic chooser will return the requested number ! //of TestingPositions that have a different tickers'composition ! //(that is TestingPositions with a different HashCodeForTickerComposition) protected TestingPositions[] bestTestingPositions; protected Benchmark benchmark; --- 52,59 ---- protected bool choosePositionsWithAtLeastOneDifferentTicker; //the genetic chooser will return the requested number ! //of genome (which meaning is a TestingPositions) that ! //have a different hash code ! //the method that returns the hash code for genome ! //is virtual protected TestingPositions[] bestTestingPositions; protected Benchmark benchmark; *************** *** 90,104 **** /// AnalyzeInSample method will return /// </param> - /// <param name="choosePositionsWithAtLeastOneDifferentTicker"> - /// If true, the returned TestingPositions - /// will be different in TickerComposition - /// (there won't be two TestingPositions with - /// exactly the same tickers). - /// If false, there will be returned just the best TestingPositions - /// ordered by fitness by the genetic optimizer - /// </param> public GeneticChooser( int numberOfPortfolioPositions , int numberOfBestTestingPositionsToBeReturned , - bool choosePositionsWithAtLeastOneDifferentTicker , Benchmark benchmark , IDecoderForTestingPositions decoderForTestingPositions , --- 92,97 ---- *************** *** 181,192 **** //it returns a hashCode for the given genome protected virtual string getHashCodeForGenome(Genome genome) { ! string returnValue; ! if (this.choosePositionsWithAtLeastOneDifferentTicker) ! returnValue = ((TestingPositions)genome.Meaning).HashCodeForTickerComposition; ! else ! returnValue = genome.Meaning.GetHashCode().ToString(); ! return returnValue; } --- 174,184 ---- //it returns a hashCode for the given genome + //normally, it should be overrided in inherited classes protected virtual string getHashCodeForGenome(Genome genome) { ! string returnValue = genome.Meaning.GetHashCode().ToString(); ! // if (this.choosePositionsWithAtLeastOneDifferentTicker) ! // returnValue = ((TestingPositions)genome.Meaning).HashCodeForTickerComposition; ! // else return returnValue; } |