Ejemplo n.º 1
0
        public ICommand UpdateDistributedTableFormula(IParameter tableParameter, IDistributedParameter distributedParameter)
        {
            var distributedTableFormula = tableParameter.Formula as DistributedTableFormula;

            if (distributedTableFormula == null)
            {
                return(new PKSimEmptyCommand());
            }

            if (distributedParameter.Formula.DistributionType() == DistributionTypes.Discrete)
            {
                if (ValueComparer.AreValuesEqual(distributedParameter.Value, tableParameter.Value, CoreConstants.DOUBLE_RELATIVE_EPSILON))
                {
                    return(new PKSimEmptyCommand());
                }

                return(executeAndUpdatedDefaultStateAndValue(new UpdateDistributedTableFormulaRatioCommand(tableParameter, distributedParameter.Value / tableParameter.Value), tableParameter));
            }

            if (ValueComparer.ArePercentilesEqual(distributedTableFormula.Percentile, distributedParameter.Percentile))
            {
                return(new PKSimEmptyCommand());
            }

            return(executeAndUpdatedDefaultStateAndValue(new UpdateDistributedTableFormulaPercentileCommand(tableParameter, distributedParameter.Percentile), tableParameter));
        }
Ejemplo n.º 2
0
        public ICommand SetParameterPercentile(IParameter parameter, double percentile)
        {
            var distributedParameter = parameter as IDistributedParameter;

            if (distributedParameter == null || ValueComparer.ArePercentilesEqual(distributedParameter.Percentile, percentile))
            {
                return(new PKSimEmptyCommand());
            }

            return(executeAndUpdatedDefaultStateAndValue(new SetParameterPercentileCommand(distributedParameter, percentile), distributedParameter));
        }
Ejemplo n.º 3
0
        public ICommand SetParameterPercentile(IParameter parameter, double percentile)
        {
            var distributedParameter = parameter as IDistributedParameter;

            if (distributedParameter == null || ValueComparer.ArePercentilesEqual(distributedParameter.Percentile, percentile))
            {
                return(new PKSimEmptyCommand());
            }

            return(new SetParameterPercentileCommand(distributedParameter, percentile).Run(_executionContext));
        }