changed some data regarding decision_tree's; changed map a bit

This commit is contained in:
JakubR 2021-05-24 01:05:00 +02:00
parent f6ff6e548c
commit 32c50f27fc
6 changed files with 12053 additions and 20053 deletions

View File

@ -75,7 +75,7 @@ class DecisionTree:
if __name__ == "__main__": if __name__ == "__main__":
# generate_data("training_set.txt", 20000) # generate_data("training_set.txt", 12000)
decision_tree = DecisionTree() decision_tree = DecisionTree()
decision_tree.build("training_set.txt", 15) decision_tree.build("training_set.txt", 15)
decision_tree.test() decision_tree.test()

View File

@ -9,28 +9,28 @@ class Wire(Enum):
class TypeHash(Enum): class TypeHash(Enum):
TIME = 90, "time" TIME = 90, "time"
CHAINED = 12, "chained" CHAINED = 45, "chained"
STANDARD = 0, "standard" STANDARD = 0, "standard"
class DangerClassHash(Enum): class DangerClassHash(Enum):
BIG_BANG = 64, "big bang" BIG_BANG = 64, "big bang"
WEAPON_OF_MASS_DESTRUCTION = 32, "weapon of mass destruction" WEAPON_OF_MASS_DESTRUCTION = 48, "weapon of mass destruction"
RADIOACTIVE = 16, "radioactive" RADIOACTIVE = 36, "radioactive"
CASUAL_DEVASTATOR = 8, "casual devastator" CASUAL_DEVASTATOR = 20, "casual devastator"
LITTLE_BOY = 4, "little boy" ALMOST_PIERCES_THROUGH_PAPER = 10, "almost pierces through paper"
CHERRY_BOMB = 0, "cherry bomb" CHERRY_BOMB = 0, "cherry bomb"
class SeriesHash(Enum): class SeriesHash(Enum):
TCH_2990TONER = 128, "TCH_2990toner" TCH_2990TONER = 128, "TCH 2990toner"
TCH_2990INKJET = 64, "TCH_2990inkjet" TCH_2990INKJET = 110, "TCH 2990inkjet"
TVY_2400H = 48, "TVY_2400h" TVY_2400H = 100, "TVY 2400h"
SWX_5000 = 32, "SWX_5000" SWX_5000 = 80, "SWX 5000"
SWX_4000 = 16, "SWX_4000" SWX_4000 = 50, "SWX 4000"
WORKHORSE_3200 = 8, "WORKHORSE_3200" WORKHORSE_3200 = 30, "WORKHORSE 3200"
FX_500 = 4, "FX_500" FX_500 = 15, "FX 500"
TVY_2400 = 0, "TVY_2400" TVY_2400 = 0, "TVY 2400"
class IndicatorHash(Enum): class IndicatorHash(Enum):
@ -42,21 +42,21 @@ class IndicatorHash(Enum):
class SpecificityHash(Enum): class SpecificityHash(Enum):
ANTI_AIRCRAFT = 55, "anti_aircraft" ANTI_AIRCRAFT = 55, "anti aircraft"
ANTI_PERSONNEL = 43, "anti_personnel" ANTI_PERSONNEL = 43, "anti personnel"
DEPTH_MINE = 37, "depth_mine" DEPTH_MINE = 37, "depth mine"
ANTI_TANK = 26, "anti_tank" ANTI_TANK = 26, "anti tank"
PROXIMITY_MINE = 18, "proximity_mine" PROXIMITY_MINE = 18, "proximity mine"
PRESSURE_MINE = 9, "pressure_mine" PRESSURE_MINE = 9, "pressure mine"
FRAGMENTATION_MINE = 0, "fragmentation_mine" FRAGMENTATION_MINE = 0, "fragmentation mine"
class WeightHash(Enum): class WeightHash(Enum):
FAT_MAN = 32, "fat_man" GINORMOUS = 32, "ginormous"
EXTRA_LARGE = 24, "extra_large" EXTRA_LARGE = 24, "extra large"
TOTAL_AVERAGE = 16, "total_average" TOTAL_AVERAGE = 16, "total average"
SLIM_FIT = 8, "slim_fit" SLIM_FIT = 8, "slim fit"
BREAD_CRUMB = 0, "bread_crumb" BREAD_CRUMB = 0, "bread crumb"
MAX_VALUE = max([elem.value[0] for elem in TypeHash]) \ MAX_VALUE = max([elem.value[0] for elem in TypeHash]) \
@ -68,9 +68,9 @@ MAX_VALUE = max([elem.value[0] for elem in TypeHash]) \
def _get_wire_color(hash_sum): def _get_wire_color(hash_sum):
if hash_sum < 0.4 * MAX_VALUE: if hash_sum < 0.43 * MAX_VALUE:
return Wire.BLUE return Wire.BLUE
elif hash_sum <= 0.6 * MAX_VALUE: elif hash_sum <= 0.56 * MAX_VALUE:
return Wire.GREEN return Wire.GREEN
else: else:
return Wire.RED return Wire.RED

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
"mine": null "mine": null
}, },
"0,1": { "0,1": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"0,2": { "0,2": {
@ -30,7 +30,7 @@
"mine": null "mine": null
}, },
"0,6": { "0,6": {
"terrain": "MUD", "terrain": "GRASS",
"mine": null "mine": null
}, },
"0,7": { "0,7": {
@ -38,14 +38,14 @@
"mine": null "mine": null
}, },
"0,8": { "0,8": {
"terrain": "GRASS", "terrain": "MUD",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": "0,3" "predecessor": "0,3"
} }
}, },
"0,9": { "0,9": {
"terrain": "GRASS", "terrain": "MUD",
"mine": { "mine": {
"mine_type": "time", "mine_type": "time",
"timer": 20 "timer": 20
@ -56,13 +56,13 @@
"mine": null "mine": null
}, },
"1,1": { "1,1": {
"terrain": "GRASS", "terrain": "MUD",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
}, },
"1,2": { "1,2": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"1,3": { "1,3": {
@ -101,7 +101,7 @@
"mine": null "mine": null
}, },
"2,1": { "2,1": {
"terrain": "GRASS", "terrain": "MUD",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
@ -122,7 +122,7 @@
"mine": null "mine": null
}, },
"2,5": { "2,5": {
"terrain": "MUD", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
@ -136,14 +136,14 @@
"mine": null "mine": null
}, },
"2,8": { "2,8": {
"terrain": "MUD", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": null "predecessor": null
} }
}, },
"2,9": { "2,9": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"3,0": { "3,0": {
@ -151,7 +151,7 @@
"mine": null "mine": null
}, },
"3,1": { "3,1": {
"terrain": "MUD", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "time", "mine_type": "time",
"timer": 19 "timer": 19
@ -177,7 +177,7 @@
"mine": null "mine": null
}, },
"3,6": { "3,6": {
"terrain": "MUD", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": null "predecessor": null
@ -200,7 +200,7 @@
"mine": null "mine": null
}, },
"4,1": { "4,1": {
"terrain": "MUD", "terrain": "GRASS",
"mine": null "mine": null
}, },
"4,2": { "4,2": {
@ -218,11 +218,11 @@
"mine": null "mine": null
}, },
"4,5": { "4,5": {
"terrain": "MUD", "terrain": "GRASS",
"mine": null "mine": null
}, },
"4,6": { "4,6": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"4,7": { "4,7": {
@ -245,7 +245,7 @@
"mine": null "mine": null
}, },
"5,1": { "5,1": {
"terrain": "MUD", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": "2,3" "predecessor": "2,3"
@ -275,7 +275,7 @@
"mine": null "mine": null
}, },
"5,7": { "5,7": {
"terrain": "MUD", "terrain": "GRASS",
"mine": null "mine": null
}, },
"5,8": { "5,8": {
@ -307,13 +307,13 @@
"mine": null "mine": null
}, },
"6,5": { "6,5": {
"terrain": "GRASS", "terrain": "MUD",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
}, },
"6,6": { "6,6": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"6,7": { "6,7": {
@ -354,20 +354,20 @@
"mine": null "mine": null
}, },
"7,5": { "7,5": {
"terrain": "GRASS", "terrain": "MUD",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
}, },
"7,6": { "7,6": {
"terrain": "GRASS", "terrain": "MUD",
"mine": { "mine": {
"mine_type": "time", "mine_type": "time",
"timer": 39 "timer": 39
} }
}, },
"7,7": { "7,7": {
"terrain": "MUD", "terrain": "GRASS",
"mine": null "mine": null
}, },
"7,8": { "7,8": {
@ -383,7 +383,7 @@
"mine": null "mine": null
}, },
"8,1": { "8,1": {
"terrain": "GRASS", "terrain": "MUD",
"mine": { "mine": {
"mine_type": "time", "mine_type": "time",
"timer": 24 "timer": 24
@ -431,11 +431,11 @@
"mine": null "mine": null
}, },
"9,1": { "9,1": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"9,2": { "9,2": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"9,3": { "9,3": {