# Path: lib/actions.py
# ACTION_UP = "W"
# ACTION_DOWN = "S"
# ACTION_LEFT = "A"
# ACTION_RIGHT = "D"
# ACTION_UP_DOWN_NONE = "~WS"
# ACTION_LEFT_RIGHT_NONE = "~AD"
# ACTIONS_UP_DOWN = [ACTION_UP, ACTION_DOWN, ACTION_UP_DOWN_NONE]
# ACTIONS_LEFT_RIGHT = [ACTION_LEFT, ACTION_RIGHT, ACTION_LEFT_RIGHT_NONE]
# ALL_ACTIONS = ACTIONS_UP_DOWN + ACTIONS_LEFT_RIGHT
# ACTION_TO_KEY = {
#     ACTION_UP: "w",
#     ACTION_DOWN: "s",
#     ACTION_LEFT: "a",
#     ACTION_RIGHT: "d",
#     ACTION_UP_DOWN_NONE: None,
#     ACTION_LEFT_RIGHT_NONE: None
# }
# ACTION_UP_VECTOR_INDEX = 0
# ACTION_DOWN_VECTOR_INDEX = 1
# ACTION_LEFT_VECTOR_INDEX = 0
# ACTION_RIGHT_VECTOR_INDEX = 1
# ACTION_UP_DOWN_NONE_VECTOR_INDEX = 2
# ACTION_LEFT_RIGHT_NONE_VECTOR_INDEX = 2
# ACTION_UP_VECTOR = make_one_hot_vector(3, ACTION_UP_VECTOR_INDEX)
# ACTION_DOWN_VECTOR = make_one_hot_vector(3, ACTION_DOWN_VECTOR_INDEX)
# ACTION_LEFT_VECTOR = make_one_hot_vector(3, ACTION_LEFT_VECTOR_INDEX)
# ACTION_RIGHT_VECTOR = make_one_hot_vector(3, ACTION_RIGHT_VECTOR_INDEX)
# ACTION_UP_DOWN_NONE_VECTOR = make_one_hot_vector(3, ACTION_UP_DOWN_NONE_VECTOR_INDEX)
# ACTION_LEFT_RIGHT_NONE_VECTOR = make_one_hot_vector(3, ACTION_LEFT_RIGHT_NONE_VECTOR_INDEX)
# ACTION_UP_DOWN_TO_VECTOR_INDEX = {
#     ACTION_UP: ACTION_UP_VECTOR_INDEX,
#     ACTION_DOWN: ACTION_DOWN_VECTOR_INDEX,
#     ACTION_UP_DOWN_NONE: ACTION_UP_DOWN_NONE_VECTOR_INDEX
# }
# ACTION_LEFT_RIGHT_TO_VECTOR_INDEX = {
#     ACTION_LEFT: ACTION_LEFT_VECTOR_INDEX,
#     ACTION_RIGHT: ACTION_RIGHT_VECTOR_INDEX,
#     ACTION_LEFT_RIGHT_NONE: ACTION_LEFT_RIGHT_NONE_VECTOR_INDEX
# }
# ACTION_UP_DOWN_FROM_VECTOR_INDEX = [
#     ACTION_UP,
#     ACTION_DOWN,
#     ACTION_UP_DOWN_NONE
# ]
# ACTION_LEFT_RIGHT_FROM_VECTOR_INDEX = [
#     ACTION_LEFT,
#     ACTION_RIGHT,
#     ACTION_LEFT_RIGHT_NONE
# ]
# ACTION_UP_DOWN_TO_VECTOR = {
#     ACTION_UP: ACTION_UP_VECTOR,
#     ACTION_DOWN: ACTION_DOWN_VECTOR,
#     ACTION_UP_DOWN_NONE: ACTION_UP_DOWN_NONE_VECTOR
# }
# ACTION_LEFT_RIGHT_TO_VECTOR = {
#     ACTION_LEFT: ACTION_LEFT_VECTOR,
#     ACTION_RIGHT: ACTION_RIGHT_VECTOR,
#     ACTION_LEFT_RIGHT_NONE: ACTION_LEFT_RIGHT_NONE_VECTOR
# }
# ALL_MULTIACTIONS = []
# ACTIONS_TO_MULTIVEC = dict()
# ACTIONS_FROM_MULTIVEC_INDEX = []
# def make_one_hot_vector(size, idx_one):
# def get_random_action_up_down():
# def get_random_action_left_right():
# def keys_to_action_up_down(keys):
# def keys_to_action_left_right(keys):
# def action_up_down_to_vector(action):
# def action_left_right_to_vector(action):
# def action_up_down_to_vector_index(action):
# def action_left_right_to_vector_index(action):
# def action_up_down_from_vector_index(index):
# def action_left_right_from_vector_index(index):
# def action_to_key(action):
# def actions_to_multivec(action_up_down, action_left_right):


import sys
import os
import models as models_reinforced
from lib import actions as actionslib
from __future__ import print_function, division

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))


try:
    xrange
except NameError:
    xrange = range

def make_plans_unique(plans):
    added = set()
    result = []

# Path: lib/actions.py
# ACTION_UP = "W"
# ACTION_DOWN = "S"
# ACTION_LEFT = "A"
# ACTION_RIGHT = "D"
# ACTION_UP_DOWN_NONE = "~WS"
# ACTION_LEFT_RIGHT_NONE = "~AD"
# ACTIONS_UP_DOWN = [ACTION_UP, ACTION_DOWN, ACTION_UP_DOWN_NONE]
# ACTIONS_LEFT_RIGHT = [ACTION_LEFT, ACTION_RIGHT, ACTION_LEFT_RIGHT_NONE]
# ALL_ACTIONS = ACTIONS_UP_DOWN + ACTIONS_LEFT_RIGHT
# ACTION_TO_KEY = {
#     ACTION_UP: "w",
#     ACTION_DOWN: "s",
#     ACTION_LEFT: "a",
#     ACTION_RIGHT: "d",
#     ACTION_UP_DOWN_NONE: None,
#     ACTION_LEFT_RIGHT_NONE: None
# }
# ACTION_UP_VECTOR_INDEX = 0
# ACTION_DOWN_VECTOR_INDEX = 1
# ACTION_LEFT_VECTOR_INDEX = 0
# ACTION_RIGHT_VECTOR_INDEX = 1
# ACTION_UP_DOWN_NONE_VECTOR_INDEX = 2
# ACTION_LEFT_RIGHT_NONE_VECTOR_INDEX = 2
# ACTION_UP_VECTOR = make_one_hot_vector(3, ACTION_UP_VECTOR_INDEX)
# ACTION_DOWN_VECTOR = make_one_hot_vector(3, ACTION_DOWN_VECTOR_INDEX)
# ACTION_LEFT_VECTOR = make_one_hot_vector(3, ACTION_LEFT_VECTOR_INDEX)
# ACTION_RIGHT_VECTOR = make_one_hot_vector(3, ACTION_RIGHT_VECTOR_INDEX)
# ACTION_UP_DOWN_NONE_VECTOR = make_one_hot_vector(3, ACTION_UP_DOWN_NONE_VECTOR_INDEX)
# ACTION_LEFT_RIGHT_NONE_VECTOR = make_one_hot_vector(3, ACTION_LEFT_RIGHT_NONE_VECTOR_INDEX)
# ACTION_UP_DOWN_TO_VECTOR_INDEX = {
#     ACTION_UP: ACTION_UP_VECTOR_INDEX,
#     ACTION_DOWN: ACTION_DOWN_VECTOR_INDEX,
#     ACTION_UP_DOWN_NONE: ACTION_UP_DOWN_NONE_VECTOR_INDEX
# }
# ACTION_LEFT_RIGHT_TO_VECTOR_INDEX = {
#     ACTION_LEFT: ACTION_LEFT_VECTOR_INDEX,
#     ACTION_RIGHT: ACTION_RIGHT_VECTOR_INDEX,
#     ACTION_LEFT_RIGHT_NONE: ACTION_LEFT_RIGHT_NONE_VECTOR_INDEX
# }
# ACTION_UP_DOWN_FROM_VECTOR_INDEX = [
#     ACTION_UP,
#     ACTION_DOWN,
#     ACTION_UP_DOWN_NONE
# ]
# ACTION_LEFT_RIGHT_FROM_VECTOR_INDEX = [
#     ACTION_LEFT,
#     ACTION_RIGHT,
#     ACTION_LEFT_RIGHT_NONE
# ]
# ACTION_UP_DOWN_TO_VECTOR = {
#     ACTION_UP: ACTION_UP_VECTOR,
#     ACTION_DOWN: ACTION_DOWN_VECTOR,
#     ACTION_UP_DOWN_NONE: ACTION_UP_DOWN_NONE_VECTOR
# }
# ACTION_LEFT_RIGHT_TO_VECTOR = {
#     ACTION_LEFT: ACTION_LEFT_VECTOR,
#     ACTION_RIGHT: ACTION_RIGHT_VECTOR,
#     ACTION_LEFT_RIGHT_NONE: ACTION_LEFT_RIGHT_NONE_VECTOR
# }
# ALL_MULTIACTIONS = []
# ACTIONS_TO_MULTIVEC = dict()
# ACTIONS_FROM_MULTIVEC_INDEX = []
# def make_one_hot_vector(size, idx_one):
# def get_random_action_up_down():
# def get_random_action_left_right():
# def keys_to_action_up_down(keys):
# def keys_to_action_left_right(keys):
# def action_up_down_to_vector(action):
# def action_left_right_to_vector(action):
# def action_up_down_to_vector_index(action):
# def action_left_right_to_vector_index(action):
# def action_up_down_from_vector_index(index):
# def action_left_right_from_vector_index(index):
# def action_to_key(action):
# def actions_to_multivec(action_up_down, action_left_right):


# Path: train_reinforced/plans.py
import sys
import os
import models as models_reinforced
from lib import actions as actionslib

from __future__ import print_function, division

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))


try:
    xrange
except NameError:
    xrange = range

def make_plans_unique(plans):
    added = set()
    result = []

    for plan in plans: