storage-econ-model/test_main.ipynb

112 lines
4.2 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'N': 3, 'T': range(0, 182), 'M': {'block_time': 30, 'i_storage': 500, 'i_in_bandwidth': 500, 'i_out_bandwidth': 140, 'j_storage': 500, 'j_in_bandwidth': 400, 'j_out_bandwidth': 100, 'p_storage': 4000, 'p_in_bandwidth': 400, 'p_out_bandwidth': 600, 'k_storage': 8000, 'k_in_bandwidth': 400, 'k_out_bandwidth': 80, 'j_avail_to_i': 0.9, 'k_avail_to_i': 0.8, 'j_avail_to_k': 0.7, 'p_avail_to_i': 0.6, 'depth': 15}}, {'N': 3, 'T': range(0, 182), 'M': {'block_time': 30, 'i_storage': 500, 'i_in_bandwidth': 1234, 'i_out_bandwidth': 140, 'j_storage': 500, 'j_in_bandwidth': 400, 'j_out_bandwidth': 100, 'p_storage': 4000, 'p_in_bandwidth': 400, 'p_out_bandwidth': 600, 'k_storage': 8000, 'k_in_bandwidth': 400, 'k_out_bandwidth': 80, 'j_avail_to_i': 0.9, 'k_avail_to_i': 0.8, 'j_avail_to_k': 0.7, 'p_avail_to_i': 0.6, 'depth': 15}}]\n",
"[{'N': 3, 'T': range(0, 182), 'M': {'block_time': 30, 'i_storage': 500, 'i_in_bandwidth': 500, 'i_out_bandwidth': 140, 'j_storage': 500, 'j_in_bandwidth': 400, 'j_out_bandwidth': 100, 'p_storage': 4000, 'p_in_bandwidth': 400, 'p_out_bandwidth': 600, 'k_storage': 8000, 'k_in_bandwidth': 400, 'k_out_bandwidth': 80, 'j_avail_to_i': 0.9, 'k_avail_to_i': 0.8, 'j_avail_to_k': 0.7, 'p_avail_to_i': 0.6, 'depth': 15}}, {'N': 3, 'T': range(0, 182), 'M': {'block_time': 30, 'i_storage': 500, 'i_in_bandwidth': 1234, 'i_out_bandwidth': 140, 'j_storage': 500, 'j_in_bandwidth': 400, 'j_out_bandwidth': 100, 'p_storage': 4000, 'p_in_bandwidth': 400, 'p_out_bandwidth': 600, 'k_storage': 8000, 'k_in_bandwidth': 400, 'k_out_bandwidth': 80, 'j_avail_to_i': 0.9, 'k_avail_to_i': 0.8, 'j_avail_to_k': 0.7, 'p_avail_to_i': 0.6, 'depth': 15}}]\n"
]
}
],
"source": [
"from src.sim import run\n",
"import matplotlib.pyplot as plt\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" __________ ____ \n",
" ________ __ _____/ ____/ | / __ \\\n",
" / ___/ __` / __ / / / /| | / / / /\n",
" / /__/ /_/ / /_/ / /___/ ___ |/ /_/ / \n",
" \\___/\\__,_/\\__,_/\\____/_/ |_/_____/ \n",
" by BlockScience\n",
" \n",
"Execution Mode: multi_proc: [<cadCAD.configuration.Configuration object at 0x00000255875CDA58>, <cadCAD.configuration.Configuration object at 0x00000255875CDA90>]\n",
"Configurations: [<cadCAD.configuration.Configuration object at 0x00000255875CDA58>, <cadCAD.configuration.Configuration object at 0x00000255875CDA90>]\n"
]
}
],
"source": [
"experiments = run.run()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'src.model.utils.Event'>: {'sending_node': 'i', 'receiving_node': 'j', 'hash_file': 2, 'size': 3, 'block_init': 4, 'reward': 5, 'block_end': None, 'storing_node': None, 'proving_node': None, 'time': None}\n"
]
}
],
"source": [
"print(experiments.dataset[0]['event'][4])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'src.model.utils.History'>: {'active': [<src.model.utils.Event object at 0x000002558AF62E10>], 'routed': [], 'solved': []}\n"
]
}
],
"source": [
"print(experiments.dataset[0]['history'][4])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}