Ejemplo n.º 1
0
    def test_center_land(self):
        w = World.from_pickle_file("%s/plates_279.world" % self.tests_data_dir)

        # We want to have less land than before at the borders
        el_before = TestGeneration._mean_elevation_at_borders(w)
        center_land(w)
        el_after = TestGeneration._mean_elevation_at_borders(w)
        self.assertTrue(el_after <= el_before)
Ejemplo n.º 2
0
    def test_center_land(self):
        w = World.open_protobuf("%s/seed_28070.world" % self.tests_data_dir)

        # We want to have less land than before at the borders
        el_before = TestGeneration._mean_elevation_at_borders(w)
        center_land(w)
        el_after = TestGeneration._mean_elevation_at_borders(w)
        self.assertTrue(el_after <= el_before)
Ejemplo n.º 3
0
    def test_center_land(self):
        w = World.open_protobuf("%s/seed_28070.world" % self.tests_data_dir)

        # We want to have less land than before at the borders
        el_before = TestGeneration._mean_elevation_at_borders(w)
        center_land(w)
        el_after = TestGeneration._mean_elevation_at_borders(w)
        self.assertTrue(el_after <= el_before)
Ejemplo n.º 4
0
 def run(self):
     # FIXME it should be merged with world_gen
     finished = False
     while not finished:
         (finished, n_steps) = self.plates_generation.step()
         self.ui.set_status('Plate simulation: step %i' % n_steps)
     self.ui.set_status('Plate simulation: terminating plates simulation')
     w = self.plates_generation.world()
     self.ui.set_status('Plate simulation: center land')
     center_land(w)
     self.ui.set_status('Plate simulation: adding noise')
     add_noise_to_elevation(w, random.randint(0, 4096))
     self.ui.set_status('Plate simulation: forcing oceans at borders')
     place_oceans_at_map_borders(w)
     self.ui.set_status('Plate simulation: finalization (can take a while)')
     initialize_ocean_and_thresholds(w)
     self.ui.set_status('Plate simulation: completed')
     self.ui.world = w
     self.ui.on_finish()
Ejemplo n.º 5
0
 def run(self):
     # FIXME it should be merged with world_gen
     finished = False
     while not finished:
         (finished, n_steps) = self.plates_generation.step()
         self.ui.set_status('Plate simulation: step %i' % n_steps)
     self.ui.set_status('Plate simulation: terminating plates simulation')
     w = self.plates_generation.world()
     self.ui.set_status('Plate simulation: center land')
     center_land(w)
     self.ui.set_status('Plate simulation: adding noise')
     add_noise_to_elevation(w, random.randint(0, 4096))
     self.ui.set_status('Plate simulation: forcing oceans at borders')
     place_oceans_at_map_borders(w)
     self.ui.set_status('Plate simulation: finalization (can take a while)')
     initialize_ocean_and_thresholds(w)
     self.ui.set_status('Plate simulation: completed')
     self.ui.world = w
     self.ui.on_finish()