Exemplo 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();
        }
        public ExperimentSetupWindow()
        {
            this.inhibitEvents = false;

            InitializeComponent();

            IEnumerable <Type> environments = EnvironmentRegistry.GetEnvironments().ToArray();

            List <string> environmentNames = environments
                                             .Select(environmentType => environmentType.Name)
                                             .ToList();

            int e = 0;

            foreach (Type environmentType in environments)
            {
                RadioButton radioButton = new RadioButton();
                this.environmentPanel.Controls.Add(radioButton);

                radioButton.AutoSize        = true;
                radioButton.Location        = new System.Drawing.Point(20, e * 16);
                radioButton.Name            = "environmentRadioButton" + e;
                radioButton.TabIndex        = e;
                radioButton.TabStop         = true;
                radioButton.Tag             = environmentType;
                radioButton.Text            = environmentType.GetDisplayName();
                radioButton.CheckedChanged += new System.EventHandler(this.EnvironmentSelected);
                ++e;
            }

            this.okButton.Enabled = false;
            this.environmentParametersApplyButton.Enabled  = false;
            this.environmentParametersRevertButton.Enabled = false;
            this.agentParametersApplyButton.Enabled        = false;
            this.agentParametersRevertButton.Enabled       = false;
            this.experimentParametersApplyButton.Enabled   = false;
            this.experimentParametersRevertButton.Enabled  = false;
            this.tabControl.TabPages.Remove(this.experimentParametersTabPage);
            this.tabControl.TabPages.Remove(this.reportingTabPage);
        }