<commit_before>#<NAME>, 1238928
#<NAME>
#<NAME>
#HW4, Wicked Problem

#<METADATA>
QUIET_VERSION = "0.2"
PROBLEM_NAME = "Wicked Problem"
PROBLEM_VERSION = "0.1"
PROBLEM_AUTHORS = ['<NAME>', '<NAME>', '<NAME>']
PROBLEM_CREATION_DATE = "27-APR-2017"
PROBLEM_DESC=\
'''This formulation of the wicked problem of solving North Korea standoff 
uses generic Python 3 constructs and has been tested with Python 3.4.
It is designed to work according to the QUIET tools interface, Version 0.2.
'''
#</METADATA>

import random

#pass in list of countries, list of corresponding properties, <, >, =
def can_move(s, flag):
    if(flag == "joint military training"):
        return s.countries['USA']['economy'] > 70 and s.countries['SK']['economy'] > 70
    elif(flag == "change ruling party"):
        curr = s.q[0];
        party = ['left', 'right']
        num = random.randint(0,1)
        return s.countries[curr]['party'] != party[num]
    elif(flag == "nk missle"):
        return s.countries['NK']['military'] > 70 and s.countries['NK']['dictator'] > 50
    elif(flag == "submarines"):
        return s.countries['USA']['military'] > 50 and s.countries['USA']['hostility'] > 50 \
               and s.countries['NK']['dictator'] > 70
    elif(flag == "funding"):




    try:
        board = s.board
        return ((abs(From - To) == 1 or abs(From - To) == 3) and \
                (board[From] != 0 and board[To] == 0))
    except (Exception) as e:
        print(e)


# specify the property to be changed as the parameter,
# i.e specific country, specific property, numbers to go down/up
def move(s, From, To):
    news = s.__copy__()
    board2 = news.board
    board2[To] = board2[From]
    board2[From] = 0
    return news

#not required
# def goal_test(s):
#     goal_state = [0, 1, 2, 3, 4, 5, 6, 7, 8]
#     return s.board == goal_state

def goal_message(s):
    return "Done."

class Operator:
    def __init__(self, name, precond, state_transf):
        self.name = name<commit_msg>did some work on move<commit_after>#<NAME>, 1238928
#<NAME>
#<NAME>
#HW4, Wicked Problem

#<METADATA>
QUIET_VERSION = "0.2"
PROBLEM_NAME = "Wicked Problem"
PROBLEM_VERSION = "0.1"
PROBLEM_AUTHORS = ['<NAME>', '<NAME>', '<NAME>']
PROBLEM_CREATION_DATE = "27-APR-2017"
PROBLEM_DESC=\
'''This formulation of the wicked problem of solving North Korea standoff 
uses generic Python 3 constructs and has been tested with Python 3.4.
It is designed to work according to the QUIET tools interface, Version 0.2.
'''
#</METADATA>

import random

#pass in list of countries, list of corresponding properties, <, >, =
def can_move(s, flag):
    if(flag == "joint military training"):
        return s.countries['USA']['economy'] > 70 and s.countries['SK']['economy'] > 70
    elif(flag == "change ruling party"):
        curr = s.q[0];
        party = ['left', 'right']
        num = random.randint(0,1)
        return s.countries[curr]['party'] != party[num]
    elif(flag == "nk missle"):
        return s.countries['NK']['military'] > 70 and s.countries['NK']['dictator'] > 50
    elif(flag == "submarines"):
        return s.countries['USA']['military'] > 50 and s.countries['USA']['hostility'] > 50 \
               and s.countries['NK']['dictator'] > 70
    elif(flag == "funding"):




    try:
        board = s.board
        return ((abs(From - To) == 1 or abs(From - To) == 3) and \
                (board[From] != 0 and board[To] == 0))
    except (Exception) as e:
        print(e)


# specify the property to be changed as the parameter,
# i.e specific country, specific property, numbers to go down/up
def move(s, flag):
    new_s = s.__copy__()
    if(flag == "joint military training"):
        # return s.countries['USA']['economy'] > 70 and s.countries['SK']['economy'] > 70
        new_s.countries['USA']['military'] += 1
        new_s.countries['USA']['economy'] -= 1
        new_s.countries['SK']['military'] += 1
        new_s.countries['SK']['economy'] -= 1
    elif(flag == "change ruling party"):
        # curr = s.q[0];
        # [ ['usa', 'sk', 'etc'] ['sk', 'usa', '4'] ]
        # party = ['left', 'right']
        # num = random.randint(0,1)
        # return s.countries[curr]['party'] != party[num]

    elif(flag == "nk missle"):
        new_s.countries['SK']['hostility'] += 20
        if new_s.countries['SK']['hostility'] > 100:
            new_s.countries['SK']['hostility'] = 100
    elif(flag == "submarines"):
        new_s.countries['NK']['dictator'] += 10
        if new_s.countries['NK']['dictator'] > 100:
            new_s.countries['SK']['hostility'] = 100
    elif(flag == "sanction"):

    return new_s

#not required
# def goal_test(s):
#     goal_state = [0, 1, 2, 3, 4, 5, 6, 7, 8]
#     return s.board == goal_state

def goal_message(s):
    return "Done."

class Operator:
    def __init__(self, name, precond, state_transf):
        self.name = name
{'fraction_non_alphanumeric': 0.16998154603239696, 'fraction_numerical': 0.02850112774246463, 'mean_word_length': 3.075187969924812, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4178000', 'n_tokens_mistral': 1777, 'n_tokens_neox': 1652, 'n_words': 461}