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):
CONCRETE = 2
GRASS = 4
MUD = 8
GRASS = 10
MUD = 20
# =============== #

View File

@ -4,7 +4,7 @@
"mine": null
},
"0,1": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"0,2": {
@ -12,21 +12,21 @@
"mine": null
},
"0,3": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": null
}
},
"0,4": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": null
}
},
"0,5": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"0,6": {
@ -38,7 +38,7 @@
"mine": null
},
"0,8": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": "0,3"
@ -52,7 +52,7 @@
}
},
"1,0": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"1,1": {
@ -66,22 +66,22 @@
"mine": null
},
"1,3": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": null
}
},
"1,4": {
"terrain": "MUD",
"terrain": "CONCRETE",
"mine": null
},
"1,5": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"1,6": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"1,7": {
@ -97,11 +97,11 @@
"mine": null
},
"2,0": {
"terrain": "MUD",
"terrain": "CONCRETE",
"mine": null
},
"2,1": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "standard"
}
@ -118,7 +118,7 @@
}
},
"2,4": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"2,5": {
@ -143,7 +143,7 @@
}
},
"2,9": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"3,0": {
@ -169,11 +169,11 @@
}
},
"3,4": {
"terrain": "MUD",
"terrain": "CONCRETE",
"mine": null
},
"3,5": {
"terrain": "CONCRETE",
"terrain": "MUD",
"mine": null
},
"3,6": {
@ -184,11 +184,11 @@
}
},
"3,7": {
"terrain": "MUD",
"terrain": "CONCRETE",
"mine": null
},
"3,8": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"3,9": {
@ -204,7 +204,7 @@
"mine": null
},
"4,2": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "standard"
}
@ -214,7 +214,7 @@
"mine": null
},
"4,4": {
"terrain": "MUD",
"terrain": "CONCRETE",
"mine": null
},
"4,5": {
@ -222,11 +222,11 @@
"mine": null
},
"4,6": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"4,7": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": null
@ -252,22 +252,22 @@
}
},
"5,2": {
"terrain": "MUD",
"terrain": "CONCRETE",
"mine": null
},
"5,3": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"5,4": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": "2,8"
}
},
"5,5": {
"terrain": "CONCRETE",
"terrain": "MUD",
"mine": null
},
"5,6": {
@ -279,7 +279,7 @@
"mine": null
},
"5,8": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"5,9": {
@ -287,7 +287,7 @@
"mine": null
},
"6,0": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"6,1": {
@ -295,15 +295,15 @@
"mine": null
},
"6,2": {
"terrain": "MUD",
"terrain": "CONCRETE",
"mine": null
},
"6,3": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"6,4": {
"terrain": "CONCRETE",
"terrain": "MUD",
"mine": null
},
"6,5": {
@ -317,7 +317,7 @@
"mine": null
},
"6,7": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"6,8": {
@ -325,20 +325,20 @@
"mine": null
},
"6,9": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "standard"
}
},
"7,0": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": "4,7"
}
},
"7,1": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"7,2": {
@ -350,7 +350,7 @@
"mine": null
},
"7,4": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"7,5": {
@ -360,7 +360,7 @@
}
},
"7,6": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "time",
"timer": 39
@ -371,11 +371,11 @@
"mine": null
},
"7,8": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"7,9": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"8,0": {
@ -394,25 +394,25 @@
"mine": null
},
"8,3": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": {
"mine_type": "standard"
}
},
"8,4": {
"terrain": "CONCRETE",
"terrain": "MUD",
"mine": null
},
"8,5": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"8,6": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"8,7": {
"terrain": "CONCRETE",
"terrain": "MUD",
"mine": null
},
"8,8": {
@ -423,7 +423,7 @@
}
},
"8,9": {
"terrain": "GRASS",
"terrain": "CONCRETE",
"mine": null
},
"9,0": {
@ -435,15 +435,15 @@
"mine": null
},
"9,2": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"9,3": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"9,4": {
"terrain": "CONCRETE",
"terrain": "GRASS",
"mine": null
},
"9,5": {
@ -454,7 +454,7 @@
}
},
"9,6": {
"terrain": "CONCRETE",
"terrain": "MUD",
"mine": null
},
"9,7": {
@ -466,7 +466,7 @@
"mine": null
},
"9,9": {
"terrain": "MUD",
"terrain": "CONCRETE",
"mine": null
},
"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 minefield.matrix[row][column].mine is not None:
return node.parent.cost + 100
return node.parent.cost + 500
else:
return node.parent.cost + minefield.matrix[row][column].cost.value