(agent)
| 101 | |
| 102 | |
| 103 | def 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 | |
| 132 | def nmi_to_plain(nmi) -> dict[str, Any]: |
no test coverage detected