Пример #1
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
Пример #2
0
def construct_model(stdev, input):
    options = input.get('options', {})
    if input['type'] == 'gaussian':
        return MultimodalNormalNoise(stdev, **options)
    if input['type'] == 'file':
        return SimulationBasedGame(Reductions.deviation_preserving_reduction(GameIO.read(input['file']), {'All': 6}))