You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found a couple of issues with the TempVMPackingEnv environment (VMPacking-v1).
The main one is that the custom logic of the step method was definied as step() instead of _STEP() and so steps in the environment were actually using _STEP() for the parent class. There's is also a small indexing error when demand is being removed from a PM, and I think it would be helpful to also round down any remaining use below tolerance to zero.
There was also an issue in the _RESET() method, where state was being created as an array istead of a dict, and so updates to the state, based on dict keys, did not work.
Proposed fixes below, with a comment followed by my initials (JMF) and an explanation for each changed/added line. Happy to raise a pull request if helpful.
def_STEP(self, action): # JMF: _STEP instead of step, otherwise _STEP from parent useddone=Falsepm_state=self.state["state"][:-1]
demand=self.state["state"][-1, 1:]
ifaction<0oraction>=self.n_pms:
raiseValueError("Invalid action: {}".format(action))
elifany(pm_state[action, 1:] +demand>1+self.tol):
# Demand doesn't fit into PMreward=-1000done=Trueelse:
ifpm_state[action, 0] ==0:
# Open PM if closedpm_state[action, 0] =1pm_state[action, self.load_idx] +=demandreward=np.sum(pm_state[:, 0] * (pm_state[:,1:].sum(axis=1) -2))
self.assignment[self.current_step] =action# Remove processesifself.current_stepinself.durations.values():
forprocessinself.durations.keys():
# Remove process from PMifself.durations[process] ==self.current_step:
pm=self.assignment[process] # Find PM where process was assignedpm_state[pm, self.load_idx] -=self.demand[process][1:] # JMF: Index to exclude first element of demand arraypm_state[pm, self.load_idx] =np.where(pm_state[pm, self.load_idx]<self.tol, 0., pm_state[pm, self.load_idx]) # JMF: Deal with rounding# Shut down PM's if state is 0ifpm_state[pm, self.load_idx].sum() ==0:
pm_state[pm, 0] =0self.current_step+=1ifself.current_step>=self.step_limit:
done=Trueself.update_state(pm_state)
returnself.state, reward, done, {}
Could you please let me know how to use VMPacking-v1 or VMPacking-v0. I'm not sure how to set up the env_config for this. Any help would be greatly appreciated.
Hi team,
Awesome work, really like the paper.
I've found a couple of issues with the TempVMPackingEnv environment (VMPacking-v1).
The main one is that the custom logic of the step method was definied as
step()
instead of_STEP()
and so steps in the environment were actually using_STEP()
for the parent class. There's is also a small indexing error when demand is being removed from a PM, and I think it would be helpful to also round down any remaining use below tolerance to zero.There was also an issue in the
_RESET()
method, wherestate
was being created as an array istead of a dict, and so updates to the state, based on dict keys, did not work.Proposed fixes below, with a comment followed by my initials (JMF) and an explanation for each changed/added line. Happy to raise a pull request if helpful.
The text was updated successfully, but these errors were encountered: