AgeReplacementPolicy#

class relife.AgeReplacementPolicy(model, cf, cp, *, discounting_rate=0.0, ar=None, ar1=None, model_args=(), nb_assets=1, a0=None, model1=None, model1_args=())[source]#

Time based replacement policy.

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

Parameters:
modelLifetimeModel

The lifetime model of the assets.

cfnp.ndarray

The cost of failure for each asset.

cpnp.ndarray

The cost of preventive replacements for each asset.

arnp.ndarray, optional

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

ar1np.ndarray, optional

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

discounting_ratefloat, default is 0.

The discounting rate.

model_argsModelArgs, optional

ModelArgs is a tuple of zero or more ndarray required by the underlying lifetime model of the process.

nb_assetsint, optional

Number of assets (default is 1).

a0ndarray, optional

Current ages of the assets (default is None). Setting a0 will add left truncations.

model1LifetimeModel, optional

The lifetime model used for the cycle of replacements. When one adds model1, we assume that model1 is different from model meaning the underlying survival probabilities behave differently for the first cycle

model1_argsModelArgs, optional

ModelArgs is a tuple of zero or more ndarray required by the lifetime model of the first cycle of replacements.

References

[1]

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

Methods

asymptotic_expected_equivalent_annual_cost

The asymptotic expected equivalent annual cost.

asymptotic_expected_total_cost

The asymptotic expected total cost.

expected_equivalent_annual_cost

The expected equivalent annual cost.

expected_number_of_failures

expected_number_of_preventive_replacements

expected_number_of_replacements

expected_total_cost

The expected total cost.

fit

Computes the optimal age of replacement for each asset.

sample

Sample simulation .

Attributes

discounting

reward

asymptotic_expected_equivalent_annual_cost()[source]#

The asymptotic expected equivalent annual cost.

Returns:
ndarray

The asymptotic expected equivalent annual cost.

asymptotic_expected_total_cost()[source]#

The asymptotic expected total cost.

Returns:
ndarray

The asymptotic expected total cost for each asset.

expected_equivalent_annual_cost(timeline)[source]#

The expected equivalent annual cost.

Parameters:
timelinendarray

Timeline of points where the function is evaluated

Returns:
ndarray

The expected equivalent annual cost until each time point

expected_total_cost(timeline)[source]#

The expected total cost.

Parameters:
timelinendarray

Timeline of points where the function is evaluated

Returns:
ndarray

The expected total cost for each asset along the timeline

fit(inplace=False)[source]#

Computes the optimal age of replacement for each asset.

Parameters:
inplacebool, default is False

If True, it sets the optimal age of replacement inplace.

Returns:
AgeReplacementPolicy (inplace is False) object or None (inplace is True)
sample(nb_samples, end_time, seed=None)[source]#

Sample simulation .

Parameters:
nb_samplesint

Number of samples generated

end_timefloat

End of the observation period. It is the upper bound of the cumulative generated lifetimes.

seedint, optional

Sample seed. Usefull to fix random generation and reproduce results

Returns:
RenewalRewardData

Iterable object that encapsulates results with additional functions