Repository navigation
Repair, overhaul and replace policy with cycles - #373
Merged
Merged
Conversation
Repairable.overhaul_replace_cost_rate() and optimal_overhaul_replace_policy(): minimal repair at failures, an age-reducing overhaul every interval, and a replacement after K periods; exact for an analytic model. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Repairable.overhaul_replace_cost_rate(interval, cycles, overhaul_factor, replacement_cost)andoptimal_overhaul_replace_policy(overhaul_factor, replacement_cost, max_cycles=20)returning anOverhaulReplacePolicy(interval, cycles, cost_rate).In plain words: failures are repaired minimally, every
intervalthe unit is overhauled (costco, keeping a shareoverhaul_factorof its age), and aftercyclesperiods it is replaced (replacement_cost). Exact (no simulation) for an analyticcifmodel: period j starts at the age the overhauls leave, expects L(v+T)-L(v) failures, and the renewal-reward cost rate is (cr * repairs + (K-1) co + cp) / (K T). One period is the existing periodic replacement.Checked against closed forms (constant failure rate, full-renewal overhaul, a hand-worked two-period cycle, the power-law periodic replacement optimum),
optimal_overhaul_policyfor K=1, and a seeded simulation of failure times by inverting the intensity. Simulation-backed models are refused. Docs, changelog and result type added. Not covered: overhaul triggered by a failure count (rather than an interval).🤖 Generated with Claude Code
https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B