#NEWLINE# def generate_world( w , step ) : #NEWLINE# #INDENT# if isinstance ( step , str ) : #NEWLINE# #INDENT# step = Step . get_by_name ( step ) #NEWLINE# #UNINDENT# if ( not step . include_precipitations ) : #NEWLINE# #INDENT# return w #NEWLINE# #UNINDENT# rng = numpy . random . RandomState ( w . seed ) #NEWLINE# sub_seeds = rng . randint ( 0 , numpy . iinfo ( numpy . int32 ) . max , size = 100 ) #NEWLINE# seed_dict = { #NEWLINE# #INDENT# 'PrecipitationSimulation' : sub_seeds [ 0 ] , #NEWLINE# 'ErosionSimulation' : sub_seeds [ 1 ] , #NEWLINE# 'WatermapSimulation' : sub_seeds [ 2 ] , #NEWLINE# 'IrrigationSimulation' : sub_seeds [ 3 ] , #NEWLINE# 'TemperatureSimulation' : sub_seeds [ 4 ] , #NEWLINE# 'HumiditySimulation' : sub_seeds [ 5 ] , #NEWLINE# 'PermeabilitySimulation' : sub_seeds [ 6 ] , #NEWLINE# 'BiomeSimulation' : sub_seeds [ 7 ] , #NEWLINE# 'IcecapSimulation' : sub_seeds [ 8 ] , #NEWLINE# '' : sub_seeds [ 99 ] , #NEWLINE# #UNINDENT# } #NEWLINE# TemperatureSimulation ( ) . execute ( w , seed_dict [ 'TemperatureSimulation' ] ) #NEWLINE# PrecipitationSimulation ( ) . execute ( w , seed_dict [ 'PrecipitationSimulation' ] ) #NEWLINE# if ( not step . include_erosion ) : #NEWLINE# #INDENT# return w #NEWLINE# #UNINDENT# ErosionSimulation ( ) . execute ( w , seed_dict [ 'ErosionSimulation' ] ) #NEWLINE# if get_verbose ( ) : #NEWLINE# #INDENT# print ( '...erosion calculated' ) #NEWLINE# #UNINDENT# WatermapSimulation ( ) . execute ( w , seed_dict [ 'WatermapSimulation' ] ) #NEWLINE# IrrigationSimulation ( ) . execute ( w , seed_dict [ 'IrrigationSimulation' ] ) #NEWLINE# HumiditySimulation ( ) . execute ( biome_cm , seed_dict [ 'HumiditySimulation' ] ) #NEWLINE# PermeabilitySimulation ( ) . execute ( w , seed_dict [ 'PermeabilitySimulation' ] ) #NEWLINE# ( cm , biome_cm ) = BiomeSimulation ( ) . execute ( w , seed_dict [ 'BiomeSimulation' ] ) #NEWLINE# for cl in cm . keys ( ) : #NEWLINE# #INDENT# count = cm [ cl ] #NEWLINE# if get_verbose ( ) : #NEWLINE# #INDENT# print ( ( '%s = %i' % ( str ( cl ) , count ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# if get_verbose ( ) : #NEWLINE# #INDENT# print ( '' ) #NEWLINE# print ( 'Biome obtained:' ) #NEWLINE# #UNINDENT# for cl in biome_cm . keys ( ) : #NEWLINE# #INDENT# count = biome_cm [ cl ] #NEWLINE# if get_verbose ( ) : #NEWLINE# #INDENT# print ( ( ' %30s = %7i' % ( str ( cl ) , count ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# IcecapSimulation ( ) . execute ( w , seed_dict [ 'IcecapSimulation' ] ) #NEWLINE# return w