def main():
    parser = IO.io_parser('Create Data for Memory Experiments')
    parser.add_argument('players', type=int, help='number of players')
    parser.add_argument('strategies', type=int, help='number of strategies')
    IO.sys.argv = IO.sys.argv[:3] + ["-input", None] + IO.sys.argv[3:]
    args = parser.parse_args()
    game = RandomGames.uniform_symmetric_game(args.players, args.strategies, 0, 100).to_asymmetric_game()
    open(args.output + ".nfg", 'w').write(IO.to_NFG_asym(game))
Beispiel #2
0
def construct_game(input):
    options = input.get('options', {})
    if input['type'] == 'local_effect':
        game = RandomGames.local_effect_game(**options)
        RandomGames.rescale_payoffs(game)
    elif input['type'] == 'congestion':
        game = RandomGames.congestion_game(**options)
        RandomGames.rescale_payoffs(game)
    elif input['type'] == 'uniform':
        game = RandomGames.uniform_symmetric_game(**options)
        RandomGames.rescale_payoffs(game)
    elif input['type'] == 'file':
        game = Reductions.deviation_preserving_reduction(GameIO.read(input['file']), {'All': 6})
    return game