private void btnReproFuncs_Click(object sender, EventArgs e) { List <double> probabilities = _settings.ReproductionFuncProbabilities; List <string> names = ReproductionFunction.FunctionNames; DistributionBox.DistributionInfo info = DistributionBox.ShowDistribution( this.Parent, "Reproduction", "Reproduction function distribution", names.Select((string name, int i) => new Tuple <string, double>(name, probabilities[i])).ToList(), 150 ); if (info != null) { Settings.ReproductionFuncProbabilities = info.Values; } }
private void btnMutationFuncs_Click(object sender, System.EventArgs e) { List <double> probabilities = _settings.MutationFunctionProbabilities; List <string> names = MutationFunction.FunctionNames; DistributionBox.DistributionInfo info = DistributionBox.ShowDistribution( this.Parent, "Mutation", "Mutation function distribution", names.Select((string name, int i) => new Tuple <string, double>(name, probabilities[i])).ToList(), 150, "Mutation temperature", _settings.MutationTemperature ); if (info != null) { Settings.MutationFunctionProbabilities = info.Values; Settings.MutationTemperature = info.ExtraValue; } }
private DistributionBox.DistributionInfo DoStatesDistributionDialog(string titleWindow, string titleHistogram, List <double> probabilities) { List <Color> colors = ((LifelikeWindow)Parent).Colors; int states = probabilities.Count(); var data = Enumerable.Range(0, states).Select( (int i) => { return(new Tuple <string, double, Color>( string.Format("State {0}", i), probabilities[i], colors[i] )); }).ToList(); return(DistributionBox.ShowDistribution( this.Parent, titleWindow, titleHistogram, data, true )); }