[Quantproject-developers] Re: [Quantproject-developers] QuantProject/b7_Scripts/TickerSelectionTest
Brought to you by:
glauco_1
At 10:05 AM 8/28/2005 +0000, you wrote:
>+ ConstantsProvider.SeedForRandomGenerator++;
Aaaarrrggghhh!!! Cambiare il valore di una costante... non era una di
quelle cose che, agli esami, facesse prendere un bel voto :-)
Lo so che probabilmente non ci sono effetti collaterali, ma se non ti
complica troppo la vita usare una variabile d'appoggio, quando hai tempo
vedi se si puo' lasciare la costante... costante ;-)
Scherzi a parte, nei vecchi linguaggi, il senso delle costanti era solo che
quello dare un un nome mnemonico ad un valore che non cambiava mai e di
avere un unico punto del codice in cui andare a cambiare il valore. Le
costanti erano addirittura preprocessate rispetto alla compilazione, cioe',
al compilatore veniva passato il testo con i valori gia' sositutiti, quindi
uno statement tipo
costantName++
al compilatore sarebbe, ad esempio, arrivato cosi'
13++
> this.orders.Clear();
> //this.oneHourAfterMarketCloseEventHandler_updatePrices();
> if(this.numDaysElapsedSinceLastOptimization ==
>! this.numDaysBetweenEachOptimization - 1)
> {
>
>this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime, false);
>
>Index: EndOfDayTimerHandler.cs
>===================================================================
>RCS file:
>/cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v
>retrieving revision 1.15
>retrieving revision 1.16
>diff -C2 -d -r1.15 -r1.16
>*** EndOfDayTimerHandler.cs 1 Aug 2005 22:31:48 -0000 1.15
>--- EndOfDayTimerHandler.cs 28 Aug 2005 10:05:03 -0000 1.16
>***************
>*** 212,216 ****
> this.bestGenomes.Add(new GenomeRepresentation(genome,
> firstOptimizationDate,
>!
>secondOptimizationDate));
> }
>
>--- 212,217 ----
> this.bestGenomes.Add(new GenomeRepresentation(genome,
> firstOptimizationDate,
>! secondOptimizationDate,
>! genome.Generation));
> }
>
>
>Index: EndOfDayTimerHandlerCTC.cs
>===================================================================
>RCS file:
>/cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerCTC.cs,v
>retrieving revision 1.12
>retrieving revision 1.13
>diff -C2 -d -r1.12 -r1.13
>*** EndOfDayTimerHandlerCTC.cs 1 Aug 2005 22:31:48 -0000 1.12
>--- EndOfDayTimerHandlerCTC.cs 28 Aug 2005 10:05:03 -0000 1.13
>***************
>*** 193,197 ****
> Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs )
> {
>!
> if(this.account.Portfolio.Count == 0 )
> {
>--- 193,197 ----
> Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs )
> {
>! ConstantsProvider.SeedForRandomGenerator++;
> if(this.account.Portfolio.Count == 0 )
> {
>
>
>
>-------------------------------------------------------
>SF.Net email is Sponsored by the Better Software Conference & EXPO
>September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
>Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
>Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
>_______________________________________________
>Quantproject-developers mailing list
>Qua...@li...
>https://lists.sourceforge.net/lists/listinfo/quantproject-developers
|