Skip to main content

Results

Here is an example how to fetch the status and results of your simulation.

# The simulation ID is coming from when you created it
mc_id = "3f16d96d-c99f-4f7c-82b6-21131e12081c"

# 1. Get the status of monte carlo simulation
status = client.simulations.monte_carlo.get_status(mc_id)
print(status)

# 2. Download raw metrics of monte carlo simulation
metrics_data = client.simulations.monte_carlo.get_metrics(mc_id, "D:/multiverse/MyAwesomeSimulation/metrics")
print(metrics_data)

# 3. Export metrics, give the folder where the raw metrics files are stored
# and the folder where the results should be stored
# filter_by requirements. Order of priority is environment_step, agents, metrics_keys (in that order, can be None)
client.simulations.monte_carlo.metrics.to_folder(
"D:/multiverse/MyAwesomeSimulation/metrics",
"D:/multiverse/MyAwesomeSimulation/metrics-filtered",
{
"address": "0xFc1C34a9FEb232358E8F26289eE01253b059f304",
"environment_step": 99,
"metrics_keys": ["PNL_THIS_STEP"],
},
)

# 4. Create a DataFrame from the metrics of interest.
df = client.simulations.monte_carlo.metrics.to_dataframe(
"D:/multiverse/MyAwesomeSimulation/metrics",
"D:/multiverse/MyAwesomeSimulation/metrics-filtered",
filter_by={},
)

# DataFrame ready for analysis and visualization!