Battery 18650 T2 Pose Surrogate Grammar#

Source: examples/grammar/battery_18650_t2_pose_surrogate_grammar.py

Introduction#

Build and evaluate a simple tier-2 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
 3from _battery_transition_helpers import apply_first_transition
 4
 5import design_research_problems as derp
 6
 7
 8def main() -> None:
 9    """Nudge the seed layout with a couple of concrete pose edits and print its metrics."""
10
11    # Load the tier-2 pose grammar and start from its deterministic vector seed.
12    problem = derp.get_problem("battery_18650_t2_pose_surrogate_grammar")
13    state = problem.initial_state()
14
15    # Vector-grammar transitions already carry their next state, so we apply two
16    # named local edits to move the first cell away from the default layout.
17    state = apply_first_transition(problem, state, "move_cell_x")
18    state = apply_first_transition(problem, state, "move_cell_y")
19
20    evaluation = problem.evaluate(state)
21    print(evaluation)
22
23
24if __name__ == "__main__":
25    main()

Expected Results#

Run Command

PYTHONPATH=src python3 examples/grammar/battery_18650_t2_pose_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.