map and cost adjustments

This commit is contained in:
s452645 2021-05-09 18:38:52 +02:00
parent 03b17f293f
commit cf4b3f9027
3 changed files with 53 additions and 53 deletions

View File

@ -72,8 +72,8 @@ class Coords(Enum):
class Terrain(Enum): class Terrain(Enum):
CONCRETE = 2 CONCRETE = 2
GRASS = 4 GRASS = 10
MUD = 8 MUD = 20
# =============== # # =============== #

View File

@ -4,7 +4,7 @@
"mine": null "mine": null
}, },
"0,1": { "0,1": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"0,2": { "0,2": {
@ -12,21 +12,21 @@
"mine": null "mine": null
}, },
"0,3": { "0,3": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": null "predecessor": null
} }
}, },
"0,4": { "0,4": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": null "predecessor": null
} }
}, },
"0,5": { "0,5": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"0,6": { "0,6": {
@ -38,7 +38,7 @@
"mine": null "mine": null
}, },
"0,8": { "0,8": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": "0,3" "predecessor": "0,3"
@ -52,7 +52,7 @@
} }
}, },
"1,0": { "1,0": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"1,1": { "1,1": {
@ -66,22 +66,22 @@
"mine": null "mine": null
}, },
"1,3": { "1,3": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": null "predecessor": null
} }
}, },
"1,4": { "1,4": {
"terrain": "MUD", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"1,5": { "1,5": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"1,6": { "1,6": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"1,7": { "1,7": {
@ -97,11 +97,11 @@
"mine": null "mine": null
}, },
"2,0": { "2,0": {
"terrain": "MUD", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"2,1": { "2,1": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
@ -118,7 +118,7 @@
} }
}, },
"2,4": { "2,4": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"2,5": { "2,5": {
@ -143,7 +143,7 @@
} }
}, },
"2,9": { "2,9": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"3,0": { "3,0": {
@ -169,11 +169,11 @@
} }
}, },
"3,4": { "3,4": {
"terrain": "MUD", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"3,5": { "3,5": {
"terrain": "CONCRETE", "terrain": "MUD",
"mine": null "mine": null
}, },
"3,6": { "3,6": {
@ -184,11 +184,11 @@
} }
}, },
"3,7": { "3,7": {
"terrain": "MUD", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"3,8": { "3,8": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"3,9": { "3,9": {
@ -204,7 +204,7 @@
"mine": null "mine": null
}, },
"4,2": { "4,2": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
@ -214,7 +214,7 @@
"mine": null "mine": null
}, },
"4,4": { "4,4": {
"terrain": "MUD", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"4,5": { "4,5": {
@ -222,11 +222,11 @@
"mine": null "mine": null
}, },
"4,6": { "4,6": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"4,7": { "4,7": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": null "predecessor": null
@ -252,22 +252,22 @@
} }
}, },
"5,2": { "5,2": {
"terrain": "MUD", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"5,3": { "5,3": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"5,4": { "5,4": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": "2,8" "predecessor": "2,8"
} }
}, },
"5,5": { "5,5": {
"terrain": "CONCRETE", "terrain": "MUD",
"mine": null "mine": null
}, },
"5,6": { "5,6": {
@ -279,7 +279,7 @@
"mine": null "mine": null
}, },
"5,8": { "5,8": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"5,9": { "5,9": {
@ -287,7 +287,7 @@
"mine": null "mine": null
}, },
"6,0": { "6,0": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"6,1": { "6,1": {
@ -295,15 +295,15 @@
"mine": null "mine": null
}, },
"6,2": { "6,2": {
"terrain": "MUD", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"6,3": { "6,3": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"6,4": { "6,4": {
"terrain": "CONCRETE", "terrain": "MUD",
"mine": null "mine": null
}, },
"6,5": { "6,5": {
@ -317,7 +317,7 @@
"mine": null "mine": null
}, },
"6,7": { "6,7": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"6,8": { "6,8": {
@ -325,20 +325,20 @@
"mine": null "mine": null
}, },
"6,9": { "6,9": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
}, },
"7,0": { "7,0": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "chained", "mine_type": "chained",
"predecessor": "4,7" "predecessor": "4,7"
} }
}, },
"7,1": { "7,1": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"7,2": { "7,2": {
@ -350,7 +350,7 @@
"mine": null "mine": null
}, },
"7,4": { "7,4": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"7,5": { "7,5": {
@ -360,7 +360,7 @@
} }
}, },
"7,6": { "7,6": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "time", "mine_type": "time",
"timer": 39 "timer": 39
@ -371,11 +371,11 @@
"mine": null "mine": null
}, },
"7,8": { "7,8": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"7,9": { "7,9": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"8,0": { "8,0": {
@ -394,25 +394,25 @@
"mine": null "mine": null
}, },
"8,3": { "8,3": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": { "mine": {
"mine_type": "standard" "mine_type": "standard"
} }
}, },
"8,4": { "8,4": {
"terrain": "CONCRETE", "terrain": "MUD",
"mine": null "mine": null
}, },
"8,5": { "8,5": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"8,6": { "8,6": {
"terrain": "GRASS", "terrain": "MUD",
"mine": null "mine": null
}, },
"8,7": { "8,7": {
"terrain": "CONCRETE", "terrain": "MUD",
"mine": null "mine": null
}, },
"8,8": { "8,8": {
@ -423,7 +423,7 @@
} }
}, },
"8,9": { "8,9": {
"terrain": "GRASS", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"9,0": { "9,0": {
@ -435,15 +435,15 @@
"mine": null "mine": null
}, },
"9,2": { "9,2": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"9,3": { "9,3": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"9,4": { "9,4": {
"terrain": "CONCRETE", "terrain": "GRASS",
"mine": null "mine": null
}, },
"9,5": { "9,5": {
@ -454,7 +454,7 @@
} }
}, },
"9,6": { "9,6": {
"terrain": "CONCRETE", "terrain": "MUD",
"mine": null "mine": null
}, },
"9,7": { "9,7": {
@ -466,7 +466,7 @@
"mine": null "mine": null
}, },
"9,9": { "9,9": {
"terrain": "MUD", "terrain": "CONCRETE",
"mine": null "mine": null
}, },
"agents_initial_state": { "agents_initial_state": {

View File

@ -36,7 +36,7 @@ def get_node_cost(node: Node, minefield: Minefield):
# if Tile considered its mine in cost calculation, this code would be priettier # if Tile considered its mine in cost calculation, this code would be priettier
if minefield.matrix[row][column].mine is not None: if minefield.matrix[row][column].mine is not None:
return node.parent.cost + 100 return node.parent.cost + 500
else: else:
return node.parent.cost + minefield.matrix[row][column].cost.value return node.parent.cost + minefield.matrix[row][column].cost.value