예제 #1
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)])
예제 #2
0
 def test_linprog(self):
     L = 10
     J = 10
     for l in range(2, L):
         for i in range(J):
             values = util.gen_norm_targets(l)
             g_sol = gurobi_solve(values)
             logger.debug("gurobi: " + str(g_sol))
             s_sol = scipy_solve(values)
             logger.debug("scipy: " + str(s_sol))
             self.assertEqual(g_sol, s_sol)
예제 #3
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
예제 #4
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)])
예제 #5
0
 def setUp(self):
     self.conf = False  # enable the configuration testing
     self.n = 10
     time_horizon = 1000
     targets = util.gen_norm_targets(3)
     # choose which adversaries you want to test
     self.adversaries = [#"USTO",
                         #"STA",
                         #"SUQR",
                         #"STO",
                         #"FP",
                         "usuqr"]
     self.game = game.zs_game(targets, time_horizon)
     self.defender = bm.FB(self.game, 0, 1)
     # choose the profiles
     plist = ["usto",
              "sta",
              "suqr",
              "sto",
              "fp",
              "usuqr"]
     self.pdict = util.gen_pdict(self.game, plist)
     self.profiles = [self.pdict[p].prof for p in self.pdict]
예제 #6
0
 def setUp(self):
     time_horizon = 1000
     targets = util.gen_norm_targets(5)
     self.game = game.zs_game(targets, time_horizon)