Advanced Features¶
Structured routing¶
ConditionalRoute chooses from a declarative Product/Part attribute. ProbabilisticRoute uses explicit probabilities. Optional continuations map each selected branch to its next component. ReworkRoute bounds loops with max_reworks; ScrapRoute terminates a Part and records its reason. These objects avoid arbitrary callback functions in normal configuration.
grade_decision = ConditionalRoute(
"grade",
{"premium": premium_machine},
default=standard_machine,
)
product = Product(
"Priority Part",
[source, grade_decision, premium_machine, standard_machine, sink],
attributes={"grade": "premium"},
)
For a simple linear route, either list components or connect explicit edges:
product = Product("A", [Route(source, machine), Route(machine, sink)])
JSON configurations¶
plant.save_config("outputs/configs/layout_a.json")
restored = Plant.load_config("outputs/configs/layout_a.json")
The schema retains component dimensions, distributions, assignments, Products, structured route decisions, and movement connections. Loaded plants are validated automatically.
Event and Part histories¶
Use plant.run(event_log=True) to expose result.event_log. Event fields include timestamps, Part/Product IDs, event type, resource, locations, duration, and distance when relevant. Event logging is optional because large runs produce large tables. Per-Part history is always retained:
result.part_history("Part-000042")
Multiple Sources and Sinks¶
Products are inferred for a Source when their routes begin there. Assign Source.products or Source.product_mix explicitly for controlled mixes. Units Produced are available overall, by Product, and by Sink.
Distance and transport¶
Set distance_method="euclidean" when straight-line movement is appropriate; Manhattan remains the default. Forklift and AGV metrics separate empty/loaded distance, active motion, and reserved utilization. Worker paths separate empty and loaded movement and can be drawn with worker_spaghetti_diagram().
Machine failures, changeovers, warm-up workflows, and shift/break scheduling are intentionally outside v0.1.
Underlying SimPy objects¶
Advanced users can inspect the completed result.simpy_environment and the categorized result.simpy_resources mapping. Normal student models should continue to use Plant, components, and result tables instead of manipulating these objects directly.
Framework defaults¶
Worker speed defaults to 4 ft/s, Forklift speed to 8 ft/s, and AGV speed to 6 ft/s. Forklifts and AGVs carry one unit per trip by default; all values can be overridden explicitly.