Exemplo n.º 1
0
            internal void enqueueRun(int runNumber)
            {
                var runParameters = parameters(runNumber);
                var request       = new STORequest(symbols, portfolios, runParameters);

                if (numInstances > 0 && !existingRuns.Contains(runNumber))
                {
                    runner.request(request.java());
                }
                else
                {
                    runner.responseQueue().send(request.response("LOCAL", now(), now(), processId()));
                }

                lock (runsQueuedLock) runsQueued++;
                if (runsQueued % 100 == 0)
                {
                    info("queued message for run " + (start + runsQueued - 1));
                }
            }
Exemplo n.º 2
0
        static int processNextMessage(EC2Runner runner, int lastRunTime, out STORequest request)
        {
            var message = runner.nextMessage(Math.Min(7200, 2 * lastRunTime));
            var start   = now();

            request = new STORequest(message.@object());
            info("received " + request);
            if (symbols == null || barData == null)
            {
                cacheSymbolData(request);
            }
            else
            {
                request.requireMatch(symbols);
            }
            var simulator = new Simulator.Simulator(new SystemArguments(symbols, request.portfolios, request.parameters), barData, "QUEDGE");

            simulator.processBars();
            simulator.shutdown();
            lastRunTime = Math.Max((int)now().Subtract(start).TotalSeconds, 10);
            runner.responseQueue().send(request.response(EC2Runner.instanceId(), start, now(), processId()));
            message.delete();
            return(lastRunTime);
        }