Fix _STEP and _RESET for TempVMPackingEnv (fixes #36)#42
Open
joefarrington wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the
TempVMPackingEnvdefined inor_gym/envs/classic_or/vmpacking.pythat fixes #36or_gym/envs/classic_or/vmpacking.py: Renamedstepmethod to_STEPso that customized logic is used. In current implementation steps use the_STEPfrom the parent classVMPackingEnv.or_gym/envs/classic_or/vmpacking.py: Updatedpm_statearray operations in_STEPto exclude the first element of the demand array and addressed rounding issues by setting values less thanself.tolto 0.or_gym/envs/classic_or/vmpacking.py: Modifiedupdate_statemethod to usenp.float32fordata_centerandnp.uint8foraction_maskandavail_actionsto ensure proper data types. This ensures that the tests pass, because they include a check against theobservation_spacewhich uses these types.or_gym/envs/classic_or/vmpacking.py: Updated_RESETmethod to initializestatewith dictionaries containingnp.uint8andnp.float32data types foraction_mask,avail_actions, andstate._RESETmethod previously gave an error because the default state was a NumPy array butupdate_statetries 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 setsself.mask=False, the state consists of just the NumPy array (vs dictionary containing arrays for action mask, available action, and the state).