Ejemplo n.º 1
0
def test_gen_profiles(players, strategies, _):
    """Test gen profiles"""
    base = rsgame.empty(players, strategies)
    game = gamegen.gen_profiles(base)
    assert game.is_complete(), "didn't generate a full game"
    assert np.all(players == game.num_role_players), \
        "didn't generate correct number of strategies"
    assert np.all(strategies == game.num_role_strats), \
        "didn't generate correct number of strategies"

    game = gamegen.gen_profiles(base, 0.0)
    assert game.is_empty(), "didn't generate a full game"

    game = gamegen.gen_profiles(base, 0.5)

    game = gamegen.gen_num_profiles(base, base.num_all_profiles // 2)
    assert game.num_profiles == game.num_all_profiles // 2
Ejemplo n.º 2
0
def test_gen_profiles(players, strategies, _):
    """Test gen profiles"""
    base = rsgame.empty(players, strategies)
    game = gamegen.gen_profiles(base)
    assert game.is_complete(), "didn't generate a full game"
    assert np.all(players == game.num_role_players), \
        "didn't generate correct number of strategies"
    assert np.all(strategies == game.num_role_strats), \
        "didn't generate correct number of strategies"

    game = gamegen.gen_profiles(base, 0.0)
    assert game.is_empty(), "didn't generate a full game"

    game = gamegen.gen_profiles(base, 0.5)

    game = gamegen.gen_num_profiles(base, base.num_all_profiles // 2)
    assert game.num_profiles == game.num_all_profiles // 2
Ejemplo n.º 3
0
def fix_game(jgame):
    """Return game"""
    return gamegen.gen_profiles(gamereader.loadj(jgame))
Ejemplo n.º 4
0
def game():
    """Base game"""
    return gamegen.gen_profiles(egame(), 0.5)
Ejemplo n.º 5
0
def test_gen_profiles_large_game():
    """Test generate profiles of a large game"""
    base = rsgame.empty([100] * 2, 30)
    game = gamegen.gen_profiles(base, 1e-55)
    assert game.num_profiles == 363
Ejemplo n.º 6
0
def test_gen_profiles_large_game():
    """Test generate profiles of a large game"""
    base = rsgame.empty([100] * 2, 30)
    game = gamegen.gen_profiles(base, 1e-55)
    assert game.num_profiles == 363
Ejemplo n.º 7
0
def game():
    """Base game"""
    return gamegen.gen_profiles(egame(), 0.5)