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

Bubble Can Fail to have Any Hijacked Vehicles #417

Closed
2 tasks done
Gamenot opened this issue Jan 13, 2021 · 0 comments · Fixed by #553
Closed
2 tasks done

Bubble Can Fail to have Any Hijacked Vehicles #417

Gamenot opened this issue Jan 13, 2021 · 0 comments · Fixed by #553
Assignees
Labels
bug Something isn't working

Comments

@Gamenot
Copy link
Collaborator

Gamenot commented Jan 13, 2021

The current implementation of Bubble class limits the number of newly hijacked vehicles to all the vehicles in both airlock and the bubble proper.

While this is useful for performance reasons, it is not particularly intuitive since vehicles can just sit in the airlock and not contribute to the simulation.

See:

if self._limit is not None:
# Already hijacked (according to VehicleIndex) + to be hijacked (running cursors)
current_hijacked_or_shadowed_vehicle_ids = {
v_id
for v_id in vehicle_ids_in_bubbles[self]
if index.vehicle_is_hijacked(v_id) or index.vehicle_is_shadowed(v_id)
}
per_bubble_veh_ids = BubbleManager.vehicle_ids_per_bubble(
frozenset(running_cursors)
)
running_hijacked_or_shadowed_vehicle_ids = per_bubble_veh_ids[self]
all_hijacked_or_shadowed_vehicle_ids = (
current_hijacked_or_shadowed_vehicle_ids
| running_hijacked_or_shadowed_vehicle_ids
) - {vehicle_id}
if len(all_hijacked_or_shadowed_vehicle_ids) >= self._limit:
return False

AC:

  • Bubble limit applies to the current number of unreleased vehicles the bubble has currently captured.
  • Bubble tries to have the given number of agents hijacked.
@Gamenot Gamenot added the bug Something isn't working label Jan 13, 2021
@Gamenot Gamenot added this to the 0.5 milestone Jan 14, 2021
@Gamenot Gamenot self-assigned this Jan 22, 2021
@JingfeiPeng JingfeiPeng self-assigned this Jan 22, 2021
@Gamenot Gamenot modified the milestones: 0.5, Backlog Jan 27, 2021
@Gamenot Gamenot changed the title Bubble Hijack Limit is Simulation Scope Bubble Can Fail to have Any Hijacked Vehicles Jan 29, 2021
@Gamenot Gamenot closed this as completed Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants