<filename>pistarlab/meta.py
#DB Fields
from typing import Any, Dict, Tuple
F_UID = "uid"
F_TYPE = "type"
F_IDX = "idx"
F_META = "meta"
F_COMPONENTS = "components"
F_JOB_DATA = "job_data"
F_INFO = "info"
F_PARENT_INFO = "parent_info"
F_DEF = "def"
F_CHILDREN = "children"
F_FILE_SOURCE_SNAPSHOT = "file_source_snapshot"

F_entity_type = "entity_type"
F_CLASS_NAME = "class_name"
F_MODULE = "module"
F_LABEL = "label"
F_TAGS = "tags"
F_CREATION_TIME = "creation_time"
F_STATE = "state"
F_JOB_DATA = "job_data"
F_TIMESTAMP = "timestamp"
F_MSG = "msg"
F_CODE_INFO = "code_info"
F_SYS_CONFIG = "sys_config"
F_SPEC_ID = "spec_id"


F_HEARTBEAT_SEC = "heartbeat_sec"
F_LOGGED_FIELDS = "logged_fields"


#JOB/TASK states
STATE_SUBMITTED = "SUBMITTED"
STATE_CREATED = "CREATED"
STATE_STARTED = "STARTED"
STATE_TERMINATED = "TERMINATED"
STATE_COMPLETED = "COMPLETED"
STATE_RUNNING = "RUNNING"
STATE_ERROR = "ERROR"
STATE_ABORTED = "ABORTED"
STATE_SHUTDOWN = "SHUTDOWN"


ENV_ENTITY = "environment"
ENV_SPEC_ENTITY = "env_spec"
AGENT_ENTITY = "agent"
AGENT_SPEC_ENTITY = "agent_spec"
MODEL_ENTITY = "model"
COMPONENT_SPEC_ENTITY = "component_spec"
COMPONENT_ENTITY = "component"
SESSION_ENTITY = "session"
EPISODE_ENTITY = "episode"
TASK_ENTITY = "task"
TASK_SPEC_ENTITY = "task_spec"


SYS_CONFIG_DIR = "sys_config"

ENTITY_ID_PREFIX_LOOKUP = {}
ENTITY_ID_PREFIX_LOOKUP[ENV_ENTITY] = "E"
ENTITY_ID_PREFIX_LOOKUP[COMPONENT_ENTITY] = "C"
ENTITY_ID_PREFIX_LOOKUP[AGENT_ENTITY] = "A"
ENTITY_ID_PREFIX_LOOKUP[SESSION_ENTITY] = "S"
ENTITY_ID_PREFIX_LOOKUP[EPISODE_ENTITY] = "EP"
ENTITY_ID_PREFIX_LOOKUP[TASK_ENTITY] = "T"

RL_MULTIPLAYER_MULTIAGENT_SESS = "RL_MULTIPLAYER_MULTIAGENT_SESS"
RL_MULTIPLAYER_SINGLEAGENT_SESS = "RL_MULTIPLAYER_SINGLEAGENT_SESS"
RL_SINGLEPLAYER_BATCHED_SESS = "RL_SINGLEPLAYER_BATCHED_SESS"
RL_SINGLEPLAYER_SESS = "RL_SINGLEPLAYER_SESS"
DATA_SESSION = "DATA_SESSION"

SESSION_TYPES = [
    RL_MULTIPLAYER_MULTIAGENT_SESS,
    RL_MULTIPLAYER_SINGLEAGENT_SESS,
    RL_SINGLEPLAYER_BATCHED_SESS,
    RL_SINGLEPLAYER_SESS,
    DATA_SESSION]

RL_MULTIPLAYER_ENV = "RL_MULTIPLAYER_ENV"
RL_SINGLEPLAYER_ENV = "RL_SINGLEPLAYER_ENV"
DATA_ENV = "DATA_ENV"

ENV_TYPES = [RL_MULTIPLAYER_ENV, RL_SINGLEPLAYER_ENV, DATA_ENV]

DEFAULT_SESSION_SPEC_ID = "default"

TRACKED_ENTITIES = 'TRACKED_ENTITIES'

DEFAULT_REDIS_PASSWORD = "<PASSWORD>"

DataDict = Dict[str, Any]
