示例#1
0
        public void RunBruteForceTest(string defaultDir, InputData inData, OptimizationFunctionIntNDFactory optFuncFactory)
        {
            if (!System.IO.Directory.Exists(defaultDir))
            {
                System.IO.Directory.CreateDirectory(defaultDir);
            }

            semaphore.WaitOne();

            System.Threading.Thread t = new Thread(new ParameterizedThreadStart(RunSinglePeriodBruteForceTest));
            t.Start(new TestParameters(inData, inData.Data[0].DateTime, inData.Data.Last().DateTime, optFuncFactory, defaultDir));
        }
        /// <summary>
        /// Send the command to the undlerying socket
        /// </summary>
        /// <param name="command">The command to send</param>
        public string SendCommand(Command command)
        {
            try
            {
                semaphoreCommands.WaitOne();

                CheckForDisposed();

                if (command == null)
                {
                    throw new ArgumentNullException("command");
                }

                return(Dispatcher.Dispatch(command));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                semaphoreCommands.Release();
            }
        }