def setUp(self): time_horizon = 2 targets = [1, 2, 3] self.game = game.zs_game(targets, time_horizon) attacker = atk.FictitiousPlayerAttacker(self.game, 1, 1) defender = player.Defender(self.game, 0, 1) self.game.set_players([defender], [attacker], [])
def setUp(self): time_horizon = 100 targets = [1, 2, 3] self.game = game.zs_game(targets, time_horizon) attacker = atk.StackelbergAttacker(self.game, 1, 1) defender = player.Defender(self.game, 0, 1) self.game.set_players([defender], [attacker], [])
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)])
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
def gen_profiles(targets, p_pair_lst): """ the p_pair_lst is formed by pairs of this type: (attacker_class, number) which indicate what should be the composition of the profiles list """ import source.game as game mock_game = game.zs_game(targets, 1) profiles = [] for c, n in p_pair_lst: for i in range(n): profiles.append(c(mock_game, 1)) return profiles
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)])
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]
def setUp(self): time_horizon = 1000 targets = util.gen_norm_targets(5) self.game = game.zs_game(targets, time_horizon)
def setUp(self): time_horizon = 1 targets = [1, 2, 3] self.game = game.zs_game(targets, time_horizon)