Skip to content

Maintenance from a part's state: option comparison, renewals, delays, layered visits - #374

Merged
derrynknife merged 2 commits into
devfrom
feat/maintenance-windows
Nov 3, 2026
Merged

derrynknife merged 2 commits into
devfrom
feat/maintenance-windows

Conversation

@derrynknife

Copy link
Copy Markdown
Owner

All in model time, exact where possible, on NonRepairable unless stated.

  • compare_replacement_options(age, due_in, every, defer_by=, shuts=, discount_rate=): replace as planned, now, deferred, moved to a shut (own price), or skipped, as present-value costs to the following planned replacement. Extends skip_next_replacement (agrees with it to 1e-9 for a new part).
  • renewal_forecast(window, every, resets=, age=, since_renewal=): a part renewed at every service and at failure: the chance it fails before each service, expected failures, renewals and cost over a window, against running to failure and the best age replacement (the README's seal numbers reproduce).
  • delay_effect, cost_of_waiting_for_visit (rounding a due time up to the next visit of an Opportunity or list of times), cost_of_missed_visit, slack_effect: the risk and cost of a replacement done late.
  • optimal_layered_visits(light, deep, visit_cost=, max_ratio=) and layered_cost_rate: the best visit interval and depth ratio of a cheap-every-visit, deeper-every-k-th package (block replacement; one layer without a visit cost is the optimal block interval).

Validated against closed forms for exponential lives, seeded simulations of each plan (within four standard errors), and an independent renewal-equation discretisation for the layered optimum. README use cases UC-11 and new UC-14..17 recorded; docs, changelog and API pages updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B

… layered visits

Adds NonRepairable.compare_replacement_options, renewal_forecast,
delay_effect, cost_of_waiting_for_visit, cost_of_missed_visit and
slack_effect, and optimal_layered_visits / layered_cost_rate, in model time.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B
…attribute on its own line

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Km2eWBiPJ5JNkme3vRg4B
@derrynknife
derrynknife merged commit d8c855d into dev Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant