示例#1
0
 def setUp(self):
     time_horizon = 1000
     targets = util.gen_norm_targets(10)
     self.game = game.zs_game(targets, time_horizon)
     self.profiles1 = util.gen_profiles(targets,
                                        [(atk.UnknownStochasticAttacker, 1),
                                         (atk.StackelbergAttacker, 1),
                                         (atk.StochasticAttacker, 5),
                                         (atk.FictitiousPlayerAttacker, 1)])
     self.profiles2 = util.gen_profiles(targets, [(atk.SUQR, 5)])
     self.profiles3 = util.gen_profiles(targets, [(atk.SUQR, 5)])
     for p in self.profiles3:
         p._use_memory = False
示例#2
0
 def setUp(self):
     time_horizon = 100
     targets = util.gen_norm_targets(10)
     self.game = game.zs_game(targets, time_horizon)
     self.profiles = util.gen_profiles(targets,
                                       [(atk.UnknownStochasticAttacker, 1),
                                        (atk.StackelbergAttacker, 1),
                                        (atk.SUQR, 1),
                                        (atk.StochasticAttacker, 1),
                                        (atk.FictitiousPlayerAttacker, 1)])
示例#3
0
 def setUp(self):
     self.conf = True  # enable the configuration testing
     time_horizon = 100
     self.n = 10
     targets = util.gen_norm_targets(3)
     # choose which adversaries you want to test
     self.adversaries = [
         dt.Ad.USTO, dt.Ad.STA, dt.Ad.SUQR, dt.Ad.STO, dt.Ad.FP
     ]
     self.game = game.zs_game(targets, time_horizon)
     self.defender = FR(self.game, 0, 1, h_max=1)
     # choose the profiles
     self.profiles = util.gen_profiles(targets,
                                       [(atk.UnknownStochasticAttacker, 1),
                                        (atk.StackelbergAttacker, 1),
                                        (atk.SUQR, 1),
                                        (atk.StochasticAttacker, 1),
                                        (atk.FictitiousPlayerAttacker, 1)])
示例#4
0
 def test_player_str(self):
     targets = [1, 2, 3]
     for a in att_classes:
         with self.subTest(i=a):
             att = util.gen_profiles(targets, [(a, 1)])[0]
             self.parse_player(str(att), a)