Simulated Process

class simfaas.SimProcess.ConstSimProcess(rate)

Bases: simfaas.SimProcess.SimProcess

ConstSimProcess extends the functionality of SimProcess for constant processes, meaning this is a deterministic process and fires exactly every 1/rate seconds. This class does not implement the pdf and cdf functions.

ratefloat

The rate at which the process should fire off

generate_trace()

generate_trace function is supposed to be replaced with the override function of each of the child classes.

NotImplementedError

By default, this function raises NotImplementedError unless overriden by a child class.

class simfaas.SimProcess.ExpSimProcess(rate)

Bases: simfaas.SimProcess.SimProcess

ExpSimProcess extends the functionality of SimProcess for exponentially distributed processes. This class also implements the pdf and cdf functions which can be used for visualization purposes.

ratefloat

The rate at which the process should fire off

cdf(x)

cdf function is called for visualization for classes with self.has_cdf = True.

Parameters

x (float) – The time for which the cdf value (density) should be returned

Raises

NotImplementedError – By default, this function raises NotImplementedError unless overriden by a child class.

generate_trace()

generate_trace function is supposed to be replaced with the override function of each of the child classes.

NotImplementedError

By default, this function raises NotImplementedError unless overriden by a child class.

pdf(x)

pdf function is called for visualization for classes with self.has_pdf = True.

Parameters

x (float) – The time for which the pdf value (density) should be returned

Raises

NotImplementedError – By default, this function raises NotImplementedError unless overriden by a child class.

class simfaas.SimProcess.GaussianSimProcess(rate, std)

Bases: simfaas.SimProcess.SimProcess

GaussianSimProcess extends the functionality of SimProcess for gaussian processes. This class also implements the pdf and cdf functions which can be used for visualization purposes.

ratefloat

The rate at which the process should fire off

stdfloat

The standard deviation of the simulated process

cdf(x)

cdf function is called for visualization for classes with self.has_cdf = True.

Parameters

x (float) – The time for which the cdf value (density) should be returned

Raises

NotImplementedError – By default, this function raises NotImplementedError unless overriden by a child class.

generate_trace()

generate_trace function is supposed to be replaced with the override function of each of the child classes.

NotImplementedError

By default, this function raises NotImplementedError unless overriden by a child class.

pdf(x)

pdf function is called for visualization for classes with self.has_pdf = True.

Parameters

x (float) – The time for which the pdf value (density) should be returned

Raises

NotImplementedError – By default, this function raises NotImplementedError unless overriden by a child class.

class simfaas.SimProcess.SimProcess

Bases: object

SimProcess gives us a single interface to simulate different processes. This will later on be used to simulated different processes and compare them agaist a custom analytical model. In the child class, after performing super().__init__(), properties self.has_pdf and self.has_cdf by default value of False will be created. In case your class has the proposed PDF and CDF functions available, you need to override these values in order for your model PDF to show up in the output plot.

cdf(x)

cdf function is called for visualization for classes with self.has_cdf = True.

Parameters

x (float) – The time for which the cdf value (density) should be returned

Raises

NotImplementedError – By default, this function raises NotImplementedError unless overriden by a child class.

generate_trace()

generate_trace function is supposed to be replaced with the override function of each of the child classes.

NotImplementedError

By default, this function raises NotImplementedError unless overriden by a child class.

pdf(x)

pdf function is called for visualization for classes with self.has_pdf = True.

Parameters

x (float) – The time for which the pdf value (density) should be returned

Raises

NotImplementedError – By default, this function raises NotImplementedError unless overriden by a child class.

visualize(num_traces=10000, num_bins=100)

visualize function visualizes the PDF and CDF of the simulated process by generating traces from your function using generate_trace() and converting the resulting histogram values (event counts) to densities to be comparable with PDF and CDF functions calculated analytically.

num_tracesint, optional

Number of traces we want to generate for calculating the histogram, by default 10000

num_binsint, optional

Number of bins for the histogram which created the density probabilities, by default 100