Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _STEP and _RESET for TempVMPackingEnv (fixes #36) #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joefarrington
Copy link

This pull request includes several changes to the TempVMPackingEnv defined in or_gym/envs/classic_or/vmpacking.py that fixes #36

  • or_gym/envs/classic_or/vmpacking.py: Renamed step method to _STEP so that customized logic is used. In current implementation steps use the _STEP from the parent class VMPackingEnv.
  • or_gym/envs/classic_or/vmpacking.py: Updated pm_state array operations in _STEP to exclude the first element of the demand array and addressed rounding issues by setting values less than self.tol to 0.
  • or_gym/envs/classic_or/vmpacking.py: Modified update_state method to use np.float32 for data_center and np.uint8 for action_mask and avail_actions to ensure proper data types. This ensures that the tests pass, because they include a check against the observation_space which uses these types.
  • or_gym/envs/classic_or/vmpacking.py: Updated _RESET method to initialize state with dictionaries containing np.uint8 and np.float32 data types for action_mask, avail_actions, and state. _RESET method previously gave an error because the default state was a NumPy array but update_state tries to set values using dictionary keys.

This pull request addresses the default setting where self.mask=True, but does not make edits to ensure that, if the user sets self.mask=False, the state consists of just the NumPy array (vs dictionary containing arrays for action mask, available action, and the state).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with step and reset in TempVMPackingEnv
1 participant