예제 #1
0
    def test_ground_unit_balanced_conflict_same_units(self):
        '''
        '''
        logger.info("same units")
        for u1, u2 in [(u,u) for u in unit_list]:
            if os.getenv("TRAVIS") == 'true':
                print("outputin' something to let Travis know we're not dead (yet)")
            wins = {}
##            number_of_tests_to_run = 1000 # ne pas toucher !
            for x in range(1,number_of_tests_to_run+1):
                unit1 = GroundUnit(u1)
                unit1.name = "{}_1".format(unit1.name)
                unit2 = GroundUnit(u2)
                unit2.name = "{}_2".format(unit2.name)
                resolve_conflict(wins,unit1,unit2)
            show_results(wins,unit1,unit2)
예제 #2
0
    def test_ground_unit_unbalanced_conflict_size(self):
        '''
        '''
        logger.info("testing size modifications")
        for u1, u2 in [(u,u) for u in unit_list]:
##            number_of_tests_to_run =1000
            for mod in [1,0.9,0.8,0.7,0.6,0.5]:
                if os.getenv("TRAVIS") == 'true':
                    print("outputin' something to let Travis know we're not dead (yet)")
                wins = {}
                logger.info("unit2.size * {}".format(mod))
                for x in range(1,number_of_tests_to_run+1):
                    unit1 = GroundUnit(u1)
                    unit1.name = "{}_1".format(unit1.name)
                    unit2 = GroundUnit(u2)
                    unit2.name = "{}_2".format(unit2.name)
                    unit2.size *= mod
                    resolve_conflict(wins,unit1,unit2)
                show_results(wins,unit1,unit2)
예제 #3
0
    def test_ground_unit_manual_tinkering(self):
        '''
        '''
        logger.info("manual testing")
        u1 = T54
        u2 = T80
        wins = {}
        if os.getenv("TRAVIS") == 'true':
            print("outputin' something to let Travis know we're not dead (yet)")
##        number_of_tests_to_run = 100
##        for u1, u2 in [(u,u) for u in unit_list]:
        for x in range(1,number_of_tests_to_run+1):
            unit1 = GroundUnit(u1)
            unit1.name = "{}_1".format(unit1.name)
            unit2 = GroundUnit(u2)
            unit2.name = "{}_2".format(unit2.name)
##            unit2.size *= 0.5
            resolve_conflict(wins, unit1, unit2)

        show_results(wins,unit1,unit2)
예제 #4
0
 def test_ground_unit_balanced_conflict_same_units(self):
     '''
     '''
     logger.info("same units")
     for u1, u2 in [(u, u) for u in unit_list]:
         if os.getenv("TRAVIS") == 'true':
             print(
                 "outputin' something to let Travis know we're not dead (yet)"
             )
         wins = {}
         ##            number_of_tests_to_run = 1000 # ne pas toucher !
         for x in range(1, number_of_tests_to_run + 1):
             unit1 = GroundUnit(u1)
             unit1.name = "{}_1".format(unit1.name)
             unit2 = GroundUnit(u2)
             unit2.name = "{}_2".format(unit2.name)
             resolve_conflict(wins, unit1, unit2)
         show_results(wins, unit1, unit2)
예제 #5
0
 def test_ground_unit_unbalanced_conflict_size(self):
     '''
     '''
     logger.info("testing size modifications")
     for u1, u2 in [(u, u) for u in unit_list]:
         ##            number_of_tests_to_run =1000
         for mod in [1, 0.9, 0.8, 0.7, 0.6, 0.5]:
             if os.getenv("TRAVIS") == 'true':
                 print(
                     "outputin' something to let Travis know we're not dead (yet)"
                 )
             wins = {}
             logger.info("unit2.size * {}".format(mod))
             for x in range(1, number_of_tests_to_run + 1):
                 unit1 = GroundUnit(u1)
                 unit1.name = "{}_1".format(unit1.name)
                 unit2 = GroundUnit(u2)
                 unit2.name = "{}_2".format(unit2.name)
                 unit2.size *= mod
                 resolve_conflict(wins, unit1, unit2)
             show_results(wins, unit1, unit2)
예제 #6
0
    def test_ground_unit_manual_tinkering(self):
        '''
        '''
        logger.info("manual testing")
        u1 = T54
        u2 = T80
        wins = {}
        if os.getenv("TRAVIS") == 'true':
            print(
                "outputin' something to let Travis know we're not dead (yet)")


##        number_of_tests_to_run = 100
##        for u1, u2 in [(u,u) for u in unit_list]:
        for x in range(1, number_of_tests_to_run + 1):
            unit1 = GroundUnit(u1)
            unit1.name = "{}_1".format(unit1.name)
            unit2 = GroundUnit(u2)
            unit2.name = "{}_2".format(unit2.name)
            ##            unit2.size *= 0.5
            resolve_conflict(wins, unit1, unit2)

        show_results(wins, unit1, unit2)