Skip to content

Commit

Permalink
VMAS-1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobettini committed Sep 21, 2024
1 parent 659c390 commit dc77a5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vmas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"mpe_scenarios",
]

__version__ = "1.4.2"
__version__ = "1.4.3"

scenarios = sorted(
[
Expand Down
7 changes: 6 additions & 1 deletion vmas/simulator/environment/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,19 @@ def step(self, actions: Union[List, Dict]):

def done(self):
terminated = self.scenario.done().clone()

if self.max_steps is not None:
truncated = self.steps >= self.max_steps
else:
truncated = torch.zeros_like(terminated)
truncated = None

if self.terminated_truncated:
if truncated is None:
truncated = torch.zeros_like(terminated)
return terminated, truncated
else:
if truncated is None:
return terminated
return terminated + truncated

def get_action_space(self):
Expand Down

0 comments on commit dc77a5f

Please sign in to comment.