[Quantproject-developers] QuantProject/b7_Scripts/ArbitrageTesting/PairTrading/SimplePairTrading G
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2006-08-07 21:03:30
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/ArbitrageTesting/PairTrading/SimplePairTrading In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22618/b7_Scripts/ArbitrageTesting/PairTrading/SimplePairTrading Modified Files: GenomeManagerForSimplePT.cs SimplePTGenomeManipulator.cs Log Message: Changed IGenomeManager interface. Now, properties MinValueForGenes and MaxValueForGenes have been replaced by GetMinValueForGenes(int genePosition) and GetMaxValueForGenes(int genePosition) methods. Property CurrentGeneticOptimizer has been deleted from the interface. Modified the constructor of Genome class: now a GeneticOptimizer object is necessary for a creating a new instance of Genome. Some useless code has been deleted through out the classes used for genetic optimization. Index: SimplePTGenomeManipulator.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/ArbitrageTesting/PairTrading/SimplePairTrading/SimplePTGenomeManipulator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimplePTGenomeManipulator.cs 14 May 2006 15:25:30 -0000 1.1 --- SimplePTGenomeManipulator.cs 7 Aug 2006 21:03:24 -0000 1.2 *************** *** 106,113 **** { initializeStaticMembers(parent1, parent2); - if(parent1.Size > (parent1.MaxValueForGenes - parent1.MinValueForGenes + 1)) - //it is impossible not to duplicate genes if size is too - // large for the range of variation of each gene - throw new Exception("Impossible to avoid duplicates with the given size!"); if(parent1.Size != parent2.Size) throw new Exception("Genomes must have the same size!"); --- 106,109 ---- Index: GenomeManagerForSimplePT.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/ArbitrageTesting/PairTrading/SimplePairTrading/GenomeManagerForSimplePT.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenomeManagerForSimplePT.cs 14 May 2006 15:25:30 -0000 1.1 --- GenomeManagerForSimplePT.cs 7 Aug 2006 21:03:24 -0000 1.2 *************** *** 51,55 **** private int minValueForGenes; private int maxValueForGenes; - private GeneticOptimizer currentGeneticOptimizer; private float[] gaps; //it will contain absolute gaps of gain for tickers --- 51,54 ---- *************** *** 62,80 **** } ! public int MinValueForGenes { ! get{return this.minValueForGenes;} } ! public int MaxValueForGenes { ! get{return this.maxValueForGenes;} } - public GeneticOptimizer CurrentGeneticOptimizer - { - get{return this.currentGeneticOptimizer;} - set{this.currentGeneticOptimizer = value;} - } //end of interface implementation for properties --- 61,74 ---- } ! public int GetMinValueForGenes(int genePosition) { ! return this.minValueForGenes; } ! public int GetMaxValueForGenes(int genePosition) { ! return this.maxValueForGenes; } //end of interface implementation for properties *************** *** 189,194 **** // the one contained in 3° or 2° position { ! returnValue = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, ! genome.MaxValueForGenes + 1); while(genePosition>0 && SimplePTGenomeManipulator.IsTickerContainedInGenome(returnValue, --- 183,188 ---- // the one contained in 3° or 2° position { ! returnValue = GenomeManagement.RandomGenerator.Next(genome.GetMinValueForGenes(genePosition), ! genome.GetMaxValueForGenes(genePosition) + 1); while(genePosition>0 && SimplePTGenomeManipulator.IsTickerContainedInGenome(returnValue, *************** *** 200,205 **** { // a new returnValue has to be generated ! returnValue = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, ! genome.MaxValueForGenes + 1); } } --- 194,199 ---- { // a new returnValue has to be generated ! returnValue = GenomeManagement.RandomGenerator.Next(genome.GetMinValueForGenes(genePosition), ! genome.GetMaxValueForGenes(genePosition) + 1); } } *************** *** 220,225 **** else { ! newValueForGene = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, ! genome.MaxValueForGenes + 1); while(genePositionToBeMutated>0 && SimplePTGenomeManipulator.IsTickerContainedInGenome(newValueForGene, --- 214,219 ---- else { ! newValueForGene = GenomeManagement.RandomGenerator.Next(genome.GetMinValueForGenes(genePositionToBeMutated), ! genome.GetMaxValueForGenes(genePositionToBeMutated) + 1); while(genePositionToBeMutated>0 && SimplePTGenomeManipulator.IsTickerContainedInGenome(newValueForGene, *************** *** 230,235 **** //already stored in the given genome { ! newValueForGene = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, ! genome.MaxValueForGenes + 1); } --- 224,229 ---- //already stored in the given genome { ! newValueForGene = GenomeManagement.RandomGenerator.Next(genome.GetMinValueForGenes(genePositionToBeMutated), ! genome.GetMaxValueForGenes(genePositionToBeMutated) + 1); } |