Gymnasium Wrapper¶
GymnasiumWrapper
¶
Bases: Env
Wraps a gyozas Environment as a standard gymnasium.Env.
Since gyozas action sets are variable-size (different branching candidates
at each step), this wrapper uses a Discrete action space sized to the
maximum action set seen so far. The action_set attribute holds the
valid actions for the current step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance_generator
|
InstanceGenerator
|
Iterator yielding PySCIPOpt Model instances. |
required |
observation_function
|
Gyozas observation function. Defaults to |
None
|
|
reward_function
|
Gyozas reward function. Defaults to |
None
|
|
information_function
|
Gyozas information function. Defaults to |
None
|
|
dynamics
|
Gyozas dynamics. Defaults to |
None
|
|
scip_params
|
SCIP parameters dict applied at the start of each episode. |
None
|
|
max_steps
|
int | None
|
If set, truncate episodes after this many steps. |
None
|
Source code in gyozas/gymnasium_wrapper.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
reset(*, seed=None, options=None)
¶
Reset the environment and return initial observation and info.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seed
|
int | None
|
Random seed for reproducibility. |
None
|
options
|
dict | None
|
Unused, for Gymnasium API compatibility. |
None
|
Returns:
| Type | Description |
|---|---|
observation
|
The initial observation. |
info
|
Dictionary with |
Source code in gyozas/gymnasium_wrapper.py
step(action)
¶
Take a step in the environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
int
|
Index into the current |
required |
Returns:
| Type | Description |
|---|---|
observation
|
The new observation (None if terminated). |
reward
|
The step reward. |
terminated
|
True if the solver finished. |
truncated
|
True if |
info
|
Dictionary with |