Battery 18650 T3a Topology Surrogate Grammar#

Source: examples/grammar/battery_18650_t3a_topology_surrogate_grammar.py

Introduction#

Build and evaluate a simple tier-3A 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    """Apply a few topology edits to the seed state and print its metrics."""
10
11    # Load the topology-allocation grammar and start from its seed vector.
12    problem = derp.get_problem("battery_18650_t3a_topology_surrogate_grammar")
13    state = problem.initial_state()
14
15    # Apply one cell-count edit, one series-count edit, and one stage-slot edit
16    # so the example touches the topology-specific part of the representation.
17    state = apply_first_transition(problem, state, "adjust_cell_count")
18    state = apply_first_transition(problem, state, "adjust_series_count")
19    state = apply_first_transition(problem, state, "adjust_first_cell_stage_slot")
20
21    evaluation = problem.evaluate(state)
22    print(evaluation)
23
24
25if __name__ == "__main__":
26    main()

Expected Results#

Run Command

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