1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| class OOP_Scenario_Generator: """ OOP测试场景生成器 检测目标: - 乘员姿态异常 - 气囊区域占用 - 安全带误用 """ def generate_oop_scenarios(self): """ 生成OOP场景 异常姿态类型: - 躺在座椅上 - 身体前倾 - 脚放仪表盘 - 儿童站立 """ poses = [ {'name': 'reclined', 'angle': 60, 'risk': 'airbag'}, {'name': 'leaning_forward', 'distance': 0.3, 'risk': 'airbag'}, {'name': 'feet_on_dash', 'body_part': 'feet', 'risk': 'airbag'}, {'name': 'child_standing', 'position': 'standing', 'risk': 'airbag'}, {'name': 'sleeping_slumped', 'head_angle': 45, 'risk': 'seatbelt'} ] scenarios = [] for pose in poses: scenario = { 'pose_type': pose['name'], 'risk_factor': pose['risk'], 'occupant_types': ['adult_male', 'adult_female', 'child'], 'lighting': ['day', 'night'], 'duration': 5 } scenarios.append(scenario) return scenarios
|