Files
MAGAIL4AutoDrive/Env/simple_idm_policy.py

14 lines
364 B
Python
Raw Normal View History

2025-09-28 18:57:04 +08:00
import numpy as np
class ConstantVelocityPolicy:
def __init__(self, target_speed=50):
self.step_num = 0
def act(self):
self.step_num += 1
# 简单的前进策略:直行 + 较大油门
steering = 0.0 # 直行
throttle = 0.5 # 中等油门,让车辆有明显运动
return [steering, throttle]