Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Cooperative Cuisine Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Social Cognitive Systems
CoCoSy
Cooperative Cuisine Environment
Commits
450fcefb
Commit
450fcefb
authored
1 year ago
by
Florian Schröder
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/81-gui-player-management' into 81-gui-player-management
parents
3f7420e4
40844976
No related branches found
No related tags found
1 merge request
!44
Resolve "GUI Player Management"
Pipeline
#45534
failed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
overcooked_simulator/overcooked_environment.py
+6
-10
6 additions, 10 deletions
overcooked_simulator/overcooked_environment.py
with
6 additions
and
10 deletions
overcooked_simulator/overcooked_environment.py
+
6
−
10
View file @
450fcefb
...
...
@@ -414,6 +414,7 @@ class Environment:
],
dtype
=
float
,
)
number_players
=
len
(
player_positions
)
targeted_positions
=
player_positions
+
(
player_movement_vectors
*
(
self
.
player_movement_speed
*
d_time
)
...
...
@@ -428,11 +429,7 @@ class Environment:
player_positions
[:,
np
.
newaxis
,
:]
-
player_positions
[
np
.
newaxis
,
:,
:]
)
collision_idxs
=
distances_players_after_scipy
<
(
2
*
self
.
player_radius
)
eye_idxs
=
np
.
eye
(
distances_players_after_scipy
.
shape
[
0
],
distances_players_after_scipy
.
shape
[
1
],
dtype
=
bool
,
)
eye_idxs
=
np
.
eye
(
number_players
,
number_players
,
dtype
=
bool
)
collision_idxs
[
eye_idxs
]
=
False
# Player push players around
...
...
@@ -497,11 +494,10 @@ class Environment:
# new_positions[collision_idxs] = player_positions[collision_idxs]
# Collisions player world borders
new_positions
=
np
.
max
(
[
new_positions
,
self
.
world_borders_lower
+
self
.
player_radius
],
axis
=
0
)
new_positions
=
np
.
min
(
[
new_positions
,
self
.
world_borders_upper
-
self
.
player_radius
],
axis
=
0
new_positions
=
np
.
clip
(
new_positions
,
self
.
world_borders_lower
+
self
.
player_radius
,
self
.
world_borders_upper
-
self
.
player_radius
,
)
for
idx
,
p
in
enumerate
(
self
.
players
.
values
()):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment