motional / nuplan-devkit

The devkit of the nuPlan dataset.
https://www.nuplan.org
Other
662 stars 126 forks source link

Problem about the StepSimulationTimeController #336

Closed zheningy closed 1 year ago

zheningy commented 1 year ago

Describe the bug

In the below function in StepSimulationTimeController. If the index is in range(self.number_of_iterations()). It seems the reach_end condition should be self.current_iteration_index > self.number_of_iterations() - 1. Current implementation would lead to simulation always ending 1 step early.

def reached_end(self) -> bool:
    """Inherited, see superclass."""
    return self.current_iteration_index >= self.number_of_iterations() - 1
zheningy commented 1 year ago

@patk-motional Please check if this is a bug, thanks.

patk-motional commented 1 year ago

Hi @zheningy,

The first iteration is the 0th step. If the simulation has 100 iterations then there should be the 0th step up until the 99 step. Hence, the equality in the condition.