def _calculate_num_moving_objects(scenario):
        """Calculate the number of moving objects, whose moving distance > 1m in this scenario."""
        # moving object
        number_summary_dict = {
            ScenarioDescription.SUMMARY.NUM_MOVING_OBJECTS: 0,
            ScenarioDescription.SUMMARY.NUM_MOVING_OBJECTS_EACH_TYPE: defaultdict(int)
        }
        for v in scenario[ScenarioDescription.METADATA][ScenarioDescription.SUMMARY.OBJECT_SUMMARY].values():

            # Fix a tiny compatibility issue
            if ScenarioDescription.SUMMARY.MOVING_DIST not in v:
                v[ScenarioDescription.SUMMARY.MOVING_DIST] = v['distance']

            if v[ScenarioDescription.SUMMARY.MOVING_DIST] > 1:
                number_summary_dict[ScenarioDescription.SUMMARY.NUM_MOVING_OBJECTS] += 1
                number_summary_dict[ScenarioDescription.SUMMARY.NUM_MOVING_OBJECTS_EACH_TYPE][v["type"]] += 1
        return number_summary_dict
Calculate the number of moving objects, whose moving distance > 1m in this scenario.
metadrive/scenario/scenario_description.py