[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination MainForm.cs,1
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-08-22 22:25:42
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11670/b7_Scripts/WalkForwardTesting/LinearCombination Modified Files: MainForm.cs Log Message: optimizationOutput is used in place of bestGenomes Index: MainForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/MainForm.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MainForm.cs 10 Aug 2005 16:49:20 -0000 1.5 --- MainForm.cs 22 Aug 2005 22:25:31 -0000 1.6 *************** *** 49,57 **** private GeneticOptimizer GO; ! /// <summary> ! /// bestGenomes[ i ] contains an array list with the best genomes ! /// for generation i ! /// </summary> ! private ArrayList bestGenomes; private System.Windows.Forms.MainMenu mainMenu1; --- 49,53 ---- private GeneticOptimizer GO; ! private OptimizationOutput optimizationOutput; private System.Windows.Forms.MainMenu mainMenu1; *************** *** 189,195 **** newGenerationEventHandler_updateProgressBar( newGenerationEventArgs ); ArrayList generation = newGenerationEventArgs.Generation; ! if ( this.bestGenomes.Count == 0 ) // this is the first generation created and this.bestGenomes is still empty ! this.bestGenomes.Add( new GenomeRepresentation( (Genome)generation[ generation.Count - 1 ] , this.firstDate , --- 185,191 ---- newGenerationEventHandler_updateProgressBar( newGenerationEventArgs ); ArrayList generation = newGenerationEventArgs.Generation; ! if ( this.optimizationOutput.Count == 0 ) // this is the first generation created and this.bestGenomes is still empty ! this.optimizationOutput.Add( new GenomeRepresentation( (Genome)generation[ generation.Count - 1 ] , this.firstDate , *************** *** 198,205 **** for ( int i=0 ; i < generation.Count ; i++ ) if ( ((Genome)generation[ i ]).Fitness > ! ((GenomeRepresentation)this.bestGenomes[ ! this.bestGenomes.Count - 1 ]).Fitness ) // generation[ i ] is a genome better than the best already stored ! this.bestGenomes.Add( new GenomeRepresentation( (Genome)generation[ i ] , this.firstDate , --- 194,201 ---- for ( int i=0 ; i < generation.Count ; i++ ) if ( ((Genome)generation[ i ]).Fitness > ! ((GenomeRepresentation)this.optimizationOutput[ ! this.optimizationOutput.Count - 1 ]).Fitness ) // generation[ i ] is a genome better than the best already stored ! this.optimizationOutput.Add( new GenomeRepresentation( (Genome)generation[ i ] , this.firstDate , *************** *** 212,217 **** new VisualObjectArchiver(); OptimizationOutput optimizationOutput = ! new OptimizationOutput( this.firstDate , this.lastDate , ! this.bestGenomes ); visualObjectArchiver.Save( optimizationOutput , "bgn" , "Save best genomes" ); --- 208,212 ---- new VisualObjectArchiver(); OptimizationOutput optimizationOutput = ! new OptimizationOutput(); visualObjectArchiver.Save( optimizationOutput , "bgn" , "Save best genomes" ); *************** *** 223,227 **** private void createOptimizedGenomes() { ! this.bestGenomes = new ArrayList(); // DataTable setOfTickersToBeOptimized = // this.getSetOfTickersToBeOptimized_quickly(); --- 218,222 ---- private void createOptimizedGenomes() { ! this.optimizationOutput = new OptimizationOutput(); // DataTable setOfTickersToBeOptimized = // this.getSetOfTickersToBeOptimized_quickly(); *************** *** 260,273 **** private void loadBestGenomesFromDisk() { ! if ( this.bestGenomes == null ) { VisualObjectArchiver visualObjectArchiver = new VisualObjectArchiver(); ! OptimizationOutput optimizationOutput = (OptimizationOutput)visualObjectArchiver.Load( "Load best genomes" , "bgn" , "Load Genomes"); ! this.firstDate = optimizationOutput.FirstDate; ! this.lastDate = optimizationOutput.LastDate; ! this.bestGenomes = optimizationOutput.BestGenomes; } } --- 255,271 ---- private void loadBestGenomesFromDisk() { ! if ( this.optimizationOutput == null ) { VisualObjectArchiver visualObjectArchiver = new VisualObjectArchiver(); ! this.optimizationOutput = (OptimizationOutput)visualObjectArchiver.Load( "Load best genomes" , "bgn" , "Load Genomes"); ! if ( this.optimizationOutput.Count == 0 ) ! throw new Exception( "The loaded optimization output contains no element!" ); ! this.firstDate = ((GenomeRepresentation)( ! this.optimizationOutput[ 0 ])).FirstOptimizationDate; ! this.lastDate = ((GenomeRepresentation)( ! this.optimizationOutput[ 0 ])).LastOptimizationDate; } } *************** *** 275,280 **** { TestDisplayer testDisplayer = new TestDisplayer( ! this.firstDate , this.lastDate , this.bestGenomes ); ! this.bestGenomes = null; testDisplayer.Show(); } --- 273,278 ---- { TestDisplayer testDisplayer = new TestDisplayer( ! this.firstDate , this.lastDate , this.optimizationOutput ); ! this.optimizationOutput = null; testDisplayer.Show(); } |