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)); }
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)); }
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)); }