Skip to content

[Scenario] New football #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 101 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
4c5b3b2
amend
matteobettini May 20, 2024
150c8bb
amend
matteobettini May 20, 2024
e6dda52
amend
matteobettini May 21, 2024
ee527ca
amend
matteobettini May 21, 2024
3033e11
amend
matteobettini May 22, 2024
e12945f
amend
matteobettini May 28, 2024
d1c3323
observe teammates
matteobettini May 30, 2024
c04c2af
Merge branch 'refs/heads/main' into football
matteobettini May 30, 2024
5f72538
rendering
matteobettini May 31, 2024
6101bf6
improved football ai
Acciorocketships Jun 3, 2024
18f1cf8
improved football ai
Acciorocketships Jun 3, 2024
575fb3a
improved football ai
Acciorocketships Jun 3, 2024
0cee4d5
reformat
Acciorocketships Jun 3, 2024
c871f45
Merge branch 'refs/heads/main' into dev
matteobettini Jun 3, 2024
e90bc30
Merge branch 'refs/heads/main' into football
matteobettini Jun 3, 2024
9d72f11
Align with main
matteobettini Jun 3, 2024
150f28a
ryan improvememnts
matteobettini Jun 3, 2024
e9b3de9
amend
matteobettini Jun 3, 2024
bcf2c4b
test
matteobettini Jun 3, 2024
9340904
fixes
matteobettini Jun 3, 2024
f28e6f5
params
matteobettini Jun 3, 2024
df062dd
params
matteobettini Jun 3, 2024
b2ada90
amend
matteobettini Jun 10, 2024
d01b959
Merge branch 'refs/heads/main' into football
matteobettini Jun 11, 2024
9cc61f3
dict obs optional
matteobettini Jun 11, 2024
a39164f
amend
matteobettini Jun 12, 2024
5df3d11
rendering trick
matteobettini Jun 12, 2024
5508dfe
amend
matteobettini Jun 17, 2024
72a8717
amend
matteobettini Jun 18, 2024
18bf3cc
Merge branch 'refs/heads/main' into football
matteobettini Jun 25, 2024
6544d99
minor fixes
matteobettini Jun 25, 2024
f3c59a5
Merge branch 'refs/heads/main' into football
matteobettini Jun 25, 2024
d1a5f45
refactor configs
matteobettini Jun 25, 2024
2c81f83
amend
matteobettini Jun 25, 2024
6b11213
Merge branch 'refs/heads/main' into football
matteobettini Jun 25, 2024
42296db
[BugFix] More resilient interactive_rendering.py
matteobettini Jun 25, 2024
179a82a
amend
matteobettini Jun 25, 2024
21fc167
amend
matteobettini Jun 25, 2024
5bfc54c
amend
matteobettini Jun 25, 2024
b6e3939
amend
matteobettini Jun 25, 2024
8de34a2
amend
matteobettini Jun 25, 2024
dc5b465
amend
matteobettini Jun 25, 2024
7d7b355
amend
matteobettini Jun 25, 2024
096c926
amend
matteobettini Jun 25, 2024
70a9ffa
Merge branch 'refs/heads/main' into football
matteobettini Jun 26, 2024
9054358
merge main fix
matteobettini Jun 26, 2024
da80a72
amend
matteobettini Jun 26, 2024
b2d6150
amend
matteobettini Jun 27, 2024
b8d999e
amend
matteobettini Jun 28, 2024
15f8156
amend
matteobettini Jun 28, 2024
c79293c
amend
matteobettini Jun 28, 2024
02d6db0
red symmetric
matteobettini Jun 28, 2024
b7cc0be
amend
matteobettini Jun 28, 2024
6b21257
amend
matteobettini Jun 28, 2024
a04b7b5
value improvements
Acciorocketships Jul 3, 2024
3fd28ff
better movements
Acciorocketships Jul 3, 2024
2b63b3e
update separations
Acciorocketships Jul 3, 2024
b17748d
Only closest agent shoots
matteobettini Jul 3, 2024
3ae46d2
Merge branch 'football' into dev
Acciorocketships Jul 3, 2024
d1c649f
amend
matteobettini Jul 4, 2024
52d3b4f
added shooting
Acciorocketships Jul 4, 2024
c14a109
Merge branch 'football' into dev
Acciorocketships Jul 4, 2024
4bd0e55
improved dribbling and defending
Acciorocketships Jul 4, 2024
32abe38
added strength params
Acciorocketships Jul 4, 2024
f05fa71
speed optimisation
Acciorocketships Jul 5, 2024
52932b7
strength parameters can be tuples
Acciorocketships Jul 5, 2024
65910f1
amend
matteobettini Jul 8, 2024
1ec8c59
amend
matteobettini Jul 8, 2024
b539431
amend
matteobettini Jul 8, 2024
4c8b878
amend
matteobettini Jul 8, 2024
0ceaefa
amend
matteobettini Jul 8, 2024
c70ac3d
amend
matteobettini Jul 8, 2024
e66913d
amend
matteobettini Jul 8, 2024
888cacc
amend
matteobettini Jul 8, 2024
3b3eac2
amend
matteobettini Jul 8, 2024
35b1522
amend
matteobettini Jul 8, 2024
714e054
fix hermite
matteobettini Jul 9, 2024
6c59595
fix hermite
matteobettini Jul 9, 2024
c08a438
add rendering standard deviation
matteobettini Jul 9, 2024
0a967dd
add rendering ellipse
matteobettini Jul 9, 2024
4d80b27
Merge branch 'refs/heads/main' into football
matteobettini Jul 10, 2024
566b53d
formation
matteobettini Jul 12, 2024
4443903
rendering radius
matteobettini Jul 12, 2024
2adee3b
physically different
matteobettini Jul 30, 2024
0c07dca
physically different
matteobettini Jul 31, 2024
5bf95cc
physically different
matteobettini Jul 31, 2024
2200009
render agent index
matteobettini Aug 1, 2024
0d8c81b
indices
matteobettini Aug 20, 2024
786a892
agent color
matteobettini Aug 20, 2024
b1066a4
amend
matteobettini Aug 21, 2024
04bcea6
more info
matteobettini Sep 9, 2024
a99b7cd
randomise agent indices
matteobettini Sep 9, 2024
d35c4cb
amend
matteobettini Sep 17, 2024
aaaf481
amend
matteobettini Sep 17, 2024
1515cf8
restore example
matteobettini Dec 22, 2024
7916afc
plot rotations
matteobettini Dec 22, 2024
ebb451c
param docs
matteobettini Dec 22, 2024
f0f2b01
docs
matteobettini Dec 22, 2024
08a5731
remove dico stuff
matteobettini Dec 22, 2024
91346c1
Merge branch 'main' into football
matteobettini Jan 29, 2025
24679e7
Merge branch 'main' into football
matteobettini Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions tests/test_scenarios/test_football.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ def setup_env(self, n_envs, **kwargs) -> None:
)
self.env.seed(0)

@pytest.mark.skipif(not sys.platform.startswith("linux"), reason="Test needs linux")
def test_ai_vs_random(self, n_envs=4, n_agents=3):
@pytest.mark.skipif(
sys.platform.startswith("win32"), reason="Test does not work on windows"
)
def test_ai_vs_random(self, n_envs=4, n_agents=3, scoring_reward=1):
self.setup_env(
n_red_agents=n_agents,
n_blue_agents=n_agents,
ai_red_agents=True,
ai_blue_agents=False,
dense_reward_ratio=0,
dense_reward=False,
n_envs=n_envs,
scoring_reward=scoring_reward,
)
all_done = torch.full((n_envs,), False)
obs = self.env.reset()
Expand All @@ -49,10 +52,10 @@ def test_ai_vs_random(self, n_envs=4, n_agents=3):
total_rew[:, i] += rews[i]
if dones.any():
# Done envs should have exactly sum of rewards equal to num_agents
actual_rew = -1 * n_agents
actual_rew = -scoring_reward * n_agents
assert torch.equal(
total_rew[dones].sum(-1).to(torch.long),
torch.full((dones.sum(),), actual_rew),
torch.full((dones.sum(),), actual_rew, dtype=torch.long),
)
total_rew[dones] = 0
all_done += dones
Expand Down
Loading