def test_get_combat_scores_4(self):
        """
 23456789
2.b.b..
3..b.b.
4......
5......
6....a.
7......
        """
        data = """
turn 1
a 2 3 1 
a 3 5 1 
a 3 4 1 
a 3 6 1 
a 6 6 0
go
        """
        self.gamestate.update(data)
        my_ants = self.gamestate.my_ants()
        enemy_ants = self.gamestate.enemy_ants()
        threat_distance = self.gamestate.attackradius2
        influence_by_owner = battle_influence.get_influence_by_owner(self.gamestate, my_ants, enemy_ants, threat_distance)
        influence_by_threat = battle_influence.get_influence_by_threat(self.gamestate, my_ants, enemy_ants, threat_distance)
        combat_scores = battle_influence.get_combat_scores(self.gamestate, my_ants, enemy_ants, influence_by_threat, threat_distance)

        print("")
        print(influence_by_owner[0])
        print("")
        print(influence_by_owner[1])
    def test_get_combat_scores_2(self):
        """
 23456789
2..bb.
3.....
4.....
5.....
6..aa.
        """
        data = """
turn 1
a 2 4 1 
a 2 5 1 
a 6 4 0
a 6 5 0
go
        """
        self.gamestate.update(data)
        my_ants = self.gamestate.my_ants()
        enemy_ants = self.gamestate.enemy_ants()
        threat_distance = self.gamestate.attackradius2
        influence_by_threat = battle_influence.get_influence_by_threat(self.gamestate, my_ants, enemy_ants, threat_distance)
        combat_scores = battle_influence.get_combat_scores(self.gamestate, my_ants, enemy_ants, influence_by_threat, threat_distance)

        # print (influence_by_threat)
        # print (combat_scores)
        self.assertEqual(combat_scores[(5,4)], 2.02)
        self.assertEqual(combat_scores[(6,4)], 0.99)
    def test_get_combat_scores_3(self):
        'this test makes sure when we are winning, our ant will press forward'
        """
 23456789
2b....
3...a.
4..a..
5.a...
6.....
7.....
8.....
        """
        data = """
turn 1
a 2 2 1 
a 3 5 0 
a 4 4 0 
a 5 3 0
go
        """
        self.gamestate.update(data)
        my_ants = self.gamestate.my_ants()
        enemy_ants = self.gamestate.enemy_ants()
        threat_distance = self.gamestate.attackradius2
        influence_by_threat = battle_influence.get_influence_by_threat(self.gamestate, my_ants, enemy_ants, threat_distance)
        combat_scores = battle_influence.get_combat_scores(self.gamestate, my_ants, enemy_ants, influence_by_threat, threat_distance)

        # print (influence_by_threat)
        # print (combat_scores)
        self.assertTrue(combat_scores[(3,4)] > combat_scores[(3,5)])
        self.assertTrue(combat_scores[(4,3)] > combat_scores[(4,4)])
        self.assertTrue(combat_scores[(5,2)] == combat_scores[(5,3)])
    def test_get_influence_by_threat_1(self):
        """
 23456789
2..b..
3.....
4.....c
5..a..
6.....aa
7.....
8.....
        """
        data = """
turn 1
a 2 4 1 
a 5 4 0
a 6 7 0
a 6 8 0
a 4 7 2
go
        """
        self.gamestate.update(data)
        my_ants = self.gamestate.my_ants()
        enemy_ants = self.gamestate.enemy_ants()
        threat_distance = self.gamestate.attackradius2
        influence_by_owner = battle_influence.get_influence_by_owner(self.gamestate, my_ants, enemy_ants, threat_distance)
        influence_by_threat = battle_influence.get_influence_by_threat(self.gamestate, my_ants, enemy_ants, threat_distance)
        
        self.assertEqual(len(influence_by_threat), 3)
        self.assertEqual(influence_by_threat[0][4,4], 2)
        self.assertEqual(influence_by_threat[0][6,4], 0)
        self.assertEqual(influence_by_threat[0][6,6], 1)
        self.assertEqual(influence_by_threat[1][2,4], 1)
        self.assertEqual(influence_by_threat[1][2,5], 2)
        self.assertEqual(influence_by_threat[2][4,6], 4)
        self.assertEqual(influence_by_threat[2][4,7], 3)