Skip to content

Commit 08a5731

Browse files
committed
remove dico stuff
1 parent f0f2b01 commit 08a5731

File tree

1 file changed

+1
-69
lines changed

1 file changed

+1
-69
lines changed

vmas/scenarios/football.py

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import typing
66
from typing import List
77

8-
import numpy as np
98
import torch
109
from torch import Tensor
1110

@@ -14,14 +13,7 @@
1413
from vmas.simulator.dynamics.holonomic import Holonomic
1514
from vmas.simulator.dynamics.holonomic_with_rot import HolonomicWithRotation
1615
from vmas.simulator.scenario import BaseScenario
17-
from vmas.simulator.utils import (
18-
Color,
19-
ScenarioUtils,
20-
TorchUtils,
21-
X,
22-
x_to_rgb_colormap,
23-
Y,
24-
)
16+
from vmas.simulator.utils import Color, ScenarioUtils, TorchUtils, X, Y
2517

2618
if typing.TYPE_CHECKING:
2719
from vmas.simulator.rendering import Geom
@@ -1570,66 +1562,6 @@ def extra_render(self, env_index: int = 0) -> "List[Geom]":
15701562
line.set_color(*color, alpha=agent._alpha)
15711563
geoms.append(line)
15721564

1573-
if (
1574-
hasattr(self, "alternative_actions")
1575-
and hasattr(self, "agents_uncertanties")
1576-
and not self.enable_shooting
1577-
):
1578-
for index, agent in enumerate(self.blue_agents):
1579-
uncertanty = self.agents_uncertanties[agent]
1580-
circle = rendering.make_ellipse(
1581-
uncertanty[X] / 10,
1582-
uncertanty[Y] / 10,
1583-
)
1584-
xform = rendering.Transform()
1585-
xform.set_translation(*agent.state.pos[env_index])
1586-
circle.add_attr(xform)
1587-
circle.set_color(*self.blue_color, alpha=0.2)
1588-
geoms.append(circle)
1589-
1590-
other_actions = self.alternative_actions[agent]
1591-
for i, action in enumerate(other_actions):
1592-
is_agent = index == i
1593-
line = rendering.Line(
1594-
agent.state.pos[env_index],
1595-
agent.state.pos[env_index]
1596-
+ action * 10 * agent.shape.circumscribed_radius(),
1597-
width=2,
1598-
)
1599-
if is_agent:
1600-
line.set_color(*self.blue_color)
1601-
geoms.append(line)
1602-
1603-
if hasattr(self, "agent_behavioral_distances"):
1604-
colors = x_to_rgb_colormap(
1605-
np.array(list(self.agent_behavioral_distances.values())),
1606-
low=0,
1607-
high=1,
1608-
)[:, :-1]
1609-
for i, agent in enumerate(self.blue_agents):
1610-
agent.color = colors[i]
1611-
1612-
if hasattr(self, "edge_radius") and self.ai_red_agents:
1613-
# Communication lines
1614-
for i, agent1 in enumerate(self.blue_agents):
1615-
for j, agent2 in enumerate(self.blue_agents):
1616-
if j <= i:
1617-
continue
1618-
agent_dist = torch.linalg.vector_norm(
1619-
agent1.state.pos - agent2.state.pos, dim=-1
1620-
)
1621-
if agent_dist[env_index] <= self.edge_radius:
1622-
color = Color.BLACK.value
1623-
line = rendering.Line(
1624-
(agent1.state.pos[env_index]),
1625-
(agent2.state.pos[env_index]),
1626-
width=1,
1627-
)
1628-
xform = rendering.Transform()
1629-
line.add_attr(xform)
1630-
line.set_color(*color)
1631-
geoms.append(line)
1632-
16331565
return geoms
16341566

16351567
def _get_background_geoms(self, objects):

0 commit comments

Comments
 (0)