Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Project Settings is the Inspector page (Model ▸ Project Settings, or the
Project Settings entry in Model Explorer). It is not a modal: the page
stays open beside the canvas. Run settings are edited in the Run panel;
the Inspector shows read-only echoes for those fields. Model-wide fields
(units, flow generated, costs, flags) are edited here.
(units and flags) are edited here. Flow generated and the system costs
live in the Run panel, beside the Capacity and Cost analyses they feed.

[cols="3,4,3",options="header"]
|===
Expand All @@ -41,9 +42,6 @@ the Inspector shows read-only echoes for those fields. Model-wide fields
|Term condition |The mission length (TimeSim) or failure count (FailSim) |See xref:../new_docs/book.html#ch-first-model[Your First Model]
|Statistics start time |Discard everything before this time from the statistics |Warm-up / transient removal
|Number of runs |Read-only echo of trials per simulation |Edit in the Run panel; more runs give tighter SEMs (xref:../new_docs/book.html#ch-trials[Many Trials])
|Flow generated |Demand offered at the Start node each hour |xref:../new_docs/book.html#ch-capacity[Capacity analysis]
|System red cost |Cost per hour the system is fully down |xref:../new_docs/book.html#ch-cost[Cost analysis]
|Cost of lost flow |Price per unit of unmet demand |Billed against capacity shortfall
|Green/Yellow threshold |Read-only echo; edit in Results ▸ Bands |Default 0.95
|Yellow/Red threshold |Read-only echo; edit in Results ▸ Bands |Default 0.90
|Ignore negative-value warning |Suppress the warning when a parameter is set negative |Off by default
Expand Down Expand Up @@ -702,7 +700,9 @@ greyed, with the reason, while Animate is on or a run is going.

|Analysis
|Weak Link, Cost and Capacity. Each is a switch with its purpose
written beside it.
written beside it. Flow generated appears here once Capacity is on; the
system red cost is always editable, and the cost of lost flow appears
once both Capacity and Cost are on.

|Recording
|Which outputs a run collects. Additive rather than a single "level",
Expand Down
22 changes: 5 additions & 17 deletions docs/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ <h2 id="system-settings">Model tab → Project Settings</h2>
Project Settings entry in Model Explorer). It is not a modal: the page
stays open beside the canvas. Run settings are edited in the Run panel;
the Inspector shows read-only echoes for those fields. Model-wide fields
(units, flow generated, costs, flags) are edited here.</p>
(units and flags) are edited here. Flow generated and the system costs
live in the Run panel, beside the Capacity and Cost analyses they feed.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
Expand Down Expand Up @@ -174,21 +175,6 @@ <h2 id="system-settings">Model tab → Project Settings</h2>
<td class="tableblock halign-left valign-top"><p class="tableblock">Edit in the Run panel; more runs give tighter SEMs (<a href="../new_docs/book.html#ch-trials">Many Trials</a>)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Flow generated</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Demand offered at the Start node each hour</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../new_docs/book.html#ch-capacity">Capacity analysis</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">System red cost</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Cost per hour the system is fully down</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../new_docs/book.html#ch-cost">Cost analysis</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Cost of lost flow</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Price per unit of unmet demand</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Billed against capacity shortfall</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Green/Yellow threshold</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Read-only echo; edit in Results ▸ Bands</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Default 0.95</p></td>
Expand Down Expand Up @@ -1152,7 +1138,9 @@ <h2 id="run">The Run panel</h2>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Analysis</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Weak Link, Cost and Capacity. Each is a switch with its purpose
written beside it.</p></td>
written beside it. Flow generated appears here once Capacity is on; the
system red cost is always editable, and the cost of lost flow appears
once both Capacity and Cost are on.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Recording</p></td>
Expand Down
16 changes: 7 additions & 9 deletions new_docs/book.html
Original file line number Diff line number Diff line change
Expand Up @@ -6408,13 +6408,14 @@ <h3 id="_two_numbers_per_pipe">15.4. Two numbers per pipe</h3>
<div class="sect2">
<h3 id="_open_the_model_4">15.5. Open the model</h3>
<div class="paragraph">
<p>Load <code>models/Water1.rbds</code>. In <strong>Model → Project Settings</strong> notice
two settings that were never there before:</p>
<p>Load <code>models/Water1.rbds</code>. In the <strong>Run</strong> panel, tick <strong>Capacity</strong> under
Analysis and look at the two settings that make it work:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Flow generated: 180</strong> — the demand, offered at the start every hour.</p>
<p><strong>Flow generated: 180</strong> — the demand, offered at the start every hour
(in the same Analysis section).</p>
</li>
<li>
<p><strong>Capacity analysis: checked</strong> — tells the engine to track flow,
Expand Down Expand Up @@ -6714,12 +6715,9 @@ <h3 id="_the_story_15">16.3. The story</h3>
<div class="sect2">
<h3 id="_three_places_money_lives">16.4. Three places money lives</h3>
<div class="paragraph">
<p>Open <code>models/Water2.rbds</code> and choose <strong>Model → Project Settings</strong>:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="images/water2-sysconfig.png" alt="Project Settings: cost fields for the water utility">
</div>
<p>Open <code>models/Water2.rbds</code> and open the <strong>Run</strong> panel. With <strong>Cost</strong> on
(and <strong>Capacity</strong> on as well, for the lost-flow price), the Analysis
section carries the two system costs:</p>
</div>
<div class="paragraph">
<p>Money is configured in three places:</p>
Expand Down
7 changes: 4 additions & 3 deletions new_docs/chapters/ch11-capacity.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ the GUI starts as "share everything evenly".

=== Open the model

Load `models/Water1.rbds`. In **Model → Project Settings** notice
two settings that were never there before:
Load `models/Water1.rbds`. In the **Run** panel, tick **Capacity** under
Analysis and look at the two settings that make it work:

* **Flow generated: 180** — the demand, offered at the start every hour.
* **Flow generated: 180** — the demand, offered at the start every hour
(in the same Analysis section).
* **Capacity analysis: checked** — tells the engine to track flow,
not just up/down.

Expand Down
6 changes: 3 additions & 3 deletions new_docs/chapters/ch12-cost.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ the arithmetic.

=== Three places money lives

Open `models/Water2.rbds` and choose **Model → Project Settings**:

image::water2-sysconfig.png[Project Settings: cost fields for the water utility]
Open `models/Water2.rbds` and open the **Run** panel. With **Cost** on
(and **Capacity** on as well, for the lost-flow price), the Analysis
section carries the two system costs:

Money is configured in three places:

Expand Down
Binary file removed new_docs/images/water2-sysconfig.png
Binary file not shown.
14 changes: 0 additions & 14 deletions new_docs/tools/capture_screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,20 +274,6 @@ def descend(name):
load("Water1")
shot("water-loaded")

# 22b. ch-cost: Project Settings is the Inspector page, not a dialog.
load("Water2")
w._open_project_settings()
# A tall window so the whole page fits without scrolling; let the layout
# settle before the grab (one event pass leaves the rows half laid out).
w.resize(1600, 1500)
for _ in range(3):
app.processEvents()
w._inspector_dock.widget().grab().copy(0, 0, 400, 830).save(
os.path.join(IMG, "water2-sysconfig.png"), "PNG")
w.resize(1600, 1000)
app.processEvents()
print("shot water2-sysconfig")

# 23-24. ch-capstone (data centre): home level, then inside Power_sub.
load("DC1")
shot("dc-loaded")
Expand Down
11 changes: 0 additions & 11 deletions raptor/gui/ui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,6 @@ def fspin(value):
num_runs = QSpinBox()
num_runs.setRange(1, 1_000_000)
num_runs.setValue(cfg.num_runs)
flow_gen = QSpinBox()
flow_gen.setRange(0, 1_000_000_000)
flow_gen.setValue(int(cfg.flow_generated))
red_cost = fspin(cfg.system_red_cost)
lost_cost = fspin(cfg.lost_flow_unit_cost)
gy = fspin(cfg.gy_threshold)
yr = fspin(cfg.yr_threshold)
# Original ranges (Raptor 7's own validation): GY in 0.01..1.0,
Expand All @@ -952,9 +947,6 @@ def fspin(value):
form.addRow(f"Statistics start time ({shown_units}):" if shown_units
else "Statistics start time:", start_stats)
form.addRow("Number of runs:", num_runs)
form.addRow("Flow generated:", flow_gen)
form.addRow("System red cost:", red_cost)
form.addRow("Cost of lost flow:", lost_cost)
form.addRow("Green/Yellow threshold:", gy)
form.addRow("Yellow/Red threshold:", yr)

Expand Down Expand Up @@ -1057,9 +1049,6 @@ def fspin(value):
("TermCondition", f"{term_cond.value():.6f}"),
("StartStats", f"{display_to_native(start_stats.value(), native_units, display_unit):.6f}"),
("NumRuns", str(num_runs.value())),
("flowGenerated", str(flow_gen.value())),
("systemRedCost", f"{red_cost.value():.6f}"),
("sysLostCost", f"{lost_cost.value():.6f}"),
("GYthreshold", f"{gy.value():.6f}"),
("YRthreshold", f"{yr.value():.6f}"),
("weakAnalysis", "1" if checks["weak_analysis"][0].isChecked()
Expand Down
14 changes: 0 additions & 14 deletions raptor/gui/ui/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4078,10 +4078,6 @@ def commit_streams(_=None, spins=stream_spins,
lambda on: self.system_config_changed.emit(
{"IgnoreStartFail": "1" if on else "0"}))
fl.addRow(startfail_cb)
self._int_row(
fl, "Flow generated", int(cfg.flow_generated),
lambda v: self.system_config_changed.emit(
{"flowGenerated": str(v)}), minimum=0)
neg_cb = QCheckBox("Ignore negative-value warning")
neg_cb.setAccessibleName("Ignore negative-value warning")
neg_cb.setChecked(bool(cfg.show_neg_err_msg))
Expand All @@ -4090,16 +4086,6 @@ def commit_streams(_=None, spins=stream_spins,
{"ShowNegErrMsg": "1" if on else "0"}))
fl.addRow(neg_cb)

_gb, fl = self._group("System Costs", layout)
self._float_row(
fl, "System red cost", cfg.system_red_cost,
lambda v: self.system_config_changed.emit(
{"systemRedCost": f"{v:.6f}"}))
self._float_row(
fl, "Cost of lost flow", cfg.lost_flow_unit_cost,
lambda v: self.system_config_changed.emit(
{"sysLostCost": f"{v:.6f}"}))

self._restore_tab()

def _refresh_theme(self, _dark: bool | None = None):
Expand Down
6 changes: 4 additions & 2 deletions raptor/gui/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,8 @@ def _setup_docks(self):
dock_bottom.raise_()
self._setup_dock_toggle(self._run_toggle_action, self._run_dock)
self._run_panel.experiment_changed.connect(self._on_panel_experiment)
self._run_panel.system_config_changed.connect(
self._on_system_config_changed)
self._run_panel.dependency_blocked.connect(self._on_panel_dependency)
self._run_panel.cores_changed.connect(self._on_cores_changed)
self._sync_cores_box()
Expand Down Expand Up @@ -2145,8 +2147,8 @@ def _on_bands_edited(self, gy: float, yr: float):
"Set Weak Link bands")

def _on_system_config_changed(self, updates: dict) -> None:
"""Apply Inspector Project Settings edits through the undoable
row writer, then refresh every dependent readout."""
"""Apply Project Settings / Run panel SYSTEM_DATA edits through the
undoable row writer, then refresh every dependent readout."""
if not updates or self._rbd is None:
return
sec = self._rbd.sections.get("SYSTEM_DATA")
Expand Down
9 changes: 8 additions & 1 deletion raptor/gui/ui/run_experiment_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,25 @@ def _sync_run_mirrors(self) -> None:
self._sync_run_panel_units()

def _sync_run_panel_units(self) -> None:
"""Show the model's time unit on the panel's time-valued rows."""
"""Show the model's time unit and system-level values on the panel."""
panel = getattr(self, "_run_panel", None)
if panel is None:
return
if self._rbd is None:
# Called during dock setup, before any model is open.
panel.set_units("", None)
panel.set_system_config(None)
if hasattr(panel, "set_importance_blocks"):
panel.set_importance_blocks(0)
return
units = self._current_units() or ""
panel.set_units(units, getattr(self._rbd, "display_unit", None))
sec = self._rbd.sections.get("SYSTEM_DATA")
if sec and sec.rows:
from raptor.core.fileio.typed import system_config_from_row
panel.set_system_config(system_config_from_row(sec.rows[0]))
else:
panel.set_system_config(None)
# The importance cost estimate is per block, so the panel needs the
# count of the open model. `block_rows` is the same list the
# analysis walks, so the estimate cannot disagree with the work.
Expand Down
Loading
Loading