Example #1
0
    def _generate_world(xdim, ydim, sea_tiles):
        communities = [
            Community(default_parameters) for i in range(xdim * ydim)
        ]
        for coordinate in sea_tiles:
            x, y = coordinate
            communities[x + y * xdim] = Community(default_parameters,
                                                  landscape=terrain.sea)

        world = World(xdim, ydim, communities, default_parameters)
        return world
Example #2
0
def strong_polity():
    state_size = 20
    state = polity.Polity(
        [Community(default_parameters) for i in range(state_size)])
    for tile in state.communities:
        tile.ultrasocietal_traits = ([True] *
                                     default_parameters.n_ultrasocietal_traits)
    return state
Example #3
0
def weak_polity():
    state_size = 1
    state = polity.Polity(
        [Community(default_parameters) for i in range(state_size)])
    return state
Example #4
0
def mediocre_polity():
    state_size = 5
    state = polity.Polity(
        [Community(default_parameters) for i in range(state_size)])
    return state
Example #5
0
def polity_10():
    state = polity.Polity(
        [Community(default_parameters) for i in range(10)]
        )
    return state
Example #6
0
 def test_new_community(self, polity_10):
     state = polity_10
     state.add_community(Community(default_parameters))
     assert state.communities[-1].polity is state
Example #7
0
 def test_add_community(self, polity_10):
     state = polity_10
     state.add_community(Community(default_parameters))
     assert state.size() == 11
Example #8
0
 def _arbitrary_polity(size):
     state = polity.Polity(
         [Community(default_parameters) for i in range(size)]
         )
     return state
Example #9
0
 def _basic_community(params=default_parameters):
     return Community(params)
Example #10
0
    def test_steppe_community(self):
        tile = Community(default_parameters, landscape=terrain.steppe)

        assert (
            tile.total_military_techs() == default_parameters.n_military_techs)
Example #11
0
def advanced_community():
    tile = Community(default_parameters)
    tile.military_techs = [True] * default_parameters.n_military_techs
    return tile
Example #12
0
def world_5x5():
    communities = [Community(default_parameters) for i in range(25)]
    world = World(5, 5, communities, default_parameters)
    return world
Example #13
0
 def _generate_world(xdim, ydim, params=default_parameters):
     communities = [Community(params) for i in range(xdim * ydim)]
     world = World(xdim, ydim, communities, params)
     return world