<jupyter_start><jupyter_text>TFT Simulation![graph_women.png](attachment:graph_women.png)<jupyter_code>## Simulation Arguments 
from lib import *
simulation = j.tools.tfgrid_simulator.simulation_get(name="default")
server = simulation.environment.node_normalized ;
if simulation.config.tft_pricing_type=="AUTO":
    C=f"""
     ## Simulation parameters used    
    
     - TFT Price auto calculated, see params valuation to change how the valuation has been calculated
     - Simulated nr of nodes in 5 years from now: {simulation.config.node_growth}
     
     ### Pricing used
     
     - CU price (4 GB men, 2 vcpu)          : {simulation.config.pricing.price_cu}
     - SU price (1 TB netto usable storage) : {simulation.config.pricing.price_su}
     - NU price (1 GB Transfer)             : {simulation.config.pricing.price_nu}
               
     
    """
else:
    C=f"""
     ## Simulation parameters used
     
     - TFT Price over 5 year: {simulation.config.tft_price_5y}
     - Simulated nr of nodes in 5 years from now: {simulation.config.node_growth}
     
     ### Pricing used
     
     - CU price (4 GB men, 2 vcpu)          : {simulation.config.pricing.price_cu}
     - SU price (1 TB netto usable storage) : {simulation.config.pricing.price_su}
     - NU price (1 GB Transfer)             : {simulation.config.pricing.price_nu}     
     
    """    
C=j.core.tools.text_strip(C)        
md(C)
md(f"""

- nr of nodes at start: {simulation.nodebatches[0].nrnodes}
- nr of months left (avg out) for farming of startingnodes: {simulation.nodebatches[0].months_left}
- nr of TFT already farmed: { j.data.types.numeric.clean(simulation.nodebatches[0].tft_farmed_before_simulation)} 

""")<jupyter_output><empty_output><jupyter_text>Device Details<jupyter_code>md(f"""
### Device Details

- nr of TB netto usable = {round(server.production.su,1)} TB
- nr of cpu cores = {round(server.production.cru,1)} Cores
- power used = {server.total.power} watt
- performance in passmark = {round(server.production.cu_passmark*server.production.cu)}

""")<jupyter_output><empty_output><jupyter_text>Growth per month<jupyter_code>simulation.graph_nr_nodes()<jupyter_output><empty_output><jupyter_text>Number of racks per month<jupyter_code>x=np.arange(0,60)
cells= [int(i/44) for i in simulation.sheet.rows.rackspace_u.cells[0:60]]
fig = go.FigureWidget(data=go.Scatter(x=x, y=cells))
fig.update_layout(title = 'Racks Occupied per Month',showlegend=False)
# fig
cells= [int(i) for i in simulation.sheet.rows.power_kw.cells[0:60]]
fig = go.FigureWidget(data=go.Scatter(x=x, y=cells))
fig.update_layout(title = 'Kwatt/h per Month used.',showlegend=False)
fig<jupyter_output><empty_output><jupyter_text>TFT Growth<jupyter_code>names=["farmed","cultivated","sold","burned","farmer_income"]
def do(end):
    fig = go.FigureWidget()
    title = 'TFT Farmed, Cultivated, Sold, Burned per month, for batch month:%s.'%end
    xx=[i for i in range(1,end+1)]
    for i in range(5):
        name=names[i]
        cells=simulation.rows["tft_%s"%name].cells[1:end+1]
        fig.add_trace(go.Scatter(x=xx, y=cells,name=name))
    fig.update_layout(title = title,showlegend=True)
    return fig

do(12)
do(30)
do(60)
fig_nrnodes, fig_tft_movement, fig_nrtokens, fig_grid_valuation, fig_tft_marketcap=simulation.graph_tft_simulation(show=False);
fig_nrnodes
fig_tft_movement
fig_nrtokens
fig_tft_marketcap
fig_grid_valuation<jupyter_output><empty_output><jupyter_text>Token price per month<jupyter_code>simulation.graph_token_price()<jupyter_output><empty_output><jupyter_text>Details- parameters used:<jupyter_code>j.tools.tfgrid_simulator.simulator_config<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1251700680272109, 'fraction_numerical': 0.010612244897959184, 'mean_word_length': 4.494768310911809, 'pattern_counts': {'":': 1, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '398154', 'license': 'Apache-2.0', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1308, 'n_words': 250, 'path': 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/threefold_simulator.ipynb', 'repo_name': 'threefoldtech/jumpscaleX_libs_extra', 'size': '3675'}