import os

# 根目录路径
ROOT_PATH = "/home/server/anaconda3/envs/vitual_XGJ/zhaoyuan-master_1118/zhaoyuan/"

# 路径配置
RAW_DATA_PATH = os.path.join(ROOT_PATH, "data/raw")
PROCESSED_DATA_PATH = os.path.join(ROOT_PATH, "data/processed")
CONFIG_PATH = os.path.join(ROOT_PATH, "config/data_process.yaml")
REPORT_PATH = os.path.join(ROOT_PATH, "result")
LOG_PATH = os.path.join(ROOT_PATH, "log/single_case.log")
SAFETY_CONFIG_PATH = os.path.join(ROOT_PATH, "models/safety/safety_config.yaml")
COMFORT_CONFIG_PATH = os.path.join(ROOT_PATH, "models/comfort/comfort_config.yaml")

# 安全指标列表
SAFETY_METRIC_LIST = [
    "TTC",
    "MTTC",
    "THW",
    "LonSD",
    "LatSD",
    "DRAC",
    "BTN",
    "STN",
    "collisionRisk",
    "collisionSeverity",
]

# 舒适性指标列表
COMFORT_METRIC_LIST = ["weaving", "shake", "cadence", "slamBrake", "slamAccelerate"]

COMFORT_INFO = [
    "simTime",
    "simFrame",
    "speedX",
    "speedY",
    "accelX",
    "accelY",
    "curvHor",
    "lightMask",
    "v",
    "lat_acc",
    "lon_acc",
    "time_diff",
    "lon_acc_diff",
    "lon_acc_roc",
    "speedH",
    "accelH",
]
# 交通事故类型列表
TRIFFIC_TYPE_LIST = [
    "higwayExceededSpeed_50",
    "higwayreverse",
    "higwayDrivingAgainst",
    "higwayDrivingLaneStopped",
    "higwayEmergencyLaneStopped",
    "emergencyLaneDriving",
    "trafficSignalViolation",
]
TRIFFIC_INFO = [
    "simTime",
    "simFrame",
    "speedX",
    "speedY",
    "accelX",
    "accelY",
    "curvHor",
    "lightMask",
    "v",
]
TRIFFIC_TYPE_LIST_MAP = {
    "higwayExceededSpeed_50": "超速",
    "higwayreverse": "逆行",
    "higwayDrivingAgainst": "会车",
    "higwayDrivingLaneStopped": "压线停车",
    "higwayEmergencyLaneStopped": "应急车道停车",
    "emergencyLaneDriving": "应急车道行驶",
    "trafficSignalViolation": "违章停车",
}
# 道路功能等级与描述的映射
ROAD_FUNCTION_LEVEL_MAP = {
    1: "高速",
    2: "城市快速路",
    3: "一般道路",
    # 可以根据需要增加更多的功能等级
}

# 时间配置
T0 = 0
T1 = 3
T2 = 5

# 数据质量等级
DATA_QUALITY_LEVEL_1 = 30
DATA_QUALITY_LEVEL_2 = 20

# 文件名配置
EGO_CAR_FILE = "EgoState.csv"
OBJECT_CAR_FILE = "ObjState.csv"

# 车辆参数配置
TC = 0.3  # 时间常数
RHO = 0.3  # 驾驶员制动反应时间（单位：秒）
EGO_ACCEL_MAX = 6  # 自车油门最大加速度（单位：m/s^2）
OBJ_DECEL_MAX = 8  # 前车刹车最大减速度（单位：m/s^2）
EGO_DECEL_MIN = 1  # 自车刹车最小减速度（单位：m/s^2，这里可能是ug的误写，应明确单位）
EGO_DECEL_LON_MAX = 8  # 自车纵向刹车最大减速度（单位：m/s^2）
EGO_DECEL_LAT_MAX = 1  # 自车横向刹车最大减速度（单位：m/s^2）


# 道路类型与描述的映射
ROAD_TYPE_MAP = {
    1: "无属性",
    2: "IC（高速出入路）",
    3: "JCT（高速连接）",
    # 可以根据需要增加更多的道路类型
}


LANE_TYPE_MAP = {
    1: "直行车道",
    2: "左转车道",
    3: "右转车道",
    4: "掉头车道",
    5: "停车位",
    6: "公交站台",
    7: "人行横道",
    8: "非机动车道",
    9: "自行车道",
    10: "其他",
}
