def warmup(self):
        """
        This function automatically initialize models/objects. It can prevent the lagging when creating some objects
        for the first time.
        """
        if self.global_config["preload_models"] and self.mode != RENDER_MODE_NONE:
            from metadrive.component.traffic_participants.pedestrian import Pedestrian
            from metadrive.component.traffic_light.base_traffic_light import BaseTrafficLight
            from metadrive.component.static_object.traffic_object import TrafficBarrier
            from metadrive.component.static_object.traffic_object import TrafficCone
            Pedestrian.init_pedestrian_model()
            warm_up_pedestrian = self.spawn_object(Pedestrian, position=[0, 0], heading_theta=0, record=False)
            warm_up_light = self.spawn_object(BaseTrafficLight, lane=None, position=[0, 0], record=False)
            barrier = self.spawn_object(TrafficBarrier, position=[0, 0], heading_theta=0, record=False)
            cone = self.spawn_object(TrafficCone, position=[0, 0], heading_theta=0, record=False)
            for vel in Pedestrian.SPEED_LIST:
                warm_up_pedestrian.set_velocity([1, 0], vel - 0.1)
                self.taskMgr.step()
            self.clear_objects([warm_up_pedestrian.id, warm_up_light.id, barrier.id, cone.id], record=False)
            warm_up_pedestrian = None
            warm_up_light = None
            barrier = None
            cone = None

        This function automatically initialize models/objects. It can prevent the lagging when creating some objects
        for the first time.
        
metadrive/engine/base_engine.py