AgeReplacementPolicy#

class relife.policy.AgeReplacementPolicy(lifetime_model, cf, cp, discounting_rate=0.0, first_lifetime_model=None, ar=nan, ar1=nan)[source]#

Time based replacement policy.

Renewal reward stochastic_process where assets are replaced at a fixed age \(a_r\) with costs \(c_p\) or upon failure with costs \(c_f\) if earlier [1].

[1]

Mazzuchi, T. A., Van Noortwijk, J. M., & Kallen, M. J. (2007). Maintenance optimization. Encyclopedia of Statistics in Quality and Reliability, 1000-1008.

Attributes:
arnp.ndarray or None

Times until preventive replacements. This parameter can be optimized with optimize

ar1np.ndarray or None

Times until preventive replacements for the first cycle. This parameter can be optimized with optimize

Methods

asymptotic_expected_equivalent_annual_cost

Calculate the asymptotic expected equivalent annual cost.

asymptotic_expected_total_cost

Calculate the asymptotic expected total cost.

expected_equivalent_annual_cost

Calculate the expected equivalent annual cost over a given timeline.

expected_nb_replacements

expected_total_cost

Calculate the expected total cost over a given timeline.

optimize

Computes the optimal age(s) of replacement and updates the internal ar`̀` value(s) and, optionally ``ar1.

sample_count_data

sample_lifetime_data

asymptotic_expected_equivalent_annual_cost()[source]#

Calculate the asymptotic expected equivalent annual cost.

It takes into account discounting_rate attribute value.

The asymptotic expected total cost is:

\[\lim_{t\to\infty} \text{EEAC}(t)\]

where \(\text{EEAC}(t)\) is the expected equivalent annual cost at \(t\). See expected_equivalent_annual_cost() for more details.

Returns:
np.ndarray

The asymptotic expected equivalent annual cost.

Warning

This method requires the ar attribute to be set either at initialization or with the optimize method.

asymptotic_expected_total_cost()[source]#

Calculate the asymptotic expected total cost.

It takes into account discounting_rate attribute value.

The asymptotic expected total cost is:

\[\lim_{t\to\infty} z(t)\]

where \(z(t)\) is the expected total cost at \(t\). See expected_total_cost() for more details.

Returns:
np.ndarray

The asymptotic expected total cost.

Warning

This method requires the ar attribute to be set either at initialization or with the optimize method.

expected_equivalent_annual_cost(tf, nb_steps)[source]#

Calculate the expected equivalent annual cost over a given timeline.

It takes into account discounting_rate attribute value.

The expected equivalent annual cost \(\text{EEAC}(t)\) is given by:

\[\text{EEAC}(t) = \dfrac{\delta z(t)}{1 - e^{-\delta t}}\]

where :

  • \(t\) is the time

  • \(z(t)\) is the expected_total_cost at \(t\). See expected_total_cost() for more details.`.

  • \(\delta\) is the discounting rate.

Parameters:
timeline: np.ndarray

Values of the timeline over which the expected equivalent annual cost is to be calculated.

Returns:
np.ndarray

The expected equivalent annual cost.

Warning

This method requires the ar attribute to be set either at initialization or with the optimize method.

expected_total_cost(tf, nb_steps)[source]#

Calculate the expected total cost over a given timeline.

It takes into account discounting_rate attribute value.

The expected total cost \(z(t)\) is computed by solving the renewal equation and is given by:

\[z(t) = \mathbb{E}(Z_t) = \int_{0}^{\infty}\mathbb{E}(Z_t~|~X_1 = x)dF(x)\]

where :

  • \(t\) is the time

  • \(X_i \sim F\) are \(n\) random variable lifetimes, i.i.d., of cumulative distribution \(F\).

  • \(Z_t\) is the random variable reward at each time \(t\).

  • \(\delta\) is the discounting rate.

Parameters:
timeline: np.ndarray

Values of the timeline over which the expected total cost is to be calculated.

Returns:
np.ndarray

The expected total cost.

Warning

This method requires the ar attribute to be set either at initialization or with the optimize method.

optimize()[source]#

Computes the optimal age(s) of replacement and updates the internal ar`̀` value(s) and, optionally ``ar1.

Returns:
Self

Same instance with optimized ar (optionnaly ar1).