diff --git a/learning/decision_tree.py b/learning/decision_tree.py index 18c1c47..7f92344 100644 --- a/learning/decision_tree.py +++ b/learning/decision_tree.py @@ -47,7 +47,7 @@ class DecisionTree: opponents_parsed = [] for opponent in opponents: opponents_parsed.append( - (manhattan_distance(current_knight.position, opponent.position), parse_hp(opponent.current_hp))) + (manhattan_distance(current_knight.position, opponent.position), parse_hp(opponent.health_bar.current_hp))) prediction = self.get_prediction(tower_dist=distance_to_castle, tower_hp=castle.current_hp, mob1_dist=monsters_parsed[0][0], mob1_hp=monsters_parsed[0][1], @@ -56,7 +56,7 @@ class DecisionTree: opp2_dist=opponents_parsed[1][0], opp2_hp=opponents_parsed[1][1], opp3_dist=opponents_parsed[2][0], opp3_hp=opponents_parsed[2][1], opp4_dist=opponents_parsed[3][0], opp4_hp=opponents_parsed[3][1], - agent_hp=current_knight.current_hp) + agent_hp=current_knight.health_bar.current_hp) print(prediction) if prediction == 'tower': # castle... return castle_neighbors(grid, castle_bottom_right_row=castle.position[0],