def main(): random_seed = np.random.randint(4294967295) parameters = { "random_seed": random_seed, "n_generations": 100, "n_periods_per_generation": 30, "n_goods": 5, "n_agents": 100, "p_mutation": 0.1, "mating_rate": 0.3 } e = Economy(**parameters) e.run()
def compute(random_seed): parameters = { "mating_rate": 0.3, "max_production": 10, "n_agents": 300, "n_generations": 10**4, "n_goods": 3, "n_periods_per_generation": 5, "p_mutation": 0.1, "production_advantages": [4, 2, 0.5], "production_costs": [4, 2, 2], "random_seed": random_seed, "u": 10 } e = Economy(**parameters) return parameters, e.run()
def fun(args): n_periods_per_generation = int(args[0]) random_seed = np.random.randint(4294967295) # random_seed = 4043318547 parameters = { "random_seed": random_seed, "n_generations": 50, "n_periods_per_generation": n_periods_per_generation, "n_goods": 3, "n_agents": 1000, "p_mutation": 0.05 } e = Economy(**parameters) backup = e.run() return np.mean(backup["production_diversity"][-10:])
from economy import Economy from graph import graph from os import path random_seed = 460741801 parameters = { "mating_rate": 0.3, "max_production": 10, "n_agents": 300, "n_generations": 10**4, "n_goods": 3, "n_periods_per_generation": 5, "p_mutation": 0.1, "production_advantages": [4, 2, 0.5], "production_costs": [4, 2, 2], "random_seed": random_seed, "u": 10 } e = Economy(**parameters) backup = e.run() graph(results=backup, parameters=parameters, root_name="MB", root_folder=path.expanduser("~Desktop/MoneyBootstrapping"))