We are excited to announce BAM Engine 0.5.1 and the launch of bamengine.org.
Read more...sim.use(EXTENSION) call. Extensible design for custom model components.pip install bamengineimport bamengine as bam
sim = bam.Simulation.init(n_firms=100, n_households=500, seed=42)
results = sim.run(n_periods=100, collect=True)We are excited to announce BAM Engine 0.5.1 and the launch of bamengine.org.
Read more...import bamengine as bam
sim = bam.Simulation.init(seed=42,
logging={"default_level": "ERROR"})
results = sim.run(n_periods=100,
collect=True)
avg_price = results.economy_data["avg_price"]
inflation = results.economy_data["inflation"]
print(f'Final Average Market Price '
f'at period {sim.t}: '
f'{avg_price[-1]:.2}')import matplotlib.pyplot as plt
fig, (ax1, ax2) = plt.subplots(1, 2,
figsize=(12, 4))
ax1.plot(inflation)
ax1.set_title('Inflation Rate')
ax1.set_xlabel('Period')
ax1.grid(True, alpha=0.3)
ax2.plot(avg_price)
ax2.set_title('Average Market Price')
ax2.set_xlabel('Period')
ax2.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()