ecole icon indicating copy to clipboard operation
ecole copied to clipboard

Some observation functions can only be called during certain stages, but Ecole doesn't recognize that

Open dchetelat opened this issue 4 years ago • 1 comments

For example, the NodeBipartite extraction function can only be called when the SCIP stage is SCIP_STAGE_SOLVING or later.

Following an internal discussion, we have converged on two proposals that would be good to add to Ecole.

  1. Observation functions would have an associated list of valid stages when their extract function can be called, and if extract gets called during a stage not in that list, an appropriate exception gets thrown.
  2. To avoid surprises for the user, some a priori check of incompatibility between dynamic and observation functions could be performed by having the dynamics also have their list of stages where the extraction/"querying the agent" has a chance of being performed, and if the list of stages of the observation function is not a subset of this list, then some exception gets thrown immediately when the environment gets created (not waiting further down for an incompatibility be noticed mid-solving.)

dchetelat avatar Mar 29 '21 15:03 dchetelat

Adding this would also be useful for tests

  • [ ] Automatically detect the stage needed to test the observation in make_obs, unit_tests.

AntoinePrv avatar Apr 12 '21 15:04 AntoinePrv