Raptor Studio
v0.11.0Build, validate and simulate reliability block diagrams (RAM analysis) from an AI assistant.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
ping
Health-check: returns 'pong' if the server is running.
list_distributions
List every distribution supported by the RAPTOR engine. Returns structuredContent.distributions: each entry has the integer code used in .rbd/.rbds, a human name, the number of parameters expected, the parameter names in order, valid ranges, and an example mean/stdev computed at unit parameters (the engine exposes numeric stats, not symbolic formulas). Use this before setting fail_dist / repair_dist to supply the right number of parameters in the right order.
list_models
List open models and (optionally) bundled example models. Returns structuredContent.models — rows of {model_id, name, blocks, nodes, last_modified, source} — and structuredContent.examples (names) when include_examples=true. Use this to find model_id values for the other tools. Long workspaces are paged: `limit` (max 200) and `offset`; `total` and `next_offset` describe the rest.
| Parameter | Type | Description |
|---|---|---|
include_examples | boolean | |
limit | integer | Long workspaces are paged: `limit` (max 200) and `offset`; `total` and `next_offset` describe the rest. |
offset | integer | Long workspaces are paged: `limit` (max 200) and `offset`; `total` and `next_offset` describe the rest. |
open_model
Copy a model file into the workspace and return its handle. The original file is never mutated. Accepts a .rbds or .rbd path **relative to the workspace** (or an `--allow-read` directory), or a bundled example name like 'MotorDemo'. Absolute paths are refused, as are paths outside those roots, so the MCP boundary cannot read arbitrary files. Returns {model_id, summary}. Allowed under --read-only (it never changes the source file).
| Parameter | Type | Description |
|---|---|---|
path * | string |
create_model
Create a new model. template: 'blank' (default), 'series' (n blocks in series), 'parallel' (n in parallel), or 'k_of_n' (k-of-n voting of n blocks). Non-blank templates are auto-laid-out on the shared layered grid, so the diagram renders cleanly without a separate `auto_layout` call. Returns {model_id, summary}.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
k | integer | |
n | integer | |
template | string |
save_model_as
Save a model to a file path. The path must be inside the workspace or an --allow-write directory. format: 'rbds' (default) or 'rbd'. If `path` has **no extension** the format's own extension is appended (so `"out"` -> `out.rbds`). An explicit extension must match `format`; a mismatch or a path into the managed models/runs/renders trees is refused. A .rbd export runs validate() first and refuses on ERROR. The layout is saved as it is; `layout_warning` says when an .rbd viewer would draw elements overlapping (call `auto_layout` first to space them out).
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
path * | string | If `path` has **no extension** the format's own extension is appended (so `"out"` -> `out.rbds`). |
format | string | An explicit extension must match `format`; a mismatch or a path into the managed models/runs/renders trees is refused. |
export_awb
Write the model as an Isograph Availability Workbench .awb project. The report names substituted, partially mapped and dropped features. `dry_run=true` writes nothing, not even `normalize_out`. `sidecar=true` also writes a `<name>.awb.raptor.json` beside the file with RAPTOR-only metadata. `normalize_out` writes a reduced RAPTOR model carrying only what the AWB file represents; that reduced copy is what gets exported.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
path * | string | |
dry_run | boolean | |
normalize_out | `dry_run=true` writes nothing, not even `normalize_out`. | |
sidecar | boolean |
import_awb
Open an Isograph Availability Workbench .awb project as a model. The report names the AWB features RAPTOR does not import. A matching `.awb.raptor.json` sidecar, when present and unchanged, restores RAPTOR-only metadata (rates, formulas, triggers, shape annotations, dependencies and costs).
| Parameter | Type | Description |
|---|---|---|
path * | string |
close_model
Close one or more models. Set delete=true to also remove their files. `model_id` accepts a single id or a list, for cleaning up several scratch/sweep models in one call. Each id is closed independently and only the ids you pass are affected -- other open models are never touched, whatever their names. One bad id doesn't abort the rest; the failures are reported alongside the successes. `delete=true` removes that model's own workspace directory (its `model.rbds`, backups and meta) and is **irreversible** -- the undo history goes with it. It does not delete exported files (use `delete_file`)…
| Parameter | Type | Description |
|---|---|---|
model_id * | `model_id` accepts a single id or a list, for cleaning up several scratch/sweep models in one call. | |
delete | boolean |
delete_file
Delete a file previously exported with `save_model_as` (or any other file inside the workspace or an --allow-write directory). Does not touch an open model's own files -- use `close_model(..., delete=true)` for those. Refuses a path outside the workspace/ allow-write directories, same containment `save_model_as` enforces.
| Parameter | Type | Description |
|---|---|---|
path * | string |
build_model
Build a complete model from a friendly .rbds spec document. Give the spec inline as `spec`, or, for a large one, as `spec_path`: a JSON file **relative to the workspace** (or an `--allow-read` directory). Exactly one of the two. To open a finished `.rbds` or `.rbd` file instead, use `open_model`, which takes the same kind of path. Hierarchies in a spec nest at most 8 deep; a deeper spec is refused. `build_model` always creates a NEW model. `model_id` is accepted only to reject it with a clear message: it used to be ignored silently, so a caller that passed one believed it was appending to t…
| Parameter | Type | Description |
|---|---|---|
name * | string | |
auto_layout | boolean | `auto_layout` (default True) places every element on the shared layered grid (Start left -> End right) so the model's diagram renders cleanly; pass False only when the spec carries its own `xPos`/`yPo… |
model_id | `model_id` is accepted only to reject it with a clear message: it used to be ignored silently, so a caller that passed one believed it was appending to that model. | |
spec | Give the spec inline as `spec`, or, for a large one, as `spec_path`: a JSON file **relative to the workspace** (or an `--allow-read` directory). | |
spec_path | Give the spec inline as `spec`, or, for a large one, as `spec_path`: a JSON file **relative to the workspace** (or an `--allow-read` directory). | |
validate_model | boolean |
describe_model
Describe the model structure. detail='summary' gives counts plus a topology sentence; detail='full' lists every element in one response (use get_table for paged input tables). `level` filters to a hierarchy level (0 = whole model).
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
detail | string | |
level | integer | `level` filters to a hierarchy level (0 = whole model). |
add_block
Add a block to the model. `fail_dist`/`repair_dist` take a distribution name ("Weibull") or a code from `list_distributions`. Numeric parameters accept expression strings with a `#` comment for traceability, e.g. "0.00015 * 20000 / 8760 # failure rate". `after` wires the new block after an existing element name/id, which must not already have its one link out. A block takes at most one incoming and one outgoing link (RAPTOR Studio) -- to feed it from/to more than one other element, route through a Node (`add_node` + `connect`; see `connect`). Returns {block_id, name, warnings}.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
name * | string | |
after | `after` wires the new block after an existing element name/id, which must not already have its one link out. | |
fail_dist | `fail_dist`/`repair_dist` take a distribution name ("Weibull") or a code from `list_distributions`. | |
fail_params | ||
parent | integer | |
repair_dist | `fail_dist`/`repair_dist` take a distribution name ("Weibull") or a code from `list_distributions`. | |
repair_params |
add_node
Add a node to the model. type: 'start', 'regular', 'end', 'in' or 'out'. k: K-out-of-N threshold. A node's n comes from its *incoming* links, so set k only after the voting blocks are wired INTO the node. `-1` (the default) is RAPTOR's "K-of-N never set" sentinel and is treated as 1-of-N -- it does **not** mean "all incoming paths required"; use `k = n` for an all-required node. It is stored verbatim as `-1`, so `get_element` reports `k=-1`; the coercion to 1 happens when the model runs.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
k | integer | |
name | string | |
parent | integer | |
type | string |
add_event
Add an event to the model. `prob` is its probability (0-1).
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
name * | string | |
prob | number | `prob` is its probability (0-1). |
connect
Connect two elements with a link. `from_element`/`to_element` are either ["Block", id] / ["Node", id] or a bare element name like "PumpA". `replace=True` removes any link already leaving the source and any link already entering the target first, so a wrong connection is corrected in one call. Without it, RAPTOR Studio's own limit (one link in/out per element) refuses the second connection. RAPTOR Studio's link rules apply, and a link it will not let you draw is refused with its own message, leaving the model unchanged: a block, event or hierarchy takes at most one link in and one out; a Sta…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
from_element | `from_element`/`to_element` are either ["Block", id] / ["Node", id] or a bare element name like "PumpA". | |
replace | boolean | |
to_element | `from_element`/`to_element` are either ["Block", id] / ["Node", id] or a bare element name like "PumpA". |
delete_link
Delete one link by id, leaving both elements in place. This is the safe alternative to deleting an element just to break one connection (which removed every other link on that element too). Find link ids in `describe_model(detail='full')` or `get_table('inputs.links')`.
| Parameter | Type | Description |
|---|---|---|
link_id * | string | |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
move_element
Move a block, node, event or hierarchy to another hierarchy level. `parent=0` moves it back to the top level; otherwise pass a hierarchy id. `update_element` refuses `parent` because it is structural, and the only alternative used to be deleting and recreating the element (losing its links, sparing and PM settings). A hierarchy cannot be moved into itself or one of its own descendants.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
parent * | integer | `update_element` refuses `parent` because it is structural, and the only alternative used to be deleting and recreating the element (losing its links, sparing and PM settings). |
selector * | string | One element: its name, or Kind:id such as Block:3, Node:2, Event:1, Hier:4 or Link:7. |
add_hierarchy
Create an empty hierarchy -- a sub-model boundary -- with its In and Out markers already wired up correctly. This is the fiddly part to do by hand: each marker's own `parent` must be the new hierarchy's id (not the enclosing level) and both markers' `n` must match their real link counts, or the engine crashes on load with an unhelpful KeyError. Building one through `build_model` means declaring `in_id`/`out_id`, the two marker nodes with their `parent` set to the hierarchy's own id, and their link counts -- three non-obvious constraints. The hierarchy starts empty and unwired. Add contents w…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
name * | string | |
parent | integer | This is the fiddly part to do by hand: each marker's own `parent` must be the new hierarchy's id (not the enclosing level) and both markers' `n` must match their real link counts, or the engine crashe… |
collapse_selection
Move existing blocks/nodes/events into a new hierarchy, rewiring the boundary. The API counterpart of the GUI's *Collapse Selection*. `selectors` names the elements (by name, or `Block:N` / `Node:N` / `Event:N`) that should become the new hierarchy's contents. Links wholly inside travel down a level untouched; links that crossed the boundary are rewritten to address the hierarchy, and each is split so the sub-model's own graph stays complete (the outside half keeps its id, an inside half is added off the In/Out marker). An existing hierarchy (by name or `Hier:N`) can be part of the selection…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
selectors * | array | `selectors` names the elements (by name, or `Block:N` / `Node:N` / `Event:N`) that should become the new hierarchy's contents. |
name | ||
parent | integer |
get_element
Read one block, node, event, hierarchy or link back in full. `selector` is an element name or 'Block:N' / 'Node:N' / 'Event:N' / 'Hier:N' / 'Link:N' (links have no name; use their id). This is the read counterpart of `update_element`: every field uses the friendly name `update_element` accepts. A block returns its connections (upstream/downstream), `failure` and `repair` (distribution name, named parameters, mean/stdev), any `logistics_delay` before/after repair, `sparing`, `maintenance`, `dependency` and `phasing`. `dependency` says what the block follows (a block, node, event, hierarchy,…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
selector * | string | `selector` is an element name or 'Block:N' / 'Node:N' / 'Event:N' / 'Hier:N' / 'Link:N' (links have no name; use their id). |
detail | string |
diff_models
Say what is different between two models (their inputs, not their results). This compares *the models themselves*: elements added, removed, renamed or changed (distributions, sparing, maintenance, costs...), connections added or removed, hierarchy moves, k-of-n changes, system settings, rates, spare pools, resources, triggers and phases. It runs nothing. `compare_models` is the other one: it runs models and compares their *results*. `model_a` / `model_b` are workspace model ids (the reference and the one changed); open files with `open_model` first, this tool does not load paths. Elements ar…
| Parameter | Type | Description |
|---|---|---|
model_a * | string | `model_a` / `model_b` are workspace model ids (the reference and the one changed); open files with `open_model` first, this tool does not load paths. |
model_b * | string | `model_a` / `model_b` are workspace model ids (the reference and the one changed); open files with `open_model` first, this tool does not load paths. |
detail | string | |
ignore | `ignore` lists categories to leave out. | |
match | string | Elements are paired by name, then by id (`match`: "auto"; "name" or "id" to use only one; "id" is right for a model against an earlier copy of itself). |
update_element
Update fields on an element. `selector` is an element name, 'Block:N' / 'Node:N' / 'Event:N', a link ('Link:N', which carries capacity: `nom_flow`, `max_flow`, `cap_pri`), or an auxiliary row by name ('Pool:RackSpares', 'Resource:Crew', 'Trigger:Storm', 'Phase:Summer' -- the bare name works too). `patch` accepts any friendly .rbds field (e.g. `fail_params`, `pm_freq`, pool `stock`) or a raw column name, including indexed forms like `repair_params[0]`. `fail_dist`/`repair_dist` take a distribution name ("Weibull") or a code. To make a block dependent on another element use `dep_type` (RBDBlo…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
patch * | object | Field -> value. Friendly names by element kind (the .rbd file's column names and indexed forms such as repair_params[0] also work) -- Block: add_done, amount_exhausted, amt_exhausted, arrive, arrive_e… |
selector * | string | `selector` is an element name, 'Block:N' / 'Node:N' / 'Event:N', a link ('Link:N', which carries capacity: `nom_flow`, `max_flow`, `cap_pri`), or an auxiliary row by name ('Pool:RackSpares', 'Resource… |
full | boolean |
update_elements
Update many elements with one save. Same `selector` and `patch` semantics as `update_element`, but the whole list is applied inside one workspace batch: the model is written once at the end instead of once per element. On a large model this is the difference between seconds and tens of minutes (one `update_element` on a ~10k-element model costs ~10 s). The batch is atomic: if any item is refused, the model is restored to its state before the call and nothing is written. Returns {updated, results: [{selector, id, name, kind, changed}]}.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
updates * | array | List of {"selector": str, "patch": {...}} objects |
connect_many
Create many links with one save. Endpoints are the same as `connect` (a name, or ["Block", id] / ["Node", id] / ["Hier", id]). Applied as one atomic batch; the model is written once. Returns {connected, links: [{link_id, from, to}]}.
| Parameter | Type | Description |
|---|---|---|
links * | array | List of {"from": endpoint, "to": endpoint} objects |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
add_elements
Add many blocks, nodes or events with one save. Each item is `kind` plus the same fields the single add tool takes: - block: `name`, optional `fail_dist`, `fail_params`, `repair_dist`, `repair_params`, `parent`, `after` - node: `name`, `type` (start/regular/end/in/out), `parent`, `k` - event: `name`, `prob`, `parent` Items are created in list order, so a later item may use `after` to wire itself to an earlier one. Atomic: a refused item restores the model. Returns {added, elements: [{kind, id, name}]}.
| Parameter | Type | Description |
|---|---|---|
elements * | array | List of {"kind": "block"|"node"|"event", ...fields} |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
delete_elements
Delete many elements with one save. `reconnect` behaves as for `delete_element`. Applied as one atomic batch; a refused selector restores the model. Returns {deleted: [{selector, kind}], links_removed}.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
selectors * | array | Element names or Kind:id selectors to delete |
reconnect | boolean | `reconnect` behaves as for `delete_element`. |
auto_layout
Re-arrange a model's diagram onto the shared layered grid. Runs the same engine the GUI's Auto Layout button and .rbd save normalization use: longest-path columns from the Start node(s) (left = upstream), rows spread within each column, so no connector runs through a block. Positions are written back to the model file, so a subsequent `render_diagram` reflects them. Scope the pass with one of: - `hierarchy`: a hierarchy name or id — only that level's elements are repositioned; every other level keeps its coordinates. - `selectors`: names / `Kind:id` of the elements to move. Those ele…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
all_levels | boolean | |
direction | string | `direction` is LR/RL/TB/BT; `max_columns` wraps the flow after that many series elements (parallel branches share one position) into a new band instead of waiting for the canvas width. |
hierarchy | Scope the pass with one of: - `hierarchy`: a hierarchy name or id — only that level's elements are repositioned; every other level keeps its coordinates. - `selectors`: names / `Kind:id` of the elem… | |
label_side | string | `label_side` places above/below labels on the left or right when the flow is top-to-bottom (auto = right for TB, left for BT). |
max_columns | `direction` is LR/RL/TB/BT; `max_columns` wraps the flow after that many series elements (parallel branches share one position) into a new band instead of waiting for the canvas width. | |
selectors | Scope the pass with one of: - `hierarchy`: a hierarchy name or id — only that level's elements are repositioned; every other level keeps its coordinates. - `selectors`: names / `Kind:id` of the elem… | |
spacing | number | `spacing` scales every gap (0.25-3; 1 = nominal, lower compacts, higher opens it up). |
delete_element
Delete an element from the model. reconnect=true removes its links and rewires adjacent connections. Returns {removed, links_removed}.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
selector * | string | One element: its name, or Kind:id such as Block:3, Node:2, Event:1, Hier:4 or Link:7. |
reconnect | boolean |
undo_last_edit
Step one edit back (multi-step: call again to go further back). Every edit tool backs up the prior state first (up to 20 deep), so repeated calls walk further back rather than repeating the same restore. Each undo can itself be undone with `redo_last_edit`, until a new edit is made -- which clears the redo history, same as any other editor.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
redo_last_edit
Step one edit forward again after `undo_last_edit` (multi-step). Fails with a clear error once there's nothing left to redo, or once a new edit has cleared the redo history.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
configure_sparing
Configure sparing for a block. mode: 'infinite' (default), 'custom', or 'pool'. `spare_pool` is required for mode='pool' and must name an existing pool (create one with `manage_spare_pools`). stock: initial spare count; restock_every: restock interval (hours); emergency: emergency shipping time (hours); slo: stock level order. With mode='pool' the POOL's stock and restock interval govern; the block's own `stock` only applies to mode='custom'. Returns {applied, warnings}.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
selector * | string | One element: its name, or Kind:id such as Block:3, Node:2, Event:1, Hier:4 or Link:7. |
emergency | ||
level | ||
mode | string | |
quantity | ||
restock_every | ||
slo | ||
slo_time | ||
spare_pool | `spare_pool` is required for mode='pool' and must name an existing pool (create one with `manage_spare_pools`). stock: initial spare count; restock_every: restock interval (hours); emergency: emergenc… | |
stock | With mode='pool' the POOL's stock and restock interval govern; the block's own `stock` only applies to mode='custom'. |
configure_maintenance
Configure preventive maintenance for a block. pm_freq: maintenance interval (hours). pm_duration_dist/pm_params: the PM duration distribution. trigger_name: a trigger element (for triggered PM). defer_flags: bool-valued PM Options, matching the block Properties dialog exactly (unknown keys raise an error): - `spare`: needs a spare on hand to conduct PM. - `refresh`: after PM completes, refresh the block like new. - `mis_defer`: defer PM until a non-mission phase occurs (only meaningful when the model has phases). - `req_defer`: defer PM until a spare or resources are available. - `fail_r…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
selector * | string | One element: its name, or Kind:id such as Block:3, Node:2, Event:1, Hier:4 or Link:7. |
defer_flags | ||
pm_duration_dist | ||
pm_freq | ||
pm_params | ||
trigger_name |
configure_phases
Configure mission phases. phases: [{name, duration_dist, params, mission}]. `mode='replace'` (default) makes `phases` the whole list; `mode='add'` appends them to the phases already there (cells for the new phase are filled with Raptor's default); `mode='remove'` deletes the phases named in `remove` and shifts the rest down. `unassign` names blocks/events/nodes whose phasing is cleared (flag off, per-phase cells dropped) -- previously there was no MCP route for this. `assignments` with no `phases` assigns against the phases already in the model. A refused call changes nothing. assignments…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
assignments | `assignments` with no `phases` assigns against the phases already in the model. | |
mode | string | |
phases | `mode='replace'` (default) makes `phases` the whole list; `mode='add'` appends them to the phases already there (cells for the new phase are filled with Raptor's default); `mode='remove'` deletes the… | |
remove | `mode='replace'` (default) makes `phases` the whole list; `mode='add'` appends them to the phases already there (cells for the new phase are filled with Raptor's default); `mode='remove'` deletes the… | |
unassign | `unassign` names blocks/events/nodes whose phasing is cleared (flag off, per-phase cells dropped) -- previously there was no MCP route for this. |
configure_system
Configure system-level simulation settings. run_length: simulation duration (hours unless `units` says otherwise). termination: 'TimeSim' or 'CycleSim'. display_unit overrides the display unit without changing stored values. capacity=true enables capacity analysis; `flow_generated` sets its demand (the flow the system is asked to deliver). Returns {applied, previous}.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
capacity | ||
cost | ||
display_unit | ||
flow_generated | Configure system-level simulation settings. run_length: simulation duration (hours unless `units` says otherwise). termination: 'TimeSim' or 'CycleSim'. display_unit overrides the display unit without… | |
gy_threshold | ||
num_runs | Replications (trials). Leave out to use the model's own setting. | |
run_length | Simulated time per run, in the model's units. Leave out for the model's own setting. | |
start_stats | ||
system_streams | ||
termination | ||
units | Configure system-level simulation settings. run_length: simulation duration (hours unless `units` says otherwise). termination: 'TimeSim' or 'CycleSim'. display_unit overrides the display unit without… | |
weak_link | ||
yr_threshold |
manage_rates
Manage the model's named Rates library. action: 'list', 'add', 'update' or 'delete'. `expr` is an expression like "0.00015 * 20000 / 8760 # failure rate". Rates can then be referenced in any numeric field as `@RateName * k`, which keeps the derivation in the model's `formulas`. Returns {rates} for 'list', else the affected entry.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
action | string | |
description | ||
expr | `expr` is an expression like "0.00015 * 20000 / 8760 # failure rate". | |
name |
configure_block_defaults
Set the distributions `add_block` uses when you don't name any. This is the MCP equivalent of the GUI's *Block Defaults* button: set your house values once and every block you place picks them up, instead of restating four numbers on every `add_block` call. - `action='list'` — show the current defaults (`{}` means "use each model's own template-row defaults"). - `action='set'` — store the fields you supply; omitted fields are left as they are. `fail_dist`/`repair_dist` are distribution codes from `list_distributions`. - `action='clear'` — forget them and fall back to model defau…
| Parameter | Type | Description |
|---|---|---|
action | string | |
fail_dist | `fail_dist`/`repair_dist` are distribution codes from `list_distributions`. - `action='clear'` — forget them and fall back to model defaults. | |
fail_params | ||
repair_dist | `fail_dist`/`repair_dist` are distribution codes from `list_distributions`. - `action='clear'` — forget them and fall back to model defaults. | |
repair_params |
add_annotation
Add a drawing annotation (text box, rect, ellipse or arrow). Place it **next to an element or another annotation** with `adjacent_to` (a block/node/event/hierarchy name or `Kind:id`, or `Annotation:<id>` / an annotation's label) plus `location` (`right`/`left`/`above`/`below`/`center`, default `above`) and `gap`: it is anchored, so it moves with the target when the target is dragged or `auto_layout` runs. `center` puts the annotation over the target and ignores `gap`. Or place it **by coordinates** with `x`/`y` (+ `w`/`h`): in scene pixels (the default, what the GUI stores) or, with `units="m…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
adjacent_to | Place it **next to an element or another annotation** with `adjacent_to` (a block/node/event/hierarchy name or `Kind:id`, or `Annotation:<id>` / an annotation's label) plus `location` (`right`/`left`/… | |
from_ | An `arrow` connects two things by name: give `from_` and `to` (an element or an `Annotation:<id>`), or the four coordinates `x1`/`y1`/`x2`/`y2`. | |
gap | number | Place it **next to an element or another annotation** with `adjacent_to` (a block/node/event/hierarchy name or `Kind:id`, or `Annotation:<id>` / an annotation's label) plus `location` (`right`/`left`/… |
h | Or place it **by coordinates** with `x`/`y` (+ `w`/`h`): in scene pixels (the default, what the GUI stores) or, with `units="model"`, in the model's own coordinates (the numbers element `x`/`y` use). | |
kind | string | |
location | string | Place it **next to an element or another annotation** with `adjacent_to` (a block/node/event/hierarchy name or `Kind:id`, or `Annotation:<id>` / an annotation's label) plus `location` (`right`/`left`/… |
parent | It inherits the target's hierarchy; set `parent` to draw it inside another level. | |
style | `style` carries the cosmetic fields: `border_colour`, `border_width` (0 = none), `line_style` (`solid`/`dash`/`dot`/`dash-dot`/ `dash-dot-dot`), `fill_colour` (null = transparent), `text_colour`, `fon… | |
text | string | |
to | An `arrow` connects two things by name: give `from_` and `to` (an element or an `Annotation:<id>`), or the four coordinates `x1`/`y1`/`x2`/`y2`. | |
units | string | |
w | Or place it **by coordinates** with `x`/`y` (+ `w`/`h`): in scene pixels (the default, what the GUI stores) or, with `units="model"`, in the model's own coordinates (the numbers element `x`/`y` use). | |
x | Or place it **by coordinates** with `x`/`y` (+ `w`/`h`): in scene pixels (the default, what the GUI stores) or, with `units="model"`, in the model's own coordinates (the numbers element `x`/`y` use). | |
x1 | An `arrow` connects two things by name: give `from_` and `to` (an element or an `Annotation:<id>`), or the four coordinates `x1`/`y1`/`x2`/`y2`. | |
x2 | An `arrow` connects two things by name: give `from_` and `to` (an element or an `Annotation:<id>`), or the four coordinates `x1`/`y1`/`x2`/`y2`. | |
y | Or place it **by coordinates** with `x`/`y` (+ `w`/`h`): in scene pixels (the default, what the GUI stores) or, with `units="model"`, in the model's own coordinates (the numbers element `x`/`y` use). | |
y1 | An `arrow` connects two things by name: give `from_` and `to` (an element or an `Annotation:<id>`), or the four coordinates `x1`/`y1`/`x2`/`y2`. | |
y2 | An `arrow` connects two things by name: give `from_` and `to` (an element or an `Annotation:<id>`), or the four coordinates `x1`/`y1`/`x2`/`y2`. |
list_annotations
List a model's diagram annotations. `parent` filters to one hierarchy level (the `parent` field, 0 = home). Returns {annotations, count}; each annotation gives annotation_id, kind, parent, text, geometry and, for name-anchored ones, its `anchor` (target/location/gap, or from/to for an arrow).
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
parent | `parent` filters to one hierarchy level (the `parent` field, 0 = home). |
update_annotation
Patch one annotation. Accepts any style field, `text`, explicit geometry (`x`/`y`/`w`/`h`/ `x1`/`y1`/`x2`/`y2`, in scene pixels or with `"units": "model"`), or an anchor via `adjacent_to`/`location`/`gap` (text/rect/ellipse) or `from_`/`to` (arrow). Re-anchoring to another annotation uses `adjacent_to="Annotation:<id>"` (or its unique label). Moving an anchored annotation by coordinates removes its anchor, as dragging it in the GUI does; `"anchor": null` removes it and leaves the annotation where it is. Returns {annotation_id, annotation, summary}.
| Parameter | Type | Description |
|---|---|---|
annotation_id * | integer | |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
patch * | object |
delete_annotation
Delete one annotation by id. Returns {deleted: annotation id, kind}.
| Parameter | Type | Description |
|---|---|---|
annotation_id * | integer | |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
search_docs
Search the RAPTOR tutorial docs for passages matching a query. Multi-word queries match passages containing **all** terms (so "capacity analysis system capacity" finds the capacity passages, not nothing). Returns {results}, each {chapter, file, anchor, text, score}. Use `read_doc` to read a whole document.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer | Most items to return in this page. |
read_doc
Read a documentation source as text (paginated). `name` is 'rbds' (the `.rbds` format guide), 'rbds-schema' (its JSON Schema; open_model, build_model and validate_model check files against it), 'dependency' (the dependency tutorial chapter), 'mcp-docs' (the human MCP setup guide), 'mcp-reference' (the generated catalogue of every tool, parameter, return and example), 'mcp-guide' (the tutorial chapter), a tutorial chapter stem like 'ch11-capacity', a chapter title fragment, or a path under `docs/` or `new_docs/`. `offset`/ `limit` page the lines (limit <= 400). Returns {name, file, total_lin…
| Parameter | Type | Description |
|---|---|---|
name * | string | `name` is 'rbds' (the `.rbds` format guide), 'rbds-schema' (its JSON Schema; open_model, build_model and validate_model check files against it), 'dependency' (the dependency tutorial chapter), 'mcp-do… |
limit | integer | `offset`/ `limit` page the lines (limit <= 400). |
offset | integer | `offset`/ `limit` page the lines (limit <= 400). |
workspace_info
Return the server workspace root and read/write rules. Learn where models/runs/renders live and which directories `save_model_as` may write to (the workspace plus any `--allow-write` dirs) and `open_model` may read from (the workspace, examples and any `--allow-read` dirs). Relative save paths resolve against the workspace root.
duplicate_elements
Copy blocks, nodes, events or hierarchies with fresh ids and names. `elements` are names or ids (optionally kind-prefixed). Internal links are remapped to the copies, dependencies on copied elements follow them, and block and hierarchy names get the next free suffix. One save. `created` lists each new element as {kind, id, name, selector}.
| Parameter | Type | Description |
|---|---|---|
elements * | array | `elements` are names or ids (optionally kind-prefixed). |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
copies | integer |
copy_element_data
Copy one block's data groups onto other blocks. Groups: Failure, Repair, Logistics delays, Spares, PM, Costs (default Failure and Repair). Name, position, links, id and dependency are never changed.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
source * | string | |
targets * | array | |
groups |
set_out_of_service
Take elements out of service for a what-if, without changing their data. A hierarchy covers everything inside it. Every later simulation, study and analytical result uses the state until it is put back; the model's own numbers are untouched. Saved in .rbds only (a .rbd file has no place for it). describe_model lists what is out of service. Returns {changed: [{kind, id, name, state}], out_of_service: [...]}.
| Parameter | Type | Description |
|---|---|---|
elements * | array | Block, event or hierarchy names or Kind:id selectors |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
state * | string | cut: down for the whole run (its path is broken); linked: never fails (as good as a wire); in_service: back to normal |
manage_spare_pools
Create, list, edit or delete a spare pool. action='list' returns every pool. `action='add'` needs `name`; `action='update'` patches only the fields you pass; `action='delete'` refuses while a block still has Pooled sparing that names the pool. These are the pools `configure_sparing(mode="pool")` draws from, with the stock and lead-time quantities spares planning needs. Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `level`, `quantity`, `slo_ti…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
action | string | |
arrive_every | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
emer_ship_cost | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
emer_time | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
eso | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
level | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
name | `action='add'` needs `name`; `action='update'` patches only the fields you pass; `action='delete'` refuses while a block still has Pooled sparing that names the pool. | |
new_spares | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
quantity | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
rso | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
slo | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
slo_time | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
spare_cost | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… | |
stock | Field names match the `inputs.spare_pools` table and the .rbds `spare_pools` entries: `stock`, `new_spares`, `arrive_every` (restock interval, h), `eso`, `emer_time` (emergency shipping, h), `slo`, `l… |
manage_resources
Create, list, edit or delete a resource pool (shared crew/equipment). Resources are what a block's `resource_name` points at and what `configure_sparing(mode="resource")` consumes. `action='delete'` refuses while a block still names the resource. Fields match the `inputs.resources` table: `num_in`, `spare_cost`, `fixed_per_use`, `per_time_unit`, `phases`.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
action | string | |
fixed_per_use | Fields match the `inputs.resources` table: `num_in`, `spare_cost`, `fixed_per_use`, `per_time_unit`, `phases`. | |
name | ||
num_in | Fields match the `inputs.resources` table: `num_in`, `spare_cost`, `fixed_per_use`, `per_time_unit`, `phases`. | |
per_time_unit | Fields match the `inputs.resources` table: `num_in`, `spare_cost`, `fixed_per_use`, `per_time_unit`, `phases`. | |
phases | Fields match the `inputs.resources` table: `num_in`, `spare_cost`, `fixed_per_use`, `per_time_unit`, `phases`. | |
spare_cost | Fields match the `inputs.resources` table: `num_in`, `spare_cost`, `fixed_per_use`, `per_time_unit`, `phases`. |
manage_triggers
Create, list, edit or delete a trigger (for triggered PM). `dist` takes a name ("Normal") or a code; `params` its parameters. A block's PM can only name a trigger that exists, so add it here first. Deleting is refused while a block's PM still names it.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
action | string | |
dist | `dist` takes a name ("Normal") or a code; `params` its parameters. | |
init_used | ||
name | ||
params | Up to three distribution parameters | |
repeats |
validate_model
Validate a model for structural and parameter errors. Returns {errors, warnings, groups, runnable}. `groups` collapses the same rule firing on many elements into one row (rule, count, example elements), which is what makes a 700-error model readable; `errors` and `warnings` keep the verbatim per-element list. Always call this before a run.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
estimate_runtime
Estimate wall-clock time for a simulation before running it. Times a real pilot and extrapolates. `workers` is taken into account with a contention-aware speed-up: parallel replications on a large model scale at roughly ``w / (1 + 0.25 (w - 1))``, not ``w`` (8 workers measured 2.8x on an 8-core box). Models of 1,500+ elements are piloted at an 8,760 h horizon and the fit scaled, so the call always returns. `importance` overrides the model experiment's importance setting for the estimate. When importance is on, `seconds_estimate` is the TOTAL time until the whole operation finishes: the bas…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
importance | `importance` overrides the model experiment's importance setting for the estimate. | |
num_runs | integer | Replications (trials); 10 when left out. |
run_length | Simulated time per run, in the model's units. Leave out for the model's own setting. | |
workers | `workers` is taken into account with a contention-aware speed-up: parallel replications on a large model scale at roughly ``w / (1 + 0.25 (w - 1))``, not ``w`` (8 workers measured 2.8x on an 8-core bo… |
simulate
Run a simulation and return structured results. `attribution=True` also works out which element caused each system outage and why (repair, waiting for a spare, waiting for a crew, logistics, maintenance); read it with `downtime_drivers(run_id)` and `advise(model_id, run_id)`. The results themselves are unchanged. It keeps the event log in memory for the batch, so leave it off for very large runs. Not available with `hierarchy`. `capacity_rule` (with attribution on a capacity-analysis model) shares the lost flow among the elements that were down: `proportional` sums to the engine's own lost f…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
attribution | boolean | Also work out which element caused each system outage and why; read it with downtime_drivers and advise. |
availability_plot | `availability_plot` / `interim_cost`: record the availability-over-time plot (needed by `get_timeseries(series="availability")`) or the interim cost report for this run. | |
block_streams | `block_streams`: `separate` gives every block that shares a random stream (by default all of them share one, as in Raptor 7) a failure and repair stream of its own for this run only -- the model is no… | |
capacity_rule | string | `capacity_rule` (with attribution on a capacity-analysis model) shares the lost flow among the elements that were down: `proportional` sums to the engine's own lost flow, `marginal` answers "what woul… |
collect_events | boolean | Keep the event log of every run (larger output; needed for event-level analysis). |
confirm_long_run | boolean | True runs even when the estimate exceeds timeout_s. |
date | ||
hierarchy | Not available with `hierarchy`. | |
importance | ||
interim_cost | `availability_plot` / `interim_cost`: record the availability-over-time plot (needed by `get_timeseries(series="availability")`) or the interim cost report for this run. | |
num_runs | Replications (trials). Leave out to use the model's own setting. | |
precision | `precision` runs in growing batches until the watched metric is precise enough, instead of a fixed count: `{relative: 0.1, metric: "system.ao", on: "auto" | "unavailability" | "value", confidence: 0.9… | |
run_length | Simulated time per run, in the model's units. Leave out for the model's own setting. | |
seed | `streams` says which the numbers are ("sequential" or "parallel", the same for any worker count above one) and `seed` the salt used: the two together reproduce a result on any surface (the desktop app… | |
timeout_s | number | The run is estimated first and refused with a clear message if the estimate exceeds `timeout_s`, unless `confirm_long_run=true`. |
treatments | `treatments` is `{deps: up|system| refuse, pools: full|share|refuse, streams: keep|separate, items: {...}}`; call `extract_hierarchy` with `report_only` first to see the hazards. | |
workers | Leave `workers` out and a large model (500+ blocks, events and nodes) run 20+ times uses several cores (half the machine's, at most 8); the result reports the `workers` used and `workers_auto`. |
start_run
Start a simulation in the background and return a job id immediately. `attribution=True` also records what caused the downtime, as in `simulate`; read it with `downtime_drivers` once the job is done. `capacity_rule` chooses how the lost flow is shared, as in `simulate`. Same arguments as `simulate`, minus the hierarchy/isolation and importance options. Use this for batches that outlive one tool call (a 100-replication, 20-year run is tens of minutes): the engine runs on a daemon thread, `run_status` reports progress, `cancel_run` stops it between replications, and the completed run is an ord…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
attribution | boolean | Also work out which element caused each system outage and why; read it with downtime_drivers and advise. |
availability_plot | Record the availability-over-time plot for this run. Leave out for the model's setting. | |
block_streams | separate: each block that shares a random stream gets its own for this run (the model is not edited); model: the blocks' own. Leave out for the model's setting. | |
capacity_rule | string | `capacity_rule` chooses how the lost flow is shared, as in `simulate`. |
collect_events | boolean | Keep the event log of every run (larger output; needed for event-level analysis). |
interim_cost | Record the interim cost report for this run. Leave out for the model's setting. | |
num_runs | Replications (trials). Leave out to use the model's own setting. | |
run_length | Simulated time per run, in the model's units. Leave out for the model's own setting. | |
seed | Non-negative seed that re-rolls the batch reproducibly. | |
timeout_s | number | Wall-clock limit for the call, in seconds. |
workers | `workers` defaults as it does for `simulate`: a large model run 20+ times uses several cores unless you pass `workers=1`. |
run_status
Progress of a job started with `start_run`. Returns {job_id, model_id, state, phase, setup, completed_runs, requested_runs, percent, elapsed_s, eta_s, wall_seconds, run_id, summary, error}. `eta_s` is the seconds left at the rate since the first replication finished: an estimate (runs vary), null until two counts are known. `state` is queued, running, done, cancelled or failed. `phase` adds what a running job is doing: `setting_up` while a large model is prepared (`setup` then has `{stage, done, total, percent}`; it can take minutes before the first replication, and `completed_runs` stays 0),…
| Parameter | Type | Description |
|---|---|---|
job_id * | string | Id of a background job, from start_run. |
cancel_run
Ask a background job to stop (checked between replications, and while a large model is still being set up). The replications already completed are kept and become a run, exactly as when `simulate` is cut short: the result is marked truncated. Returns the job snapshot; poll `run_status` until `state` is `cancelled`.
| Parameter | Type | Description |
|---|---|---|
job_id * | string | Id of a background job, from start_run. |
get_run_results
One completed run as a single assessable bundle. Reads what the run wrote: the metric means and per-replication figures, the capacity summary, and the weakest elements (`weak_link`). Use it to judge a run without paging through `get_report`, and `get_table` / `export_tables` (with the same `run_id`) when you need a whole table or a workbook. `top` caps the weak-link list (1..100). `per_run` carries each replication's system figures; `per_run_detail=True` adds the nested per-element data, which on a large model is megabytes (use `get_table` with `results.per_run` to page it instead).
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Use it to judge a run without paging through `get_report`, and `get_table` / `export_tables` (with the same `run_id`) when you need a whole table or a workbook. |
per_run_detail | boolean | |
top | integer | `top` caps the weak-link list (1..100). |
get_report
Get a paginated report section from a completed run. section: 'final_results', 'end_of_run', 'events', 'capacity', 'cost', 'weak_link', 'importance' (only when the run asked for it) or 'availability_plot'. `run_number` selects one replication where the section is per-run. format: 'markdown' (default) or 'raw'. Returns {lines, total, next_offset, markdown}; `lines` never exceeds `limit` (≤200).
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Id of a finished run in the workspace, from simulate, start_run/run_status or get_run_results. |
format | string | |
limit | integer | Returns {lines, total, next_offset, markdown}; `lines` never exceeds `limit` (≤200). |
offset | integer | Items to skip: pass the previous page's next_offset to continue. |
run_number | `run_number` selects one replication where the section is per-run. format: 'markdown' (default) or 'raw'. | |
section | string |
single_point_failures
Find single-point failures in the model. A single point failure is an element whose failure alone takes the system down, found as Raptor does (by failing each element in Failure Effects View, so dependencies and cold standby count). Returns {spofs, count, total, offset, next_offset, elapsed_seconds, cached}; each spof is {kind, id, name, crit} plus `phase` for a phased model. `limit` pages the response (default 100, use 0 for all); the full row set is still computed and cached by model content, so later pages and repeated calls are instant. `workers > 1` parallelises the candidate tests on a…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
limit | integer | `limit` pages the response (default 100, use 0 for all); the full row set is still computed and cached by model content, so later pages and repeated calls are instant. |
offset | integer | Items to skip: pass the previous page's next_offset to continue. |
workers | integer | Worker processes. Leave out for the server default (several cores for a large model); 1 gives the sequential numbers. |
failure_effects
Run failure-effects analysis (Raptor workbook Chapter 10). Fails and/or repairs the listed blocks or events and reports the resulting system status and the Failure Effects text (failed, induced, idle and PM components, down and degraded nodes). A phased model starts in phase 1; `phase` moves it to another phase first. Returns {system_status, affected, log, effects, criticality, phase}, plus, for a model with capacity analysis, `capacity`: {flow_generated, delivered, lost, delivered_fraction, system_capacity, nodes: [{id, name, flow, capacity}]} -- the flow the state delivers, as capacity anal…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
fail | To test several simultaneous failures, name them all in one `fail` list; a `repair` can only undo a failure named in the same call. | |
phase | A phased model starts in phase 1; `phase` moves it to another phase first. | |
repair | To test several simultaneous failures, name them all in one `fail` list; a `repair` can only undo a failure named in the same call. |
failure_effects_batch
Run many failure-effects scenarios in one call, on one model set-up. `scenarios` is a list of `{"fail": [...], "repair": [...], "phase": N}` (every key optional), up to 2000. Each scenario is independent and starts from the all-good state, exactly as a separate `failure_effects` call would; the model is only set up once, so hundreds of combinations on a large model take seconds, not one set-up each. Returns {model_id, count, failed, scenarios}. `scenarios[i]` has the scenario's `index`, `fail` and `repair`, then either its result ({system_status, affected, effects, criticality, phase}, `capa…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
scenarios * | array | `scenarios` is a list of `{"fail": [...], "repair": [...], "phase": N}` (every key optional), up to 2000. |
include_log | boolean | `scenarios[i]` has the scenario's `index`, `fail` and `repair`, then either its result ({system_status, affected, effects, criticality, phase}, `capacity` for a model with capacity analysis, plus the… |
compare_models
Compare 2–5 models or runs side by side. Returns per-metric values (`metrics`, in `models`/`labels` order), deltas against the first entry, and which entry is best per metric, plus a Markdown comparison table. `labels` gives each entry's model name (a run's cached `model_name`), parallel to `models` -- `deltas` keys and `best` values use the label, not the raw id, unless two entries share a name, in which case that label gets its id appended to stay unique.
| Parameter | Type | Description |
|---|---|---|
models * | array | Returns per-metric values (`metrics`, in `models`/`labels` order), deltas against the first entry, and which entry is best per metric, plus a Markdown comparison table. |
metrics | Returns per-metric values (`metrics`, in `models`/`labels` order), deltas against the first entry, and which entry is best per metric, plus a Markdown comparison table. | |
num_runs | integer | Replications (trials); 5 when left out. |
sweep_parameter
Sweep a parameter across values and measure the impact. Works on copies — the original model is untouched. `field` may be a friendly field or an indexed form like `repair_params[0]`. Each row carries the `run_id` and the `runs` count that produced it. Returns {rows, monotonic, all_rows_identical, warnings} plus a Markdown table; `all_rows_identical` is true when every row's metrics are bit-identical (which cannot be told apart from "the value was never applied"), and `warnings` says so. `monotonic` looks at the first swept metric and treats a flat or single-row series as monotonic; `all…
| Parameter | Type | Description |
|---|---|---|
field * | string | `field` may be a friendly field or an indexed form like `repair_params[0]`. |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
selector * | string | One element: its name, or Kind:id such as Block:3, Node:2, Event:1, Hier:4 or Link:7. |
values * | array | |
metrics | ||
num_runs | integer | Replications (trials); 5 when left out. |
get_timeseries
Get time-series data from a completed run, for the client to plot. series: 'availability', 'capacity' or 'cost'. runs: 'mean' (default), 'all', or a specific run number. points: max samples after decimation (default 100). Returns {t, values, runs_included, decimated_from, envelope?} plus a short Markdown preview. No image is ever returned. For 'capacity', `values` is the flow and `capacity` the system capacity, null where nothing limits the flow (Raptor's 999,999,999), with `capacity_note`.
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Id of a finished run in the workspace, from simulate, start_run/run_status or get_run_results. |
points | integer | |
runs | string | |
series | string |
extract_hierarchy
Build a standalone model from one hierarchy (a port extension), or just list what crosses its boundary. The hierarchy's In node becomes Start and its Out node End, so its input is always available. Hazards at the boundary -- elements following something outside, spare and resource pools shared with outside blocks, random streams shared with outside elements -- each get a documented treatment; see `simulate`'s `treatments`. With `report_only` nothing is created and the hazards (with the treatment each would get) are returned. Otherwise the extract is registered as a new model: returns {model_i…
| Parameter | Type | Description |
|---|---|---|
hierarchy * | ||
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
name | ||
report_only | boolean | With `report_only` nothing is created and the hazards (with the treatment each would get) are returned. |
treatments | Hazards at the boundary -- elements following something outside, spare and resource pools shared with outside blocks, random streams shared with outside elements -- each get a documented treatment; se… |
what_if
Compare a changed model with Base using paired trials. `changes` are PATH=VALUE edits (the grammar of `raptor set`), e.g. `["block:Pump.repair_params=8,0,0"]`. Base and the scenario run with the same seed, so trial *i* is paired; the result reports each metric's scenario value, the paired difference with its standard error, the chance the scenario is better, and how much variance pairing cut (often little: the random streams run on between trials, so trials stay in step only until the change first moves an event; the standard error is from the paired differences, so it is honest either way).…
| Parameter | Type | Description |
|---|---|---|
changes * | array | `changes` are PATH=VALUE edits (the grammar of `raptor set`), e.g. `["block:Pump.repair_params=8,0,0"]`. |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
name | string | |
precision | `trials` sets the fixed count; `precision` (`{relative: 0.1, min_trials: 50, max_trials: 20000}`) sizes Base first with run-to-precision. | |
requirements | `requirements` are `{metric, op, value, label}` rows judged for Base and the scenario. | |
seed | Non-negative seed that re-rolls the batch reproducibly. | |
timeout_s | number | Wall-clock limit for the call, in seconds. |
trials | `trials` sets the fixed count; `precision` (`{relative: 0.1, min_trials: 50, max_trials: 20000}`) sizes Base first with run-to-precision. | |
workers | Worker processes. Leave out for the server default (several cores for a large model); 1 gives the sequential numbers. |
recommend_changes
Propose and test one change for each top downtime driver. Finds the `top` blocks causing the most system downtime (from `run_id`, a stored run made with `attribution=True`, or else from a Base run with attribution made first), proposes a fixed-step lever from the cause that dominates each one's outages (halve the repair time or the logistics delays, one more spare, one more crew, maintenance half as often, a part that lasts twice as long), and tests every change against Base with paired trials. Each row gives the PATH=VALUE change (apply it with `update_element`/`manage_spare_pools`/`manage_r…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
min_gain | Each row gives the PATH=VALUE change (apply it with `update_element`/`manage_spare_pools`/`manage_resources`, or `raptor set`), the paired availability gain with its standard error and chance of being… | |
run_id | Finds the `top` blocks causing the most system downtime (from `run_id`, a stored run made with `attribution=True`, or else from a Base run with attribution made first), proposes a fixed-step lever fro… | |
seed | Non-negative seed that re-rolls the batch reproducibly. | |
timeout_s | number | Wall-clock limit for the call, in seconds. |
top | integer | Finds the `top` blocks causing the most system downtime (from `run_id`, a stored run made with `attribution=True`, or else from a Base run with attribution made first), proposes a fixed-step lever fro… |
trials | Paired trials per scenario. Leave out for the tool's default. | |
workers | Worker processes. Leave out for the server default (several cores for a large model); 1 gives the sequential numbers. |
sensitivity
One-at-a-time tornado: which inputs the answer is most sensitive to. Builds up to `top` candidate inputs from the model (block life and repair means, PM intervals, finite spare stock, crew counts), varies each at a low and a high value, and runs every variant with Base's seed. The result gives each input's paired effect at both ends with its standard error, the swing, a base-point elasticity where the input is continuous, and whether the swing is distinguishable from no effect at this run count. This is a screening view: it shows each input alone and cannot show interactions.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
metric | string | |
seed | Non-negative seed that re-rolls the batch reproducibly. | |
timeout_s | number | Wall-clock limit for the call, in seconds. |
top | integer | Builds up to `top` candidate inputs from the model (block life and repair means, PM intervals, finite spare stock, crew counts), varies each at a low and a high value, and runs every variant with Base… |
trials | Paired trials per scenario. Leave out for the tool's default. | |
workers | Worker processes. Leave out for the server default (several cores for a large model); 1 gives the sequential numbers. |
describe_metrics
List the result metrics, and optionally show one run's values. Without `run_id`, returns the name and units of every metric RAPTOR reports: availability, reliability, conditional reliability, dependability, MTBDE/MDT, MTBM/MTBMs/MTBMu, MMT/MMTs/MMTu, system and component failures, and green/yellow/red percentages, plus, for a run with capacity analysis, units produced, mean flow and capacity, capacity-weighted availability (mean flow / flow generated) and lost flow, plus, for a run with cost analysis, grand total, system down cost and system lost-flow cost. **Definitions and equations are not…
| Parameter | Type | Description |
|---|---|---|
model_id | `model_id` is optional and only checks that the run belongs to that model. | |
run_id | Without `run_id`, returns the name and units of every metric RAPTOR reports: availability, reliability, conditional reliability, dependability, MTBDE/MDT, MTBM/MTBMs/MTBMu, MMT/MMTs/MMTu, system and c… |
advise
Say what looks wrong or unwise in a model, most important first. Checks things a reliability engineer would question: a backup that depends on the unit it backs up, parallel paths that are all required, placeholder data, repair longer than life, spares or crews that cannot meet demand, maintenance that cannot pay off, too few runs. Nothing is run or changed. With `run_id` (a finished run of this model) it adds what the run says: how precisely downtime is known and how many runs would fix it, too few system failures, and, for a run made with `attribution=True`, which elements cause the downti…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
limit | integer | Most items to return in this page. |
min_severity | string | |
only | `only` limits the rules by id or prefix (`["M-SPR", "M-PM-003"]`). | |
run_id | With `run_id` (a finished run of this model) it adds what the run says: how precisely downtime is known and how many runs would fix it, too few system failures, and, for a run made with `attribution=T… | |
targets | `targets` judges the run against requirements, e.g. `[{"metric": "system.ao", "op": ">=", "value": 0.995}]`: each is met, missed or too close to call. |
list_advisor_rules
Every Advisor rule: id, title, category, level, method and phase. `phase` is `model` (needs only the model) or `run` (needs a finished run). `basis` is `exact`, `statistical` or `heuristic`.
apply_fix
Apply the fix one Advisor finding suggests, as one undoable edit. `rule` is the finding's rule id; `target` picks one finding when several share the rule, by the name or path of its first target (`"Pump_A"` or `"block:12"`). Only fixes that change fields can be applied here; a fix that opens a tool in the application has no `assignments` and is refused with a message saying so. Undo with `undo_last_edit`. Returns {applied: [PATH=VALUE...], label, remaining: findings of that rule still present}.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
rule * | string | `rule` is the finding's rule id; `target` picks one finding when several share the rule, by the name or path of its first target (`"Pump_A"` or `"block:12"`). |
fix_index | integer | |
target | `rule` is the finding's rule id; `target` picks one finding when several share the rule, by the name or path of its first target (`"Pump_A"` or `"block:12"`). |
ignore_finding
Dismiss an Advisor finding in this model, or bring it back. For when the model's owner knows better: a backup that depends on the unit it backs up may be deliberate. The rule, its target and the `reason` are saved in the model, so `advise` (and the application) stop showing it for everyone who opens the file and list it under `ignored`. `target` is the finding's first target path without a field (`"block:3"`, `"pool:Motors"`, from `advise`'s `targets[0].path`), or omit it to ignore every finding of `rule` in this model. Give a reason: it is what a reviewer reads. `restore=True` removes the en…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
rule * | string | `target` is the finding's first target path without a field (`"block:3"`, `"pool:Motors"`, from `advise`'s `targets[0].path`), or omit it to ignore every finding of `rule` in this model. |
reason | string | The rule, its target and the `reason` are saved in the model, so `advise` (and the application) stop showing it for everyone who opens the file and list it under `ignored`. |
restore | boolean | |
target | `target` is the finding's first target path without a field (`"block:3"`, `"pool:Motors"`, from `advise`'s `targets[0].path`), or omit it to ignore every finding of `rule` in this model. |
downtime_drivers
What causes the system's downtime in a finished run. Needs a run made with `attribution=True` (`simulate` or `start_run`). Every system outage is charged to the element that started it and split by cause: hands-on repair, waiting for a spare, waiting for people or equipment, logistics delay, planned maintenance, held by another element. Per element: `dtci` (share of system downtime), `deci` (share of outages started), `fci` (share of failure-started outages), each {mean, sem, n}; `causes` (shares of its outages' time) and `main_cause`. Also `causes` for the whole system, `outage_durations` (…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Id of a finished run in the workspace, from simulate, start_run/run_status or get_run_results. |
detail | string | `detail` is `summary` by default: each statistic is {mean, sem, n}, numbers have six significant figures, and `sequences` and the capacity `elements` stop at `top` like the elements do. |
top | integer | `detail` is `summary` by default: each statistic is {mean, sem, n}, numbers have six significant figures, and `sequences` and the capacity `elements` stop at `top` like the elements do. |
annual_availability
Availability period by period, with percentiles: what a bad year looks like. Needs a run made with `attribution=True`. Each run's system outages (exact start and end times) are cut on period boundaries, giving one availability per (run, period). `year_length` is in the model's time unit and defaults to 8,760 when that unit is hours; `offset` moves the first boundary; `below` (e.g. 0.97) adds the share of periods under that availability with a 95 % interval. The last, incomplete period of each run is left out and counted in `dropped_partial_periods`. Returns `pooled` (n, mean, sd, min, max, p…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Id of a finished run in the workspace, from simulate, start_run/run_status or get_run_results. |
below | `year_length` is in the model's time unit and defaults to 8,760 when that unit is hours; `offset` moves the first boundary; `below` (e.g. 0.97) adds the share of periods under that availability with a… | |
include_runs | boolean | |
offset | number | `year_length` is in the model's time unit and defaults to 8,760 when that unit is hours; `offset` moves the first boundary; `below` (e.g. 0.97) adds the share of periods under that availability with a… |
year_length | `year_length` is in the model's time unit and defaults to 8,760 when that unit is hours; `offset` moves the first boundary; `below` (e.g. 0.97) adds the share of periods under that availability with a… |
run_story
The Story of a finished run: answer first, evidence second. One object the application, command line and report all render: the headline against its target (or capacity/mission reliability/availability when no target is set), the quantile dot plot of the per-run values and the share of runs that met the target, the top three drivers (by lost capacity when capacity analysis is on), the top run findings, up to six key numbers, sections only for features the model uses, and provenance. `targets` gives the headline its target, as `advise` takes them, e.g. `[{"metric": "system.ao", "op": ">=", "v…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Id of a finished run in the workspace, from simulate, start_run/run_status or get_run_results. |
targets | `targets` gives the headline its target, as `advise` takes them, e.g. `[{"metric": "system.ao", "op": ">=", "value": 0.995}]` (the first is the headline; `<=` suits time down per outage). |
run_chart
One chart of a finished run, as data and optionally as SVG. `chart` is the chart's name: one of those listed below. The text gives the caption and the numbers the chart draws (the leading rows, or each layer's end value over time). `render_svg=True` adds the figure as `svg`; it is off by default because the SVG is most of the answer's size. The same `ChartSpec` the application paints and `raptor explain --chart` prints: title, subtitle, axis labels, series, marks, a one-sentence caption and provenance. Names: `trial-outcome` and `ecdf` (the runs), `convergence` (has the run settled), `avail…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Id of a finished run in the workspace, from simulate, start_run/run_status or get_run_results. |
chart | string | `chart` is the chart's name: one of those listed below. |
min_share | number | For a report or slide: `page` sizes the SVG (`screen` 760 x 400, `slide` 16:9, `a4` or `a3` landscape; the bigger pages give long names more room and declare their size in mm) and `min_share` (0 to 1,… |
page | string | For a report or slide: `page` sizes the SVG (`screen` 760 x 400, `slide` 16:9, `a4` or `a3` landscape; the bigger pages give long names more room and declare their size in mm) and `min_share` (0 to 1,… |
render_svg | boolean | |
run | integer | `run` picks the run a one-run chart shows (1 is the first). |
target | `target` (0 to 1, e.g. 0.995) draws a dashed target line on the outcome, chance, convergence and availability-over-time charts, as the window's Target button does. | |
y_floor | `y_floor` (0 to 1) fixes the bottom of an availability axis; leave it out to fit the axis to the data. |
analytical_analysis
Solve the static subset of a model exactly. **Reliability mode** is non-repairable: `R(t)`, density, hazard, MTTF, BX life, conditional reliability and exact importance. **Availability mode** is steady state for independent components with perfect repair: `A_i = MTTF_i / (MTTF_i + MTTR_i)` and exact availability importance. The solver supports series, parallel, mixed, k-of-n, bridge networks and hierarchies. `hierarchy` analyses one hierarchy on its own: its In node is treated as Start and its Out node as End, so its input is assumed always available. It refuses PM, spares, resources and non…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
at | `at` defaults to the model's time-terminated run length. | |
bx | ||
dependencies | Without `dependencies`, a model with dependencies is refused. | |
equation | boolean | |
hierarchy | `hierarchy` analyses one hierarchy on its own: its In node is treated as Start and its Out node as End, so its input is assumed always available. | |
ignore | ||
ignore_repairs | boolean | `ignore_repairs` (same as `ignore=["repairs"]`) gives the first-failure reliability of a repairable model. |
importance | boolean | |
max_bdd_nodes | `max_variables` and `max_bdd_nodes` override them; `max_bdd_nodes` may go up to half of the machine's free memory at about 350 bytes a node, and a higher value is refused. | |
max_variables | `max_variables` and `max_bdd_nodes` override them; `max_bdd_nodes` may go up to half of the machine's free memory at about 350 bytes a node, and a higher value is refused. | |
mode | string | |
phase | `standby="active"` keeps cold-standby paths in service and `standby="absent"` removes them; `phase` analyses a phased model as if it stayed in that phase. | |
standby | ||
tau | `tau` adds the conditional reliability of a further mission of that length after `at`. | |
times |
export_analytical
Solve exactly, as `analytical_analysis` does, and write a spreadsheet. `modes` (default `["reliability"]`): one or both of reliability and availability, solved with the same settings into ONE workbook, a set of sheets per mode (Summary, Elements with the importance measures, Curve, Equation, Assumptions). Reliability-only settings (`at`, `times`, `bx`, `tau`, ignoring repairs) apply to the reliability solve only. `phase="all"` solves every phase of a phased model on its own, a set of sheets per mode and phase ("Phase 2 Summary"). The file is `<model>[_h<hierarchy>]_analytical_<modes>[_all_ph…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
at | Reliability-only settings (`at`, `times`, `bx`, `tau`, ignoring repairs) apply to the reliability solve only. | |
bx | Reliability-only settings (`at`, `times`, `bx`, `tau`, ignoring repairs) apply to the reliability solve only. | |
dependencies | ||
equation | boolean | |
file_format | string | |
folder | The file is `<model>[_h<hierarchy>]_analytical_<modes>[_all_phases | _phase<N>].xlsx` (`.ods` with `file_format="ods"`, an OpenDocument spreadsheet), e.g. `Plant_analytical_reliability_availability.xl… | |
hierarchy | ||
ignore | ||
ignore_repairs | boolean | |
importance | boolean | |
max_bdd_nodes | ||
max_variables | ||
modes | `modes` (default `["reliability"]`): one or both of reliability and availability, solved with the same settings into ONE workbook, a set of sheets per mode (Summary, Elements with the importance measu… | |
phase | ||
standby | ||
tau | Reliability-only settings (`at`, `times`, `bx`, `tau`, ignoring repairs) apply to the reliability solve only. | |
times | Reliability-only settings (`at`, `times`, `bx`, `tau`, ignoring repairs) apply to the reliability solve only. |
list_tables
List the tables that can be read or exported. Two groups: **Inputs** (the model's data: blocks, nodes, events, hierarchies, links, spare pools, resources, triggers, phases, system settings) and **Results** (a run's report sections, per-run figures and capacity samples). Pass `run_id` (from `simulate`) to include a run's result tables; without it only the inputs are listed and the result tables are shown as unavailable. Returns {tables: [{key, title, group, rows, available, reason, default}]}. `key` is what `get_table` and `export_tables` take, e.g. 'inputs.blocks' or 'results.summary'. `defa…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
run_id | Pass `run_id` (from `simulate`) to include a run's result tables; without it only the inputs are listed and the result tables are shown as unavailable. |
get_table
Read one table: its column headers and a page of rows. `table` is a key from `list_tables` (e.g. 'inputs.blocks', 'results.summary'; result tables need `run_id`). Rows are returned as lists in header order, as the model file holds them (text such as "12.500000") or as numbers for computed tables. `limit` is at most 200; use `offset` and `next_offset` to page. Returns {key, title, group, headers, rows, total_rows, next_offset, notes}.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
table * | string | `table` is a key from `list_tables` (e.g. 'inputs.blocks', 'results.summary'; result tables need `run_id`). |
limit | integer | `limit` is at most 200; use `offset` and `next_offset` to page. |
offset | integer | `limit` is at most 200; use `offset` and `next_offset` to page. |
run_id | `table` is a key from `list_tables` (e.g. 'inputs.blocks', 'results.summary'; result tables need `run_id`). |
export_tables
Write tables to files: CSV, text, or one spreadsheet. Files of the same name in the folder are replaced. `tables`: keys from `list_tables`; omit for the default set (all input tables except the all-columns block table, plus every result table except the long ones). Result tables need `run_id`. `formats` (default ['xlsx']): 'csv' one .csv per table; 'txt' one fixed-width .txt per table; 'txt_report' ONE combined text report; 'xlsx' ONE Excel workbook and 'ods' the same as an OpenDocument spreadsheet: a Contents tab, a Run Info tab, a tab per table and a Glossary, real numeric cells, filters,…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
folder | `folder` is inside the workspace (relative paths resolve against its root); default `Tables/<model>` (or `Tables/<model>_<run_id>`). | |
formats | `formats` (default ['xlsx']): 'csv' one .csv per table; 'txt' one fixed-width .txt per table; 'txt_report' ONE combined text report; 'xlsx' ONE Excel workbook and 'ods' the same as an OpenDocument spr… | |
run_id | Result tables need `run_id`. | |
tables | `tables`: keys from `list_tables`; omit for the default set (all input tables except the all-columns block table, plus every result table except the long ones). |
export_report
Write a run's report as one PDF or one self-contained HTML file: the same document as the GUI's File > Export PDF, for a reader who wants the answer, not the tables. `sections` (default ['diagram', 'story']): 'story' is the headline, what drives the downtime, the findings, the charts and how to read each measure; 'results' adds every result table (dozens of pages on a large model); 'data_tables' the model's input tables. The run needs `attribution=True` for the drivers part of the story. `path` is inside the workspace and ends in .pdf or .html; default `Reports/<model>_<run_id>.pdf`; a file…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Id of a finished run in the workspace, from simulate, start_run/run_status or get_run_results. |
path | `path` is inside the workspace and ends in .pdf or .html; default `Reports/<model>_<run_id>.pdf`; a file already there is replaced. | |
sections | `sections` (default ['diagram', 'story']): 'story' is the headline, what drives the downtime, the findings, the charts and how to read each measure; 'results' adds every result table (dozens of pages… | |
title |
replace_in_table
Find and replace in one model table column. `table` is an input table key that edits model rows: `inputs.blocks_all`, `inputs.nodes`, `inputs.events`, `inputs.hierarchies`, `inputs.spare_pools`, `inputs.resources`, `inputs.triggers`, `inputs.phases` or `inputs.comments`. `column` is a file column name or index. `whole` matches the whole cell; `case` is case-sensitive. Name columns are validated as a manual rename is, and a refused set changes nothing. Returns the old and new value of every changed cell.
| Parameter | Type | Description |
|---|---|---|
column * | string | `column` is a file column name or index. |
find * | string | |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
replace * | string | |
table * | string | `table` is an input table key that edits model rows: `inputs.blocks_all`, `inputs.nodes`, `inputs.events`, `inputs.hierarchies`, `inputs.spare_pools`, `inputs.resources`, `inputs.triggers`, `inputs.ph… |
case | boolean | `whole` matches the whole cell; `case` is case-sensitive. |
whole | boolean | `whole` matches the whole cell; `case` is case-sensitive. |
list_part_types
List part types from a library file or from the open model. `library_path` reads a `.rbdlib` file; `model_id` lists the parts stored inside that model (the ones its linked blocks follow). With neither, lists the parts of the current model made available by `save_part_type`. `query` filters on id, name, category and source, case-insensitively.
| Parameter | Type | Description |
|---|---|---|
library_path | `library_path` reads a `.rbdlib` file; `model_id` lists the parts stored inside that model (the ones its linked blocks follow). | |
model_id | `library_path` reads a `.rbdlib` file; `model_id` lists the parts stored inside that model (the ones its linked blocks follow). | |
query | string | `query` filters on id, name, category and source, case-insensitively. |
apply_part_type
Apply a part type to blocks and record the link. `part` is an id (or exact name) from `library_path`, or from the parts stored inside the model when no path is given. `elements` are names or ids of elements of the part's kind (block, node, event, hierarchy or annotation). `overrides` are fields to leave as the element has them. The element's columns receive the part's values; the link is bookkeeping, so the engine still sees an ordinary element.
| Parameter | Type | Description |
|---|---|---|
elements * | array | `elements` are names or ids of elements of the part's kind (block, node, event, hierarchy or annotation). |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
part * | string | `part` is an id (or exact name) from `library_path`, or from the parts stored inside the model when no path is given. |
library_path | `part` is an id (or exact name) from `library_path`, or from the parts stored inside the model when no path is given. | |
overrides | `overrides` are fields to leave as the element has them. |
save_part_type
Save an element's data as a part type and optionally link it. `kind` is block, node, event, hierarchy or annotation; `element` is the name/id (or annotation id). With `library_path`, adds the part to that `.rbdlib` file. Without it, stores the part inside the model and links the element by default. `basis` says where the numbers came from: data, handbook or experience ("judgement" is read as experience). The part never includes the element's name, position or id.
| Parameter | Type | Description |
|---|---|---|
element * | string | `kind` is block, node, event, hierarchy or annotation; `element` is the name/id (or annotation id). |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
basis | string | `basis` says where the numbers came from: data, handbook or experience ("judgement" is read as experience). |
category | string | |
kind | string | `kind` is block, node, event, hierarchy or annotation; `element` is the name/id (or annotation id). |
library_path | With `library_path`, adds the part to that `.rbdlib` file. | |
link | boolean | |
name | ||
source | string |
sync_part_types
List or apply the changes a library has made to linked blocks. `dry_run=True` (default) only reports the differences, respecting each block's overrides. `library_path` reads the current part definitions; without it the copies stored inside the model are used.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
dry_run | boolean | |
library_path | `library_path` reads the current part definitions; without it the copies stored inside the model are used. |
save_assembly
Save a group of elements as a reusable assembly. An assembly is structure, not values: the named `elements` (blocks, nodes, events, hierarchies), everything inside a named hierarchy, and the links between them. `insert_assembly` puts a fresh copy into any model. With `library_path` the assembly is added to that `.rbdlib` file; without it, it is kept in the model's own part list. The model itself is not changed.
| Parameter | Type | Description |
|---|---|---|
elements * | array | An assembly is structure, not values: the named `elements` (blocks, nodes, events, hierarchies), everything inside a named hierarchy, and the links between them. |
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
name * | string | |
category | string | |
library_path | With `library_path` the assembly is added to that `.rbdlib` file; without it, it is kept in the model's own part list. | |
source | string |
insert_assembly
Insert a fresh copy of an assembly into a model. `part` is the assembly's id or name, from `library_path` or the model's own part list. The copy gets new ids; a name the model already uses becomes a free one (Pump -> Pump_2), listed in `renamed` {old: new}; a hierarchy keeps everything inside it. It is placed at (`x`, `y`) or, by default, to the right of the model, and is NOT connected: link it in with `connect`. Spare pools or resources the model lacks are reset and listed in `notes`.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
part * | string | `part` is the assembly's id or name, from `library_path` or the model's own part list. |
library_path | `part` is the assembly's id or name, from `library_path` or the model's own part list. | |
x | It is placed at (`x`, `y`) or, by default, to the right of the model, and is NOT connected: link it in with `connect`. | |
y | It is placed at (`x`, `y`) or, by default, to the right of the model, and is NOT connected: link it in with `connect`. |
optimise_spares
The cheapest spare stock that meets a target, found by simulation. Seeds a path of stock levels from a Poisson backorder model (one more unit where it removes the most expected shortage per unit cost) and simulates each point with paired trials. `mode="meet"` stops at the cheapest point whose lower confidence bound meets `target` on `metric` ('availability' or 'mdt'; an MDT target is met by the upper bound); `mode="curve"` returns the whole evaluated frontier. `pools` limits the search to those spare pools (default: every finite pool with demand). `max_evaluations` caps the number of points s…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
max_evaluations | integer | `max_evaluations` caps the number of points simulated. |
metric | string | `mode="meet"` stops at the cheapest point whose lower confidence bound meets `target` on `metric` ('availability' or 'mdt'; an MDT target is met by the upper bound); `mode="curve"` returns the whole e… |
mode | string | |
pools | `pools` limits the search to those spare pools (default: every finite pool with demand). | |
seed | Non-negative seed that re-rolls the batch reproducibly. | |
target | `mode="meet"` stops at the cheapest point whose lower confidence bound meets `target` on `metric` ('availability' or 'mdt'; an MDT target is met by the upper bound); `mode="curve"` returns the whole e… | |
timeout_s | number | Wall-clock limit for the call, in seconds. |
trials | Paired trials per scenario. Leave out for the tool's default. | |
workers | Worker processes. Leave out for the server default (several cores for a large model); 1 gives the sequential numbers. |
optimise_pm
Is planned maintenance worthwhile on each block, and at what interval. Screens each block (`blocks`, default every block with a life law) with the age-replacement formula: PM pays only for a wearing-out part (Weibull shape above 1) whose planned job is cheaper than a failure. Then it simulates no PM and 0.5 to 2 times the formula's interval with paired trials, on `objective` 'availability' or 'cost'. The recommendation comes from the simulation, not the formula. Returns `advice` (the screen, with its reason per block), `rows` (every option simulated, with its `changes`), `recommendations` (t…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
blocks | Screens each block (`blocks`, default every block with a life law) with the age-replacement formula: PM pays only for a wearing-out part (Weibull shape above 1) whose planned job is cheaper than a fai… | |
objective | string | Then it simulates no PM and 0.5 to 2 times the formula's interval with paired trials, on `objective` 'availability' or 'cost'. |
seed | Non-negative seed that re-rolls the batch reproducibly. | |
timeout_s | number | Wall-clock limit for the call, in seconds. |
trials | Paired trials per scenario. Leave out for the tool's default. | |
workers | Worker processes. Leave out for the server default (several cores for a large model); 1 gives the sequential numbers. |
optimise_resources
How many crews or tools each repair resource needs to meet a target. Starts from the offered load (failures per unit time × repair time) and simulates sizes from one below it to `extra` above, with paired trials. The recommendation is the smallest size whose lower confidence bound on availability meets `target`; when none does, the best measured size, said so. `resources` limits the search to those resources. Returns every size simulated (`rows`), `recommendations` ({resource, units, mean, lower, cost, why, changes}; `cost` is the run's mean total cost, present when the model has cost analy…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
extra | integer | Starts from the offered load (failures per unit time × repair time) and simulates sizes from one below it to `extra` above, with paired trials. |
resources | `resources` limits the search to those resources. | |
seed | Non-negative seed that re-rolls the batch reproducibly. | |
target | The recommendation is the smallest size whose lower confidence bound on availability meets `target`; when none does, the best measured size, said so. | |
timeout_s | number | Wall-clock limit for the call, in seconds. |
trials | Paired trials per scenario. Leave out for the tool's default. | |
workers | Worker processes. Leave out for the server default (several cores for a large model); 1 gives the sequential numbers. |
fit_from_experience
Turn experience into a life law, with no failure data. Each answer is a share and an age: "one in ten fail by 100 hours, half by 300" is `[{probability: 0.1, age: 100}, {probability: 0.5, age: 300}]`. Two answers solve the law exactly (one is enough for an exponential); three or more are a least-squares fit. Weibull suits wear-out lives, lognormal repair times, exponential random failures. Inconsistent answers (a higher share at an earlier age) are refused by name. The fit is only as good as the answers. Returns `params` (named), `slots` (in the model's parameter order), `mean`, `fitted` (th…
| Parameter | Type | Description |
|---|---|---|
law * | string | |
quantiles * | array | |
block | With `block`, also `changes` (PATH=VALUE, for `raptor set`) and `update` (the fields to pass to `update_element`, law and parameters together) for its failure (`use="fail"`) or repair law. | |
use | string |
render_diagram_svg
Draw one level of the diagram as SVG text, without Qt. For checking layout, connections and annotations when `render_diagram` (a PNG of the GUI canvas) is unavailable, or when SVG text is easier to read than an image. It draws blocks, nodes (S/E, HI/HO, k/n), events, hierarchy ovals, links with arrowheads and annotations at the GUI's scene positions; `routing` is 'straight' (default), 'angled' (short stubs then a straight run) or 'orthogonal' (right angles only, round the other elements). Blocks never move; an orthogonal link that cannot be routed quickly stays straight. It does not measure f…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
highlight | `zoom_to` frames the named elements on that level, padded by `margin` scene units; `highlight` outlines them. | |
include_annotations | boolean | |
layer | `layer` with `run_id` (a run made with `attribution=True`) draws the run's result on the diagram, as the application's Show on canvas layers do: 'downtime-share' fills each block and event by its shar… | |
level | integer | `level` is 0 for the top level or a **hierarchy id** (not a depth). |
margin | number | `zoom_to` frames the named elements on that level, padded by `margin` scene units; `highlight` outlines them. |
routing | string | It draws blocks, nodes (S/E, HI/HO, k/n), events, hierarchy ovals, links with arrowheads and annotations at the GUI's scene positions; `routing` is 'straight' (default), 'angled' (short stubs then a s… |
run_id | `layer` with `run_id` (a run made with `attribution=True`) draws the run's result on the diagram, as the application's Show on canvas layers do: 'downtime-share' fills each block and event by its shar… | |
theme | string | Colour theme of the drawing: light or dark. |
zoom_to | `zoom_to` frames the named elements on that level, padded by `margin` scene units; `highlight` outlines them. |
render_diagram
Render the model diagram as a PNG image. `level` is a **hierarchy id**, not a depth index: 0 renders the whole model (home level); to render inside a hierarchy pass its id, e.g. the hierarchy `id=900` is `level=900` (read hierarchy ids from `describe_model`). Passing `1`/`2` is a common mistake and reports the available ids. `zoom_to` frames a **close-up** on one or more named/id'd elements (block/node/event/hierarchy) **within the current `level`** (it does not change which level is shown), padded by `margin` scene units — the way to render a large model legibly in sections. A selector…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | Id of a loaded model, from open_model, build_model, create_model or list_models. |
highlight | `highlight` outlines named elements (e.g. the single points of failure). | |
include_annotations | boolean | `include_annotations` draws the model's text/rect/ellipse/arrow annotations (default true). |
level | integer | `level` is a **hierarchy id**, not a depth index: 0 renders the whole model (home level); to render inside a hierarchy pass its id, e.g. the hierarchy `id=900` is `level=900` (read hierarchy ids from… |
margin | number | `zoom_to` frames a **close-up** on one or more named/id'd elements (block/node/event/hierarchy) **within the current `level`** (it does not change which level is shown), padded by `margin` scene units… |
max_px | integer | |
routing | string | `routing` is the link style: 'straight' (default); 'angled' (a short stub out of each port, then a straight run); or 'orthogonal' (right angles only, steering round other elements). |
theme | string | `theme` is 'light' or 'dark'. |
zoom_to | `zoom_to` frames a **close-up** on one or more named/id'd elements (block/node/event/hierarchy) **within the current `level`** (it does not change which level is shown), padded by `margin` scene units… |