My understanding of env.target_dispatch is that it represents the amount of redispatching, not the 'absolute' dispatch (which is given by env.gen_prod_t).
However, I notice that the below exception seems to suggest that an action is illegal if any of the target dispatches go below pmin. Of course this means that if, for instance, I run:
env = grid2op.make("case14_redisp")
act = env.action_space({"redispatch": [0, -1]})
obs, reward, done, info = env.step(act)
print(reward)
act = env.action_space({"redispatch": [0, 0]})
obs, reward, done, info = env.step(act)
print(reward)
Then the second action is illegal, with print(info['exception']) showing:
[Grid2OpException AmbiguousAction InvalidRedispatching InvalidRedispatching('Target redispatching bellow pmin for generators [0]')]
I feel as though the exception should be thrown if np.any(self.active_prod_t < self.gen_pmin) (or similar)?
https://github.com/rte-france/Grid2Op/blob/ceecb569558b9d27d32659b15581b2ef940ef357/grid2op/BasicEnv.py#L428-L432
My understanding of
env.target_dispatchis that it represents the amount of redispatching, not the 'absolute' dispatch (which is given byenv.gen_prod_t).However, I notice that the below exception seems to suggest that an action is illegal if any of the target dispatches go below pmin. Of course this means that if, for instance, I run:
Then the second action is illegal, with
print(info['exception'])showing:I feel as though the exception should be thrown if
np.any(self.active_prod_t < self.gen_pmin)(or similar)?https://github.com/rte-france/Grid2Op/blob/ceecb569558b9d27d32659b15581b2ef940ef357/grid2op/BasicEnv.py#L428-L432