opendilab / GoBigger

[ICLR 2023] Come & try Decision-Intelligence version of "Agar"! Gobigger could also help you with multi-agent decision intelligence study.
https://gobigger.readthedocs.io/en/latest/
Apache License 2.0
457 stars 34 forks source link

ValueError: Can't normalize Vector of length Zero #20

Closed simsimiSION closed 2 years ago

simsimiSION commented 2 years ago

File "/gobigger/balls/clone_ball.py", line 152, in move self.direction = (self.vel + self.vel_last).normalize()

mingzhang96 commented 2 years ago

Thanks for your issue! I check the related code:

if self.vel.length() > 0 or self.vel_last.length() > 0:
    self.direction = (self.vel + self.vel_last).normalize()

This error may be caused by the situation that (self.vel + self.vel_last).length == 0. We can prevent this by adding more judgments.