kinetic_parameters#
Provides kinetic parameters for the simulation.
- class ConstantKineticParameter(distribution: Distribution[T])#
Bases:
Generic[T]A constant kinetic parameter.
- samples#
The kinetic parameters for each run (time series) of the current simulation.
- Type:
Optional[list[~T]]
- distribution#
The distribution for possible values of the kinetic parameter.
Initializes a constant kinetic parameter.
- Parameters:
distribution – The distribution for possible values of the kinetic parameter.
- get_at_timestamp(run: int, t: float) T#
Returns the kinetic parameters at the given timestamp.
- Parameters:
t – The timestamp, at which the kinetic parameters are needed.
run – The run (time series) of the current simulation.
- Returns:
The kinetic parameters at the given timestamp.
- Raises:
RuntimeError – If the the samples have not been prepared. Preparation is done by calling the method prepare_samples.
- prepare_samples(n: int) None#
Prepares a sample of the kinetic parameter.
This method is called before a new simulation starts.
- Parameters:
n – The number of samples to prepare.
- set_for_run(run: int, value: T) None#
Sets the kinetic parameter for the given run.
- Parameters:
run – The run number of the current simulation.
value – The value of the kinetic parameter for the given run.
- Raises:
RuntimeError – If the the samples have not been prepared. Preparation is done by calling the method prepare_samples.
RuntimeError – If the run index is too large.
- class DictBasedKineticParameter(values: dict[float, +T_co])#
Bases:
Generic[T_co]A kinetic parameter which value depends on the timestamp and given by a dict.
Missing value will be interpolated by using the last known value.
- values#
A dictionary mapping the timestamp to the value of the kinetic parameter.
Initializes a dict based kinetic parameter.
- Parameters:
values – A dict mapping the timestamp to the value of the kinetic parameter.
- Raises:
ZeroNotSetError – If no value for the timestamp 0 is provided.
- get_at_timestamp(run: int, t: float) T_co#
Returns the kinetic parameters at the given timestamp.
- Parameters:
t – The timestamp, at which the kinetic parameters are needed.
run – The run (time series) of the current simulation.
- Returns:
The kinetic parameters at the given timestamp.
- prepare_samples(n: int) None#
Prepares a sample of the kinetic parameter.
This method is called before a new simulation starts.
- Parameters:
n – The number of samples to prepare.
- class FunctionBasedKineticParameter(function: Callable[[float], T_co])#
Bases:
Generic[T_co]A kinetic parameter which values are based on a function.
- function#
A function mapping the timestamp to the value of the kinetic parameter.
Initializes a function based kinetic parameter.
- Parameters:
function – A function mapping the timestamp to the value of the kinetic parameter.
- get_at_timestamp(run: int, t: float) T_co#
Returns the kinetic parameters at the given timestamp.
- Parameters:
t – The timestamp, at which the kinetic parameters are needed.
run – The run (time series) of the current simulation.
- Returns:
The kinetic parameters at the given timestamp.
- prepare_samples(n: int) None#
Prepares a sample of the kinetic parameter.
This method is called before a new simulation starts.
- Parameters:
n – The number of samples to prepare.
- class KineticParameter(*args, **kwargs)#
Bases:
Protocol[T_co]A KineticParameter is a parameter, that is used in the simulation.
- get_at_timestamp(run: int, t: float) T_co#
Returns the kinetic parameters at the given timestamp.
- Parameters:
t – The timestamp, at which the kinetic parameters are needed.
run – The run (time series) of the current simulation.
- prepare_samples(n: int) None#
Starts the simulation.
This method is called before a new simulation starts.
- Parameters:
n – The number of samples to prepare.
|
Defines a kinetic parameter, that is constant over time. |
|
Defines a kinetic parameter, that is constant over time. |
|
Defines a kinetic parameter, that is constant over time. |
Defines an abstract class for kinetic parameters. |