Example #1
0
        public override Tuple <string, ExposureMetricFunc>[] DefineContent(Dictionary <string, object> customVals)
        {
            MeasureList ml = new MeasureList(measures: new[] { 81, 79.5, 80.7, 78.1, 80.1, 74.8, 74.8, 79.8, 79.8 },
                                             oel: 85);

            UninformativeModelParameters modelParams = UninformativeModelParameters.GetDefaults(logNormalDstrn: false);

            this.OverwriteDefaults(modelParams, customVals);

            McmcParameters mcmcParams = new McmcParameters();

            this.OverwriteDefaults(mcmcParams, customVals);

            ExposureMetricEstimates eme = new ExposureMetricEstimates(
                new SEGUninformativeModel(measures: ml,
                                          specificParams: modelParams,
                                          mcmcParams: mcmcParams));

            this.Emes = new ExposureMetricEstimates[] { eme };

            return(new Tuple <string, ExposureMetricFunc>[] {
                Tuple.Create("Arithmetic mean", new ExposureMetricFunc(e => e.ArithMean())),
                Tuple.Create("Arithmetic standard deviation", new ExposureMetricFunc(e => e.ArithStanDev())),
                Tuple.Create("Exceedance Fraction (%)", new ExposureMetricFunc(e => e.ExceedanceFrac())),
                Tuple.Create("95th percentile", new ExposureMetricFunc(e => e.P95()))
            });
        }
Example #2
0
        public override Tuple <string, ExposureMetricFunc>[] DefineContent(Dictionary <string, object> customVals)
        {
            MeasureList ml = new MeasureList(measures: new[] { 24.7, 64.1, 13.8, 43.7, 19.9, 133, 32.1, 15, 53.7 },
                                             oel: 100);
            SEGInformedVarModelParameters modelParams = SEGInformedVarModelParameters.GetDefaults(logNormalDstrn: true);

            this.OverwriteDefaults(modelParams, customVals);

            McmcParameters mcmcParams = new McmcParameters();

            this.OverwriteDefaults(mcmcParams, customVals);

            ExposureMetricEstimates eme = new ExposureMetricEstimates(
                new SEGInformedVarModel(measures: ml, specificParams: modelParams, mcmcParams: mcmcParams));

            this.Emes = new ExposureMetricEstimates[] { eme };

            return(new Tuple <string, ExposureMetricFunc>[] {
                Tuple.Create("GM", new ExposureMetricFunc(e => e.GeomMean())),
                Tuple.Create("GSD", new ExposureMetricFunc(e => e.GeomStanDev())),
                Tuple.Create("Exceedance Fraction (%)", new ExposureMetricFunc(e => e.ExceedanceFrac(true))),
                Tuple.Create("95th percentile", new ExposureMetricFunc(e => e.P95(true))),
                Tuple.Create("AIHA band probabilities in % (95th percentile)", new ExposureMetricFunc(e => e.BandProbabilities())),
                Tuple.Create("Arithmetic mean", new ExposureMetricFunc(e => e.ArithMean(true))),
                Tuple.Create("AIHA band probabilities in % (AM)", new ExposureMetricFunc(e => e.BandProbabilities(false)))
            });
        }
Example #3
0
        private Model buildModel()
        {
            Model model = null;
            Range mer   = meRange;

            string mlStr = String.Join("|", Entrs.Observations.Split(new String[] { CR }, StringSplitOptions.RemoveEmptyEntries));
            string meStr = "";

            if ((bool)me_CV.IsChecked && !(MERange.Minimum == 0 && MERange.Maximum == 0))
            {
                meStr = "cv(" + ShowDouble(MERange.Minimum / 100) + "~" + ShowDouble(MERange.Maximum / 100) + ")|";
            }

            PastDataSummary PD = new PastDataSummary();

            if ((bool)DistriAP_ExpostatsPData.IsChecked && !double.IsNaN(PastData.Mean) && !double.IsNaN(PastData.SD) && PastData.N != 0)
            {
                PD = new PastDataSummary(PastData.Mean, PastData.SD, PastData.N);
            }

            bool        preBuildError = false;
            MeasureList ml            = new MeasureList(meStr + mlStr, Entrs.VLE);

            if (!preBuildError)
            {
                if ((bool)UseModelGES.IsChecked)
                {
                    if ((bool)DistriAP_Expostats.IsChecked)
                    {
                        model = new SEGInformedVarModel(measures: ml, specificParams: ModelParams, mcmcParams: MCMCParams, pastDataSummary: PD);
                    }
                    else if ((bool)DistriAP_Uniforme.IsChecked)
                    {
                        UninformativeModelParameters ump = convertParams(ModelParams);
                        model = new SEGUninformativeModel(measures: ml, specificParams: ump, mcmcParams: MCMCParams);
                    }
                }
                else if ((bool)UseModelBW.IsChecked)
                {
                    if ((bool)DistribAPBW_Expostats.IsChecked)
                    {
                        model = new BetweenWorkerModel(ml, BwModelParams, MCMCParams);
                    }
                    else if ((bool)DistribAPBW_Uniform.IsChecked)
                    {
                        BWUModelParams.InitMuOverall   = BwModelParams.InitMuOverall;
                        BWUModelParams.InitSigmaWithin = BwModelParams.InitSigmaWithin;
                        BWUModelParams.MuOverallLower  = BwModelParams.MuOverallLower;
                        BWUModelParams.MuOverallUpper  = BwModelParams.MuOverallUpper;
                        model = new BetweenWorkerModel(ml, BWUModelParams, MCMCParams);
                    }
                }
            }

            return(model);
        }
        // GET: Measure
        public ActionResult MeasureSearch(MeasureDTO measure)
        {
            MeasureBL   bl    = new MeasureBL();
            MeasureList model = new MeasureList();
            DataTable   dt;

            bl.SearchData(measure, out dt);
            model.Measures = CommonMethod.DataTableToList <MeasureDTO>(dt);
            return(View(model));
        }
Example #5
0
        protected virtual void LoadData(IStoryEntityObject target)
        {
            target.Name = Name;
            target.Memo = Memo;

            target.BeginTime = BeginTime;
            target.EndTime   = EndTime;
            ParameterList.ForEach(v => target.ParameterList.Add(v.GetData()));
            NoteList.ForEach(v => target.NoteList.Add(v.Clone() as INote));
            //KeyWordList.ForEach(v => target.KeyWordList.Add(v.ToString()));
            MeasureList.ForEach(v => target.MeasureList.Add(v.Clone() as IMeasure));
        }
        //ObservableCollection<IStructureDiagram> _StructureDiagramList = new ObservableCollection<IStructureDiagram>();
        //public ObservableCollection<IStructureDiagram> StructureDiagramList { get { return _StructureDiagramList; } }

        //public IFateDiagram FateDiagram { get { return TargetObject.TargetFate;  }set { TargetObject.TargetFate = value; OnPropertyChanged("FateDiagram"); } }

        //ObservableCollection <Resource> _ResourceList = new ObservableCollection<Resource>();
        //public ObservableCollection<Resource> ResourceList { get { return _ResourceList; } }

        public override void LoadInfo()
        {
            MeasureList.Clear();
            TargetObject.MeasureList.ForEach(v => MeasureList.Add(v));

            LoadNoteList();


            //StructureDiagramList.Clear();
            //TargetObject.StructureDiagramList.ForEach(v => StructureDiagramList.Add(v));

            RefreshAllProperty();
        }
Example #7
0
        public override Tuple <string, ExposureMetricFunc>[] DefineContent(Dictionary <string, object> customVals)
        {
            MeasureList ml = new MeasureList(measures: new[] { 24.7, 64.1, 13.8, 43.7, 19.9, 133, 32.1, 15, 53.7 },
                                             oel: 100);

            SEGInformedVarModelParameters modelParams = SEGInformedVarModelParameters.GetDefaults(logNormalDstrn: true);

            this.OverwriteDefaults(modelParams, customVals);

            McmcParameters mcmcParams = new McmcParameters();

            this.OverwriteDefaults(mcmcParams, customVals);

            ExposureMetricEstimates emeInformed = new ExposureMetricEstimates(
                new SEGInformedVarModel(
                    measures: ml,
                    specificParams: modelParams,
                    mcmcParams: mcmcParams
                    ));

            UninformativeModelParameters uninfModelParams = UninformativeModelParameters.GetDefaults(logNormalDstrn: true);

            this.OverwriteDefaults(modelParams, customVals);

            ExposureMetricEstimates emeUninformed = new ExposureMetricEstimates(
                new SEGUninformativeModel(
                    measures: ml,
                    specificParams: uninfModelParams,
                    mcmcParams: mcmcParams
                    ));

            ExposureMetricEstimates emePdInformed = new ExposureMetricEstimates(
                new SEGInformedVarModel(
                    measures: ml,
                    specificParams: modelParams,
                    mcmcParams: mcmcParams,
                    pastDataSummary: new PastDataSummary(mean: Math.Log(5), sd: Math.Log(2.4), n: 5)
                    ));

            this.Emes = new ExposureMetricEstimates[] { emeInformed, emeUninformed, emePdInformed };

            return(new Tuple <string, ExposureMetricFunc>[] {
                Tuple.Create("GM (90% CrI)", new ExposureMetricFunc(e => e.GeomMean())),
                Tuple.Create("GSD (90% CrI)", new ExposureMetricFunc(e => e.GeomStanDev())),
                Tuple.Create("Exceedance fraction (%)(90 % CrI)", new ExposureMetricFunc(e => e.ExceedanceFrac())),
                Tuple.Create("95th percentile (90% CrI)", new ExposureMetricFunc(e => e.P95())),
                Tuple.Create("Overexposure risk (%, P95)", new ExposureMetricFunc(e => e.OverExposureRisk())),
                Tuple.Create("AM (90% CrI)", new ExposureMetricFunc(e => e.ArithMean())),
                Tuple.Create("Overexposure risk (%, AM)", new ExposureMetricFunc(e => e.OverExposureRisk(false))),
            });
        }
        public override void SaveInfo()
        {
            TargetObject.MeasureList.Clear();
            MeasureList.ToList().ForEach(v => TargetObject.MeasureList.Add(v));

            SaveNoteList();

            //TargetObject.StructureDiagramList.Clear();
            //StructureDiagramList.ToList().ForEach(v => TargetObject.StructureDiagramList.Add(v));

            IsChanged = false;
            var vm = MainViewModel.mainViewModel;

            if (vm != null)
            {
                vm.RefreshAllView(this);
            }
        }
Example #9
0
        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
        {
            MeasureList ml = new MeasureList(value as string);

            return(new ValidationResult(true, null));
        }