Battery 18650 T1 Rectangular Surrogate Grammar#
Source: examples/grammar/battery_18650_t1_rectangular_surrogate_grammar.py
Introduction#
Build and evaluate a simple tier-1 battery grammar state.
Technical Implementation#
This page is generated from the top-of-file module docstring and the example source code. The full script is included below for direct inspection.
1from __future__ import annotations
2
3import design_research_problems as derp
4
5
6def main() -> None:
7 """Grow the seed state into a small 2S2P pack and print its metrics."""
8
9 # Load the tier-1 rectangular grammar and start from the bundled 1S1P seed.
10 problem = derp.get_problem("battery_18650_t1_rectangular_surrogate_grammar")
11 state = problem.initial_state()
12
13 # First add one parallel branch beside the seed cell, then append a second
14 # series stage with one cell per branch to build a minimal 2S2P layout.
15 state = problem.add_parallel_branch(state, placements=((0, 1, 0),))
16 state = problem.add_series_stage(state, placements=((1, 0, 0), (1, 1, 0)))
17
18 # The evaluator reports the shared battery-tier metric contract.
19 evaluation = problem.evaluate(state)
20 print(evaluation)
21
22
23if __name__ == "__main__":
24 main()
Expected Results#
Run Command
PYTHONPATH=src python3 examples/grammar/battery_18650_t1_rectangular_surrogate_grammar.py
Run the command shown below from repository root. Output should summarize the problem setup, a baseline solution, or diagnostic values relevant to this example.