[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagDebugger
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-08-08 09:45:30
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagDebugger In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25535/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagDebugger Modified Files: WFLagChosenPositions.cs Log Message: - the Generation property has been added (First generation of the genetic optimizer, when the best genome was found) The custom deserialization has been patched accordingly Index: WFLagChosenPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagDebugger/WFLagChosenPositions.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WFLagChosenPositions.cs 30 Jul 2006 13:50:26 -0000 1.2 --- WFLagChosenPositions.cs 8 Aug 2006 09:45:27 -0000 1.3 *************** *** 45,48 **** --- 45,49 ---- private WeightedPositions portfolioWeightedPositions; private DateTime lastOptimizationDate; + private int generation; public WeightedPositions DrivingWeightedPositions *************** *** 74,77 **** --- 75,85 ---- } + /// <summary> + /// First generation of the genetic optimizer, when the best genome was created + /// </summary> + public int Generation + { + get { return this.generation; } + } public WFLagChosenPositions( WFLagChosenTickers wFLagChosenTickers , DateTime lastOptimizationDate ) *************** *** 84,87 **** --- 92,96 ---- this.portfolioWeightedPositions = wFLagChosenTickers.PortfolioWeightedPositions; this.lastOptimizationDate = lastOptimizationDate; + this.generation = wFLagChosenTickers.Generation; } *************** *** 148,154 **** try { ! // this.portfolioWeightedPositions = new WeightedPositions(); ! // System.Type type = System.Type.GetType( ! // "QuantProject.Scripts.WalkForwardTesting.WalkForwardLag.WeightedPositions" ); this.portfolioWeightedPositions = (WeightedPositions)info.GetValue( "portfolioWeightedPositions" , WeightedPositions.Type ); --- 157,163 ---- try { ! // this.portfolioWeightedPositions = new WeightedPositions(); ! // System.Type type = System.Type.GetType( ! // "QuantProject.Scripts.WalkForwardTesting.WalkForwardLag.WeightedPositions" ); this.portfolioWeightedPositions = (WeightedPositions)info.GetValue( "portfolioWeightedPositions" , WeightedPositions.Type ); *************** *** 164,167 **** --- 173,189 ---- } } + private void deserializeGeneration( + SerializationInfo info , StreamingContext context ) + { + try + { + this.generation = (int)info.GetValue( + "generation" , int.MaxValue.GetType() ); + } + catch + { + this.generation = -9999; + } + } private void deserializeThisClassMembers( SerializationInfo info , StreamingContext context ) { *************** *** 170,173 **** --- 192,196 ---- this.deserializeDrivingWeightedPositions( info , context ); this.deserializePortfolioWeightedPositions( info , context ); + this.deserializeGeneration( info , context ); } void ISerializable.GetObjectData( |