recupération de la fonction btc fees et main.py
parent
341f845190
commit
3db64cf1e8
|
|
@ -35,7 +35,6 @@ class Populations:
|
||||||
self.population = self.population.append(pd.Series(inds, index=range(start, end)))
|
self.population = self.population.append(pd.Series(inds, index=range(start, end)))
|
||||||
self.nmbr += nb
|
self.nmbr += nb
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
class Individu: #tout OK
|
class Individu: #tout OK
|
||||||
"""
|
"""
|
||||||
|
|
@ -76,4 +75,32 @@ class Individu: #tout OK
|
||||||
abs(np.random.normal(
|
abs(np.random.normal(
|
||||||
loc=10, scale=50))
|
loc=10, scale=50))
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
class Transaction:
|
||||||
|
"""
|
||||||
|
This class keeps track of the transactions
|
||||||
|
"""
|
||||||
|
def __init__(self):
|
||||||
|
self.btc=0
|
||||||
|
self.etg=0
|
||||||
|
self.mgn=0
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def fees_btc(nbr_transaction_btc):
|
||||||
|
"""
|
||||||
|
Cette fonction calcule une version simplifié des frais de transaction
|
||||||
|
"""
|
||||||
|
# Dans un premier temps je vais prendre pour valeur pour valeur de transfere :
|
||||||
|
# 20sat/byte
|
||||||
|
# On simplifie aussi en considerant qu'on a 1 input et 1 output
|
||||||
|
fees_btc = (nbr_transaction_btc*180 + 40 + nbr_transaction_btc)*20
|
||||||
|
return fees_btc
|
||||||
|
|
||||||
|
def fees_eth(nbr_transaction_eth):
|
||||||
|
return
|
||||||
|
|
||||||
|
def fees_mgn(nbr_transaction_mgn):
|
||||||
|
return
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import MagnaSim
|
import MagnaSim as MaSi
|
||||||
pop = MagnaSim.Populations(10)
|
pop = MaSi.Populations(10)
|
||||||
|
trans = MaSi.Transaction()
|
||||||
for i in pop.population:
|
for i in pop.population:
|
||||||
x = np.random.normal(i.magna_wallet_btc[0],i.magna_wallet_btc[1])
|
x = np.random.normal(i.magna_wallet_btc[0],i.magna_wallet_btc[1])
|
||||||
|
trans.btc+=1
|
||||||
print(abs(x))
|
print(abs(x))
|
||||||
|
print("Nombre de BTC : {:f}".format(MaSi.fees_btc(trans.btc)*0.0000001))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue