Spaces:
Runtime error
Runtime error
from CharacterStatistics import CharacterStatistics | |
from WorldSimulation import WorldSimulation | |
# 创建一个世界模拟对象 | |
simulation = WorldSimulation(world_spiritual_energy=1000000) | |
# 运行模拟 | |
simulation.add_custom_character("CoraBaby1", "女", special_constitution=[1, 0, 0, 1], spiritual_roots=[1, 1, 1, 1, 1]) | |
simulation.add_custom_character("CoraBaby2", "女", special_constitution=[0, 1, 0, 1], spiritual_roots=[1, 1, 1, 1, 1]) | |
simulation.create_population(special_constitution_ratio=[0.001, 0.001, 0.001, 0.001], spiritual_roots_ratio=[0.04, 0.04, 0.04, 0.04, 0.04], initial_population=3000) | |
simulation.run_simulation(num_rounds=10) | |
# 查看世界统计 | |
stats = CharacterStatistics(simulation.characters) | |
print(stats.summarize_markdown()) | |
print(simulation.characters[0]) | |
print(simulation.characters[1]) | |