[Quantproject-developers] QuantProject/b4_Business/a2_Strategies/InSample GeneticChooser.cs, 1.4,
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-02-27 22:10:03
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10951/a2_Strategies/InSample Modified Files: GeneticChooser.cs Log Message: - minor fixing for a string content - the method getHashCodeForGenome(Genome genome); is abstract, now Index: GeneticChooser.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample/GeneticChooser.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GeneticChooser.cs 25 Feb 2008 23:09:00 -0000 1.4 --- GeneticChooser.cs 27 Feb 2008 22:09:54 -0000 1.5 *************** *** 104,107 **** --- 104,109 ---- this.numberOfPortfolioPositions = numberOfPortfolioPositions; this.numberOfBestTestingPositionsToBeReturned = numberOfBestTestingPositionsToBeReturned; + // this.choosePositionsWithAtLeastOneDifferentTicker = + // choosePositionsWithAtLeastOneDifferentTicker; this.bestTestingPositions = new TestingPositions[numberOfBestTestingPositionsToBeReturned]; this.benchmark = benchmark; *************** *** 126,130 **** throw new Exception( "Eligible tickers for driving positions contains " + "only " + eligibleTickers.Count + ! " elements, while NumberOfDrivingPositions is " + this.numberOfPortfolioPositions ); if ( this.numberOfBestTestingPositionsToBeReturned > --- 128,132 ---- throw new Exception( "Eligible tickers for driving positions contains " + "only " + eligibleTickers.Count + ! " elements, while number of portfolio positions is " + this.numberOfPortfolioPositions ); if ( this.numberOfBestTestingPositionsToBeReturned > *************** *** 174,185 **** //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; ! } private void setBestTestingPositions() --- 176,187 ---- //it returns a hashCode for the given genome //normally, it should be overrided in inherited classes ! protected abstract string getHashCodeForGenome(Genome genome); ! // { ! // string returnValue = genome.Meaning.GetHashCode().ToString(); ! //// if (this.choosePositionsWithAtLeastOneDifferentTicker) ! //// returnValue = ((TestingPositions)genome.Meaning).HashCodeForTickerComposition; ! //// else ! // return returnValue; ! // } private void setBestTestingPositions() *************** *** 201,204 **** --- 203,207 ---- (TestingPositions)currentGenome.Meaning; genomesCollector.Add(currentGenomeHashcode, null); + addedTestingPositions++; } counter ++ ; |