Skip to content

Commit

Permalink
Merge pull request #75 from CarperAI/daveey-git-pr-7002-15907
Browse files Browse the repository at this point in the history
make market_n_obs a constant
  • Loading branch information
daveey authored Jun 13, 2023
2 parents 96713b5 + aa01ef8 commit 85b908a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 2 additions & 6 deletions nmmo/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,8 @@ class Exchange:
EXCHANGE_LISTING_DURATION = 5
'''The number of ticks, during which the item is listed for sale'''

@property
def MARKET_N_OBS(self):
# TODO(kywch): This is a hack. Check if the limit is reached
# pylint: disable=no-member
'''Number of distinct item observations'''
return self.PLAYER_N * self.EXCHANGE_LISTING_DURATION
MARKET_N_OBS = 1024
'''Number of distinct item observations'''

PRICE_N_OBS = 99 # make it different from PLAYER_N_OBS
'''Number of distinct price observations
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'pettingzoo==1.19.0',
'gym==0.23.0',
'pylint==2.16.0',
'psutil==5.9.3',
'py==1.11.0',
'tqdm<5',
],
Expand Down
9 changes: 5 additions & 4 deletions tests/test_memory_usage.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# pylint: disable=bad-builtin, unused-variable
import psutil

import nmmo

def test_memory_usage():
env = nmmo.Env()
process = psutil.Process()
print(process.memory_info().rss)
env = nmmo.Env()
process = psutil.Process()
print("memory", process.memory_info().rss)

if __name__ == '__main__':
test_memory_usage()
test_memory_usage()

0 comments on commit 85b908a

Please sign in to comment.