Eugene Kononov wrote:
> Attached is a new version of the multi-threaded optimizer. I changed
> some things. The speed improvement ratios should be about the same as
> before. The difference is in the implementation, which now uses standard
> Java 1.5 concurrency idioms, instead of reinventing the wheel. Can you
> folks please retest and report your ratios again? Thanks.

in OptimizerRunner.java:

    public void run() {
        try {
            ...SNIP...
            scheduler.scheduleWithFixedDelay(...SNIP...);
            long start = System.currentTimeMillis();
            optimize();
            long end = System.currentTimeMillis();

            if (!cancelled) {
                optimizerDialog.showProgress("Saving optimization results ...");
                saveToFile();
                long totalTimeInSecs = (end - start) / 1000;
                showFastProgress(totalSteps, "Optimization");
                MessageDialog.showMessage(...SNIP...);
            }
        } catch (Throwable t) {
            Dispatcher.getReporter().report(t);
            MessageDialog.showError(optimizerDialog, t.toString());
        } finally {
            scheduler.shutdownNow();
            optimizerDialog.signalCompleted();
        }
    }


Maybe we should insert another "scheduler.shutdownNow();" after "optimize();"
otherwise "Saving optimization results ..." could be overrided with a "100 out
of 100 strategies proceed" ;)

--
Florent,

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"JBookTrader" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jbooktrader?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to