/// <summary> /// Click on Bootstrap: bootstrap selected distribution, show two solutions at once /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BootstrapClick_Click(object sender, EventArgs e) { AfterBootstrap = true; _nextButton.Enabled = false; button1.Enabled = false; if (_model.Setting.NumberOfFeatures == 0) { NumberOfFeaturesLabel.Text = @"Select Number of Features first"; return; } Distribution[] results; if (OwnValues) { results = _model.ScaleDistribution(_model.DStore.SelectedFeatureDistribution, _model.Setting.NumberOfFeatures, 2); pictureBox1.ImageLocation = results[0].ImagePath; pictureBox3.ImageLocation = results[1].ImagePath; _model.Setting.SelectedFeature = 0; SelectFirstDist.Enabled = true; SelectSecondDist.Enabled = true; return; } switch (((Distribution)RealFeatureValuesBox.SelectedItem).DisplayName) { case "Normal": results = _model.CreateNormalDist(2, Distribution.DistributionType.Feature); FirstPLabel.Text = @"No test yet"; SecondPLabel.Text = @"No test yet"; break; case "Uniform": results = _model.CreateUnifDist(2, Distribution.DistributionType.Feature); FirstPLabel.Text = @"No test yet"; SecondPLabel.Text = @"No test yet"; break; default: NumberOfFeaturesLabel.Text = @"Scaling to " + _model.Setting.NumberOfFeatures; results = _model.ScaleDistribution(_model.DStore.FeatureToStrap, _model.Setting.NumberOfFeatures, 2); break; } pictureBox1.ImageLocation = results[0].ImagePath; pictureBox3.ImageLocation = results[1].ImagePath; //_model.Setting.SelectedFeature = 0; SelectFirstDist.Enabled = true; SelectFirstDist.Text = @"Select"; SelectSecondDist.Text = @"Select"; SelectSecondDist.Enabled = true; }
/// <summary> /// Bootstrap the interactions /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BootstrapInteractions_Click(object sender, EventArgs e) { //Should not happen at this point! was catched by previous flow if (_model.Setting.NumberOfInteractions == 0) { NumberOfInteractions.Text = @"Select Number of Interactions first"; return; } Distribution[] results; if (SelectedInteractionValues.SelectedItem == null) { results = _model.ScaleDistribution(_model.DStore.SelectedInteractionDistribution, _model.Setting.NumberOfInteractions, 2); } else { switch (((Distribution)SelectedInteractionValues.SelectedItem).DisplayName) { case "Normal": results = _model.CreateNormalDist(2, Distribution.DistributionType.Interaction); pValue1Label.Text = @"No test yet"; pValue2Label.Text = @"No test yet"; break; case "Uniform": results = _model.CreateUnifDist(2, Distribution.DistributionType.Interaction); pValue1Label.Text = @"No test yet"; pValue2Label.Text = @"No test yet"; break; default: results = _model.ScaleDistribution(_model.DStore.InteracToStrap, _model.Setting.NumberOfInteractions, 2); break; } } //var results = _model.ScaleDistribution(_model.DStore.SelectedInteractionDistribution, _model.Setting.NumberOfInteractions, 2); pictureBox2.ImageLocation = results[0].ImagePath; pictureBox4.ImageLocation = results[1].ImagePath; SelectSecond.Enabled = true; SelectFirst.Text = @"Select"; SelectSecond.Text = @"Select"; SelectFirst.Enabled = true; _nextButton.Enabled = false; button2.Enabled = false; _afterBootstrap = true; }