| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
package dr.inferencexml.distribution; |
| 27 |
|
| 28 |
import dr.inference.distribution.ExponentialDistributionModel; |
| 29 |
import dr.inference.distribution.ParametricDistributionModel; |
| 30 |
import dr.inference.model.Parameter; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
public class ExponentialDistributionModelParser extends DistributionModelParser { |
| 35 |
|
| 36 |
public String getParserName() { |
| 37 |
return ExponentialDistributionModel.EXPONENTIAL_DISTRIBUTION_MODEL; |
| 38 |
} |
| 39 |
|
| 40 |
ParametricDistributionModel parseDistributionModel(Parameter[] parameters, double offset) { |
| 41 |
return new ExponentialDistributionModel(parameters[0], offset); |
| 42 |
} |
| 43 |
|
| 44 |
public String[] getParameterNames() { |
| 45 |
return new String[]{MEAN}; |
| 46 |
} |
| 47 |
|
| 48 |
public String getParserDescription() { |
| 49 |
return "A model of an exponential distribution."; |
| 50 |
} |
| 51 |
|
| 52 |
public boolean allowOffset() { |
| 53 |
return true; |
| 54 |
} |
| 55 |
|
| 56 |
public Class getReturnType() { |
| 57 |
return ExponentialDistributionModel.class; |
| 58 |
} |
| 59 |
} |