Esempio n. 1
0
        public ExperimentWindow(ExperimentWorker experimentWorker)
        {
            this.context = BufferedGraphicsManager.Current;

            this.experiment = experimentWorker.Experiment;

            var presenterFactory = EnvironmentRegistry.GetPresenterFactoryForEnvironment(this.experiment.Environment.GetType());

            this.realTimeLearningPresenter   = presenterFactory(experiment.Environment);
            this.policyPresentationPresenter = presenterFactory(experiment.PresentationEnvironment);

            InitializeComponent();

            this.experimentWorker = experimentWorker;
            this.experimentWorker.ExperimentFinished += new EventHandler(ExperimentFinished);
            this.ownExperimentWorker = false;

            this.experimentWorker.ConfigureProgressBar(this.progressBar1);

            this.timer.Stop();
            this.timer.Interval = GlobalParameters.TimerInterval;

            InitGraphics();
            this.DoubleBuffered = true;

            this.progressBar1.Visible = true;
            this.timer.Interval       = GlobalParameters.TimerInterval;

            RefreshPresentationContent();
        }
Esempio n. 2
0
        public void ExperimentFinished(ExperimentWorker experimentWorker)
        {
            ExperimentInfo ei = ((experimentWorker.Tag as ListViewItem).Tag as ExperimentInfo);

            ei.Status = Status.Finished;
            ei.Error  = experimentWorker.Error;

            if (this.experimentListView.Items.Cast <ListViewItem>().All(lvi => (lvi.Tag as ExperimentInfo).Status == Status.Finished))
            {
                this.batchModeComboBox.Enabled = false;
                this.okButton.Enabled          = true;
                this.cancelButton.Enabled      = false;
                this.startAllButton.Enabled    = false;
                this.pauseAllButton.Enabled    = false;
            }
            else if (this.batchExperiment.BatchMode != BatchMode.Parallel)
            {
                StartSequential();
            }

            Refresh();
        }