Skip to content
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

Let updated present mask overwrite no reentry mask #68

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions torchdrivesim/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2139,11 +2139,13 @@ def update_exposed_agents(self):
self.proximal_timesteps = self.across_agent_types(
lambda x, y: x.mul(y), self.proximal_timesteps, self.previous_present_mask
)
self.update_present_mask(self.get_present_mask())
present_mask = self.get_present_mask()
self.inner_simulator.update_present_mask(present_mask)
self.previous_present_mask = self.agent_functor(torch.logical_and, present_mask, self.previous_present_mask)

def update_present_mask(self, present_mask):
self.inner_simulator.update_present_mask(present_mask)
self.previous_present_mask = self.agent_functor(torch.logical_and, present_mask, self.previous_present_mask)
self.previous_present_mask = present_mask

def get_present_mask(self):
present_mask = super().get_present_mask()
Expand Down