MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / awi_to_plain

Function awi_to_plain

codeclash/arenas/scml/runtime/run_scml.py:103–129  ·  view source on GitHub ↗
(agent)

Source from the content-addressed store, hash-verified

101
102
103def awi_to_plain(agent) -> dict[str, Any]:
104 awi = agent.awi
105 fields = [
106 "current_step",
107 "n_steps",
108 "n_lines",
109 "max_n_lines",
110 "current_score",
111 "current_balance",
112 "current_inventory",
113 "current_exogenous_input_quantity",
114 "current_exogenous_input_price",
115 "current_exogenous_output_quantity",
116 "current_exogenous_output_price",
117 "current_disposal_cost",
118 "current_shortfall_penalty",
119 "my_input_product",
120 "my_output_product",
121 "is_first_level",
122 "is_middle_level",
123 "is_last_level",
124 "needed_sales",
125 "needed_supplies",
126 "my_suppliers",
127 "my_consumers",
128 ]
129 return {field: to_plain(getattr(awi, field, None)) for field in fields}
130
131
132def nmi_to_plain(nmi) -> dict[str, Any]:

Callers 1

_base_observationMethod · 0.85

Calls 1

to_plainFunction · 0.85

Tested by

no test coverage detected