#! /usr/bin/env python
# _*_ coding: utf-8 _*_
"""
author:     Chen XuHui
date:       2024/7/3
file:       typings.py
version:
doc:        类型声明.
"""
from typing import Any, Callable, Dict, Union

import numpy as np
from ray.rllib.policy.policy import PolicySpec
from ray.rllib.utils.typing import (
    AlgorithmConfigDict, EnvConfigDict, EnvID, MultiAgentDict, PolicyID, TensorType,
)

__all__ = [
    'AlgorithmConfigDict',
    'EnvID',
    'EnvConfigDict',
    'PolicyID',
    'TensorType',
    'AgentID',
    'MultiAgentDict',
    'PolicySpec',
    'AgentMap',
    'Policies',
    'PolicyMap',
    'ActionArray',
    'ActionExe',
    'ObsArray',
    'AgentConfig',
    'ActionDict',
    'rad',
    'deg',
    'NumType'
]

AgentID = Union[str, int]
AgentConfig = dict
AgentMap = Dict[AgentID, Any]
Policies = Dict[PolicyID, Union[list, tuple, PolicySpec]]
PolicyMap = Callable[[Any, Any, Any], AgentID]

ActionArray = np.ndarray  # 智能体动作指令数组
ActionDict = Dict[AgentID, ActionArray]
ActionExe = Any  # 引擎可执行的智能体动作指令
ObsArray = TensorType  # 智能体观测信息数组, 能直接被神经网络模型处理

NumType = Union[int, float]  # 数字

rad = float  # 弧度
deg = NumType  # 角度
