
REMOTE_ADDRESS = "not_assigned"

PROJECT_PATH = "./.."
EXTRA_PATH = ""
PROJECT_REMOTE_ABSOLUTE_PATH = "not_assigned"

def SET_EXTRA_PATH(extra_path):
    global EXTRA_PATH
    EXTRA_PATH = extra_path

##################### IDs #####################

IDS = PROJECT_PATH+"/ids"

IDS_REMOTE_ABSOLUTE_PATH = "not_assigned"

IDS_HYPERPARAMS = IDS + "/hyperparams"
IDS_EXP_PARAMS  = IDS + "/exp_params"
IDS_EXP_PARAMS_STRUCTURE = ["env", "trainer", "corpus", "seed"]

HYPERPARAMS_IDS_REMOTE_ABSOLUTE_PATH = "not_assigned"
EXP_PARAMS_REMOTE_ABSOLUTE_PATH = "not_assigned"

##################### BANK #####################

BANK = PROJECT_PATH+"/bank"

BANK_EXP_PARAMS = BANK + "/exp_params"
BANK_EXP_PARAMS_ENV     = BANK_EXP_PARAMS + "/env"
BANK_EXP_PARAMS_TRAINER = BANK_EXP_PARAMS + "/trainer"
BANK_EXP_PARAMS_LOGGER  = BANK_EXP_PARAMS + "/logger"

BANK_EXTRA_PARAMS = BANK + "/extra_params"
BANK_EXTRA_PARAMS_TRAINER  = BANK_EXTRA_PARAMS + "/trainer"
BANK_EXTRA_PARAMS_LOGGER   = BANK_EXTRA_PARAMS + "/logger"

BANK_HYPERPARAMS = BANK + "/hyperparams"
BANK_HYPERPARAMS_ARCH          = BANK_HYPERPARAMS + "/arch"
BANK_HYPERPARAMS_GNN_ARCH      = BANK_HYPERPARAMS_ARCH + "/gnn_arch"
BANK_HYPERPARAMS_FEEDBACK_ARCH = BANK_HYPERPARAMS_ARCH + "/feedback_arch"
BANK_HYPERPARAMS_TIME_ARCH     = BANK_HYPERPARAMS_ARCH + "/time_arch"
BANK_HYPERPARAMS_WORD_FEATURES = BANK_HYPERPARAMS + "/word_features"


##################### RESULTS #####################

RESULTS = PROJECT_PATH+"/results"
RESULTS_REMOTE_ABSOLUTE_PATH = "not_assigned"

RESULTS_STRUCTURE = ["exp_params", "hyperparams"]
RESULTS_TRAIN = "/train/env_ep"
RESULTS_TEST  = "/test/env_step"


############### GRIDSEARCH REPORTS ###############

GRIDSEARCH_REPORTS = PROJECT_PATH+"/gridsearch_reports"
GRIDSEARCH_REPORTS_REMOTE_ABSOLUTE_PATH = "not_assigned"


##################### CORPUS #####################

CORPUS_DATA = PROJECT_PATH+"/corpus_data"
CORPUS_DATA_STRUCTURE = ["corpus", "feature_type", "folder"]


##################### CONFIG #####################

CONFIG = PROJECT_PATH+"/config"
CONFIG_HYPERPARAMS          = CONFIG+"/hyperparams"
CONFIG_EXP_PARAMS           = CONFIG+"/exp_params"
CONFIG_EXTRA_PARAMS         = CONFIG+"/extra_params"
CONFIG_VISUALIZATION_PARAMS = CONFIG+"/visualization_params"

## EXP PARAMS ##
CONFIG_EXP_PARAMS_ENV     =  "env"
CONFIG_EXP_PARAMS_TRAINER =  "trainer"
EXP_PARAMS_BANK_CONNECTOR = {
    CONFIG_EXP_PARAMS_ENV: BANK_EXP_PARAMS_ENV,
    CONFIG_EXP_PARAMS_TRAINER: BANK_EXP_PARAMS_TRAINER,
}

## EXTRA PARAMS ##
CONFIG_EXTRA_PARAMS_TRAINER = "trainer"
CONFIG_EXTRA_PARAMS_LOGGER  = "logger"
EXTRA_PARAMS_BANK_CONNECTOR = {
    CONFIG_EXTRA_PARAMS_TRAINER: BANK_EXTRA_PARAMS_TRAINER,
    CONFIG_EXTRA_PARAMS_LOGGER: BANK_EXTRA_PARAMS_LOGGER
}

## HYPERPARAMS ##

# GNN AGENT
GNN_AGENT = "gnn_agent"
CONFIG_HYPERPARAMS_GNN_ARCH      = GNN_AGENT+"/general/gnn_arch"
CONFIG_HYPERPARAMS_FEEDBACK_ARCH = GNN_AGENT+"/general/feedback_arch"
CONFIG_HYPERPARAMS_TIME_ARCH     = GNN_AGENT+"/general/time_arch"
ARCH_CONNECTOR = {
    CONFIG_HYPERPARAMS_GNN_ARCH: BANK_HYPERPARAMS_GNN_ARCH,
    CONFIG_HYPERPARAMS_FEEDBACK_ARCH: BANK_HYPERPARAMS_FEEDBACK_ARCH,
    CONFIG_HYPERPARAMS_TIME_ARCH: BANK_HYPERPARAMS_TIME_ARCH
}
MIDDLE_DIM                = GNN_AGENT+"/general/middle_dim"
CONFIG_HYPERPARAMS_LAYERS = GNN_AGENT+"/layers"
CONFIG_HYPERPARAMS_GNN_LAYERS_GENERALCONV = CONFIG_HYPERPARAMS_LAYERS+"/GeneralConv"
CONFIG_HYPERPARAMS_GNN_LAYERS_GENERALCONV_ATTENTION_TYPE = CONFIG_HYPERPARAMS_GNN_LAYERS_GENERALCONV+"/attention_type"
CONFIG_HYPERPARAMS_GNN_LAYERS_GENERALCONV_HEADS = CONFIG_HYPERPARAMS_GNN_LAYERS_GENERALCONV+"/heads"
CONFIG_HYPERPARAMS_GNN_LAYERS_GENERALCONV_AGGR = CONFIG_HYPERPARAMS_GNN_LAYERS_GENERALCONV+"/aggr"

## RL ALGO ##
CONFIG_HYPERPARAMS_RL_ALGO = "rl_algo"
CONFIG_HYPERPARAMS_POLICY_NAME     = CONFIG_HYPERPARAMS_RL_ALGO+"/general/policy"
CONFIG_HYPERPARAMS_LEARNING_RATE   = CONFIG_HYPERPARAMS_RL_ALGO+"/general/lr"
CONFIG_HYPERPARAMS_POLICIES_PARAMS = CONFIG_HYPERPARAMS_RL_ALGO+"/policy_params"
CONFIG_HYPERPARAMS_POLICY_PARAMS_CONNECTOR = {CONFIG_HYPERPARAMS_POLICY_NAME:CONFIG_HYPERPARAMS_POLICIES_PARAMS}
CONFIG_HYPERPARAMS_TRAINER_PARAMS  = CONFIG_HYPERPARAMS_RL_ALGO+"/trainer_params"
CONFIG_HYPERPARAMS_TRAINER_PARAMS_ONPOLICY_TRAINER = CONFIG_HYPERPARAMS_TRAINER_PARAMS+"/onpolicy_trainer"
CONFIG_HYPERPARAMS_BATCH_SIZE = CONFIG_HYPERPARAMS_TRAINER_PARAMS +"/batch_size"
CONFIG_HYPERPARAMS_REPEAT_PER_COLLECT = CONFIG_HYPERPARAMS_TRAINER_PARAMS + "/repeat_per_collect"
CONFIG_HYPERPARAMS_STEP_PER_COLLECT   = CONFIG_HYPERPARAMS_TRAINER_PARAMS + "/step_per_collect"

## FEEDBACKS ##
CONFIG_HYPERPARAMS_FEEDBACKS = "/feedbacks"
CONFIG_HYPERPARAMS_FEEDBACK_MODE = CONFIG_HYPERPARAMS_FEEDBACKS + "/feedback_mode"

## NODES FEATURES ##
CONFIG_HYPERPARAMS_NODE_FEATURES = "/node_features"
CONFIG_HYPERPARAMS_WORD_FEATURES  = CONFIG_HYPERPARAMS_NODE_FEATURES + "/features_params"
CONFIG_HYPERPARAMS_WORD_ENCODING  = CONFIG_HYPERPARAMS_WORD_FEATURES + "/feature_type"
CONFIG_HYPERPARAMS_WORD_FEATURES_CONNECTOR = {CONFIG_HYPERPARAMS_WORD_FEATURES: BANK_HYPERPARAMS_WORD_FEATURES}
CONFIG_HYPERPARAMS_DOC_ENCODING = CONFIG_HYPERPARAMS_NODE_FEATURES + "/doc_encoding"

## TIME ##
CONFIG_HYPERPARAMS_TIME      = "/time"
CONFIG_HYPERPARAMS_TIME_MODE = CONFIG_HYPERPARAMS_TIME + "/time_mode"