1classdef Disabled < ContinuousDistribution & DiscreteDistribution
2 % A distribution that
is not configured
4 % Copyright (c) 2012-2026, Imperial College London
8 function self = Disabled()
11 % Constructs a disabled distribution
12 self@ContinuousDistribution(
'Disabled',1,[NaN,NaN]);
13 self@DiscreteDistribution(
'Disabled',1,[NaN,NaN]);
14 setParam(self, 1,
'value', NaN);
16 self.obj = jline.lang.processes.Disabled();
21 function
bool = isContinuous(self)
22 % BOOL = ISCONTINUOUS()
24 % Returns
true is the distribution
is continuous
28 function
bool = isDisabled(self)
31 % Returns
true is the distribution
is disabled
35 function
bool = isDiscrete(self)
38 % Returns
true is the distribution
is discrete
42 function X = sample(self, n)
45 % Get n samples from the distribution
46 if nargin<2 %~exist(
'n',
'var'),
52 function ex = getMean(self)
55 % Get distribution mean
59 function SCV = getSCV(self)
62 % Get distribution squared coefficient of variation (SCV = variance / mean^2)
66 function Ft = evalCDF(self,t)
67 % FT = EVALCDF(SELF,T)
69 % Evaluate the cumulative distribution function at t
75 function p = evalPMF(self, k)
78 % Evaluate the probability mass function at k
86 function singleton = getInstance
87 persistent staticDisabled
88 if isempty(staticDisabled)
89 staticDisabled = Disabled();
91 singleton = staticDisabled;