From 8ae6116ffa80634f6e340cb52ad7bd25586dfe2b Mon Sep 17 00:00:00 2001 From: David Bloomin Date: Mon, 12 Jun 2023 17:00:55 -0700 Subject: [PATCH 1/2] make market_n_obs a constant --- nmmo/core/config.py | 8 ++------ tests/test_memory_usage.py | 9 +++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/nmmo/core/config.py b/nmmo/core/config.py index 5b824f4f..07d40ef7 100644 --- a/nmmo/core/config.py +++ b/nmmo/core/config.py @@ -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 diff --git a/tests/test_memory_usage.py b/tests/test_memory_usage.py index c0648c95..ab922052 100644 --- a/tests/test_memory_usage.py +++ b/tests/test_memory_usage.py @@ -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() \ No newline at end of file + test_memory_usage() From aa01ef8a80320aef56f9666b52e682632dba1ba9 Mon Sep 17 00:00:00 2001 From: David Bloomin Date: Mon, 12 Jun 2023 17:03:15 -0700 Subject: [PATCH 2/2] install psutil --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index ac649cd8..4610f677 100644 --- a/setup.py +++ b/setup.py @@ -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', ],