# Path: lib/replay_memory.py
# class ReplayMemory(object):
#     def __init__(self, filepath, max_size, max_size_tolerance):
#     def create_instance_supervised(val=False):
#     def create_instance_reinforced(val=False):
#     def create_instance_by_config(cfg_name):
#     def add_states(self, states, shrink=True):
#     def add_state(self, state, commit=True, shrink=True):
#     def update_state(self, idx, state, commit=True):
#     def get_state_by_id(self, idx):
#     def get_states_by_ids(self, ids):
#     def get_random_states(self, count):
#     def get_states_range(self, pos_start, length):
#     def get_random_state_chain(self, length, from_pos_range=None):
#     def get_random_state_chain_timediff(self, length, max_timediff_ms=500, depth=50):
#     def update_caches(self):
#     def is_above_tolerance(self):
#     def shrink_to_max_size(self, force=False):
#     def commit(self):
#     def close(self):
#     def connect(self):
# 
# Path: lib/rewards.py
# def calculate_reward(state, next_state):
# def calculate_reward_raw(next_speed, next_is_reverse, next_is_offence_shown, next_is_damage_shown):


import sys
import os
import collections
from lib import replay_memory
from lib import rewards as rewardslib
from __future__ import division, print_function

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



if sys.version_info[0] == 3:
    raw_input = input

try:
    xrange
except NameError:
    xrange = range

def main():
    key = raw_input("This will recalculate the rewards of all states in the database. Press 'y' to continue.")
    assert key == "y"

    memories = [
        replay_memory.ReplayMemory.create_instance_reinforced(val=False),
        #replay_memory.ReplayMemory.create_instance_reinforced(val=True)

# Path: lib/replay_memory.py
# class ReplayMemory(object):
#     def __init__(self, filepath, max_size, max_size_tolerance):
#     def create_instance_supervised(val=False):
#     def create_instance_reinforced(val=False):
#     def create_instance_by_config(cfg_name):
#     def add_states(self, states, shrink=True):
#     def add_state(self, state, commit=True, shrink=True):
#     def update_state(self, idx, state, commit=True):
#     def get_state_by_id(self, idx):
#     def get_states_by_ids(self, ids):
#     def get_random_states(self, count):
#     def get_states_range(self, pos_start, length):
#     def get_random_state_chain(self, length, from_pos_range=None):
#     def get_random_state_chain_timediff(self, length, max_timediff_ms=500, depth=50):
#     def update_caches(self):
#     def is_above_tolerance(self):
#     def shrink_to_max_size(self, force=False):
#     def commit(self):
#     def close(self):
#     def connect(self):
# 
# Path: lib/rewards.py
# def calculate_reward(state, next_state):
# def calculate_reward_raw(next_speed, next_is_reverse, next_is_offence_shown, next_is_damage_shown):


# Path: scripts/recalculate_rewards.py
import sys
import os
import collections
from lib import replay_memory
from lib import rewards as rewardslib

from __future__ import division, print_function

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



if sys.version_info[0] == 3:
    raw_input = input

try:
    xrange
except NameError:
    xrange = range

def main():
    key = raw_input("This will recalculate the rewards of all states in the database. Press 'y' to continue.")
    assert key == "y"

    memories = [
        replay_memory.ReplayMemory.create_instance_reinforced(val=False),
        #replay_memory.ReplayMemory.create_instance_reinforced(val=True)

    ]