Exemple #1
0
        public override IParameter CreateNewEntity(IContainer parent)
        {
            var parameter = base.CreateNewEntity(parent)
                            .WithParentContainer(parent)
                            .WithDimension(_dimensionFactory.TryGetDimension(_interactionTaskContext.UserSettings.ParameterDefaultDimension))
                            .WithMode(parent.DefaultParameterBuildMode())
                            .WithGroup(Constants.Groups.MOBI);

            parameter.Formula     = _formulaTask.CreateNewFormula <ConstantFormula>(parameter.Dimension);
            parameter.DisplayUnit = _interactionTaskContext.DisplayUnitFor(parameter);
            parameter.Visible     = true;
            return(parameter);
        }
        public override IDistributedParameter CreateNewEntity(IContainer container)
        {
            var parameter = base.CreateNewEntity(container)
                            .WithParentContainer(container)
                            .WithDimension(_dimensionFactory.TryGetDimension(_interactionTaskContext.UserSettings.ParameterDefaultDimension));

            parameter.DisplayUnit = _interactionTaskContext.DisplayUnitFor(parameter);

            var percentile = _parameterFactory.CreateParameter(Constants.Distribution.PERCENTILE, AppConstants.DEFAULT_PERCENTILE, _dimensionFactory.Dimension(AppConstants.DimensionNames.FRACTION));
            var mean       = _parameterFactory.CreateParameter(Constants.Distribution.MEAN, AppConstants.DEFAULT_PARAMETER_START_VALUE, parameter.Dimension);
            var deviation  = _parameterFactory.CreateParameter(Constants.Distribution.DEVIATION, AppConstants.DEFAULT_PARAMETER_START_VALUE, parameter.Dimension);

            parameter.Add(percentile);
            parameter.Add(mean);
            parameter.Add(deviation);

            parameter.Formula = _distributionFormulaFactory.CreateNormalDistributionFormulaFor(parameter, mean, deviation);
            return(parameter);
        }