Skip to content

Commit

Permalink
update month env
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangjingzhi2003 committed Nov 25, 2024
1 parent cfbb2a7 commit 76aab50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rl4greencrab/envs/green_crab_monthly_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def step(self,action):
else:
size_freq[:] = [np.random.binomial(n=self.monthly_size[k].tolist(), p=self.pmort) for k in range(self.nsize)]
removed[:] = [np.random.binomial(size_freq[k].tolist(), harvest_rate[k]) for k in range(self.nsize)]
self.monthly_size = self.gm_ker@(size_freq[:] - removed[:]) # calculate for next month
self.monthly_size = self.gm_ker@(size_freq[:] - removed[:]) # calculate for greencrab pop for next month

#record the catch in the observation space
self.observations[0] = np.sum(removed[:,0])
Expand Down Expand Up @@ -185,7 +185,7 @@ def step(self,action):

def reset(self, *, seed=42, options=None):
self.state = self.init_state()
self.years_passed = 0
self.month_passed = 0

# for tracking only
self.reward = 0
Expand Down

0 comments on commit 76aab50

Please sign in to comment.