public LogNormalDistributionViewModel(IAppService appService, IAppSettings appSettings) : base(appService, appSettings) { PlotModel = new PlotModel { IsLegendVisible = false }; PlotModel.AddAxes(string.Empty, default, default, string.Empty, default, default);
internal BrowseViewModel(IAppState appState, IAppSettings appSettings, IAppService appService, ModuleState moduleState) { _appState = appState; _appSettings = appSettings; _moduleState = moduleState; var evidence = _appState.SimEvidence; var simulation = _appState.Target.AssertSome(); var ivElement = simulation.SimConfig.SimOutput.IndependentVariable; _observationsScatterPlot = new PlotModel(); _observationsScatterPlot.AssignDefaultColors(appSettings.IsBaseDark, PLOT_COLOR_COUNT); _observationsScatterPlot.AddAxes(ivElement.GetFQName(), default, default, default, default, default);
internal LikelihoodViewModel(IAppState appState, IAppService appService, IAppSettings appSettings, ModuleState moduleState) { _appSettings = appSettings; _simulation = appState.Target.AssertSome("No simulation"); _evidence = appState.SimEvidence; _moduleState = moduleState; _toggleSelectOutput = ReactiveCommand.Create <IOutputViewModel>(HandleToggleSelectOutput); AllOutputViewModels = _simulation.SimConfig.SimOutput.DependentVariables .Map(e => new OutputViewModel(e.Name, _toggleSelectOutput)) .OrderBy(vm => vm.SortKey) .ToArr <IOutputViewModel>(); _moduleState.OutputStates.Iter(os => { var outputViewModel = AllOutputViewModels .Find(vm => vm.Name == os.Name) .AssertSome($"Unknown output in module state: {os.Name}"); outputViewModel.IsSelected = os.IsSelected; outputViewModel.ErrorModel = os.GetErrorModel().ToString(os.Name); }); SelectedOutputViewModels = new ObservableCollection <IOutputViewModel>( AllOutputViewModels.Where(vm => vm.IsSelected) ); SelectedOutputViewModel = SelectedOutputViewModels.FindIndex( vm => vm.Name == moduleState.LikelihoodState.SelectedOutput ); var errorModelTypes = ErrorModelType.All; _outputErrorViewModel = new OutputErrorViewModel( appState, appService, errorModelTypes ); var ivElement = _simulation.SimConfig.SimOutput.IndependentVariable; _observationsScatterPlot = new PlotModel(); _observationsScatterPlot.AssignDefaultColors(appSettings.IsBaseDark, PLOT_COLOR_COUNT); _observationsScatterPlot.AddAxes(ivElement.GetFQName(), default, default, default, default, default);