예제 #1
0
 private void startoptimize_Click(object sender, EventArgs e)
 {
     if ((opt != null) && opt.isRunning)
     {
         optstatus("Wait until current optimization completes...");
         return;
     }
     // unbind events
     unbindsim(ref h);
     // make sure sim is prepped
     prepsim_needsbind(ref h, args);
     // create an optimization
     opt = new Optimize(args.DllName, args.ResponseName, h);
     // configure everything
     opt.Advance                        = _optinc.Value;
     opt.StartAt                        = _optstart.Value;
     opt.StopAt                         = _optstop.Value;
     opt.OptimizeName                   = _optimizename.Text;
     opt.OptimizeDecisionsName          = _optdecision.Text;
     opt.isHigherDecisionValuesBetter   = higherisoptimimal.Checked;
     opt.SendEngineDebugEvent          += new DebugDelegate(debug);
     opt.SendDebugEvent                += new DebugDelegate(debug);
     opt.SendStatusEvent               += new DebugDelegate(opt_SendStatusEvent);
     opt.SendOptimizationCompleteEvent += new ResultListDel(opt_SendOptimizationCompleteEvent);
     opt.SendOptimizationProgressEvent += new IntDelegate(opt_SendOptimizationProgressEvent);
     // start
     if (opt.Start())
     {
         tabs.SelectedIndex = 0;
     }
 }
예제 #2
0
        private void _optimizename_SelectedIndexChanged(object sender, EventArgs e)
        {
            // reset default advance
            bool isint = Optimize.isNameInt(args.DllName, args.ResponseName, _optimizename.Text);;

            _optinc.DecimalPlaces = isint ? 0 : 5;
            if (_optinc.Value == 0)
            {
                _optinc.Value = Optimize.GetMinAdvance(args.DllName, args.ResponseName, _optimizename.Text);
            }
        }
예제 #3
0
        void updateoptimize()
        {
            if (string.IsNullOrWhiteSpace(args.DllName) || string.IsNullOrWhiteSpace(args.ResponseName))
            {
                status("Select a response.");
                return;
            }
            // reset optimizeable params for this response
            _optimizename.Items.Clear();
            _optimizename.Items.AddRange(Optimize.GetOptimizeable(args.DllName, args.ResponseName).ToArray());

            if ((_optimizename.Items.Count > 0) && string.IsNullOrWhiteSpace(_optimizename.Text))
            {
                _optimizename.Text = _optimizename.Items[0].ToString();
            }
        }
예제 #4
0
        public Gauntlet()
        {
            TrackEnabled = Util.TrackUsage();
            Program      = PROGRAM;
            InitializeComponent();
            Text += " " + Util.TLVersion();
            debug(Util.TLSIdentity());
            args.GotDebug += new DebugDelegate(args_GotDebug);
            args.ParseArgs(Environment.GetCommandLineArgs());
            FormClosing += new FormClosingEventHandler(Gauntlet_FormClosing);
            debug(RunTracker.CountNewGetPrettyRuns(PROGRAM, Util.PROGRAM));
            bw.WorkerSupportsCancellation = true;
            bw.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);
            getsymwork.WorkerSupportsCancellation = true;
            getsymwork.DoWork             += new DoWorkEventHandler(getsymwork_DoWork);
            getsymwork.RunWorkerCompleted += new RunWorkerCompletedEventHandler(getsymwork_RunWorkerCompleted);
            getsymwork.RunWorkerAsync();
            getsymwork.RunWorkerCompleted += new RunWorkerCompletedEventHandler(getsymwork_RunWorkerCompleted);

            if (args.isUnattended)
            {
                ordersincsv.Checked = true;
                if (args.HideWindow)
                {
                    this.ShowInTaskbar = false; this.WindowState = FormWindowState.Minimized;
                }
                //ShowWindow(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, SW_MINIMIZE);
                bindresponseevents();
                queuebut_Click(null, null);
            }
            else
            {
                status("wait while tickdata is loaded...");
                UpdateResponses(ResponseLoader.GetResponseList(args.DllName));
            }

            _optdecision.Items.Clear();
            _optdecision.Items.AddRange(Optimize.GetDecideable().ToArray());
            if (_optdecision.Items.Count > 0)
            {
                _optdecision.Text = "NetPL";
            }
        }
예제 #5
0
        private void startoptimize_Click(object sender, EventArgs e)
        {
            if ((opt != null) && opt.isRunning)
            {
                optstatus("Wait until current optimization completes...");
                return;
            }
            // unbind events
            unbindsim(ref h);
            // make sure sim is prepped
            prepsim_needsbind(ref h, args);
            // create an optimization
            opt = new Optimize(args.DllName, args.ResponseName, h);
            // configure everything
            opt.Advance = _optinc.Value;
            opt.StartAt = _optstart.Value;
            opt.StopAt = _optstop.Value;
            opt.OptimizeName = _optimizename.Text;
            opt.OptimizeDecisionsName = _optdecision.Text;
            opt.isHigherDecisionValuesBetter = higherisoptimimal.Checked;
            opt.SendEngineDebugEvent += new DebugDelegate(debug);
            opt.SendDebugEvent+=new DebugDelegate(debug);
            opt.SendStatusEvent += new DebugDelegate(opt_SendStatusEvent);
            opt.SendOptimizationCompleteEvent +=new ResultListDel(opt_SendOptimizationCompleteEvent);
            opt.SendOptimizationProgressEvent += new IntDelegate(opt_SendOptimizationProgressEvent);
            // start
            if (opt.Start())
            {
                tabs.SelectedIndex = 0;
            }

        }