Closed nosound2 closed 2 years ago
lll take a look when i can
Points 7 and 9 influence the training.
Point 9 is a significant bug in carts, which makes them move much slower.
Point 7 is even more serious, it makes the first two initial units (from the two teams) to share the cargo. This is a major bug. I think the next units are already created with their own separate cargos.
Could you add (for some reason I had to pip install attrs
to setup.py
please?pytest
even though it's in the setup) The other tests are based on unittest
, running pytest
in the directory will trigger all tests :-)
Tests look good :rocket: !
Could you add
attrs
tosetup.py
please? (for some reason I had to pip installpytest
even though it's in the setup) The other tests are based onunittest
, runningpytest
in the directory will trigger all tests :-)Tests look good 🚀 !
What is attrs
? Can't find it in the code.
Hm, my bad I think it's installed by pytest
automatically. Sorry about that :sweat_smile:
Hello, @glmcdona , @royerk , @StoneT2000 please take a look at this pull request, it includes the following changes (in order of appearance in the compare).
In summary, it allows replaying episodes downloaded from Kaggle leaderboard, and checks that the states are the same. Added the corresponding pytest for 7 replays. And fixed some bugs encountered along the way.
replay
argument toclass Agent
which is a full episode replay as can be downloaded fromhttps://www.kaggle.com/robga/simulations-episode-scraper-match-downloader
If a replay is present, this default agent will answer with the actions from the replay.replay_validate
argument toclass LuxEnvironment
andclass MatchController
. Inrun_to_next_observation
method after each turn it will validate that the game state is exactly identical to the state provided in the replay. This is the main thing in this pull request, it allows strong testing of the engine.run_no_learn
toclass LuxEnvironment
which will run an episode, but it only works in case there are no learning agents. It is needed to run two replay agents as a simulation.constants.py
class Game
cutting out a newprocess_updates
function, which now can not only assign updates but also validate updates. This list of updates is what we get in the replays, andprocess_updates
is where we check that the map state is exactly the same.action_from_command
. Needed to call it with different arguments, and some more minor changes there.{"wood": 0, "uranium": 0, "coal": 0}
toNone
. It is a bugfix, in some cases the same cargo dictionary was shared between couple of units. Remember, not a good idea to use lists and dictionaries as default arguments.spawn_city_tile
changedcity_ids_found
from set to a list. This was a nasty bug which produces randomness in tests, because sets are not guaranteed to keep order.class Cart
methodturn
removed a duplicated cooldown subtraction.replays_for_tests
.test_run_replay
.Let me know if something looks wrong!