diff --git a/MagnaSim.py b/MagnaSim.py old mode 100755 new mode 100644 index 2072106..e6f305c --- a/MagnaSim.py +++ b/MagnaSim.py @@ -35,7 +35,6 @@ class Populations: self.population = self.population.append(pd.Series(inds, index=range(start, end))) self.nmbr += nb return - class Individu: #tout OK """ @@ -76,4 +75,32 @@ class Individu: #tout OK abs(np.random.normal( loc=10, scale=50)) ) - return \ No newline at end of file + 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 + diff --git a/main.py b/main.py old mode 100755 new mode 100644 index dfcb97e..5cb291c --- a/main.py +++ b/main.py @@ -2,9 +2,11 @@ import math import numpy as np import pandas as pd -import MagnaSim -pop = MagnaSim.Populations(10) - +import MagnaSim as MaSi +pop = MaSi.Populations(10) +trans = MaSi.Transaction() for i in pop.population: x = np.random.normal(i.magna_wallet_btc[0],i.magna_wallet_btc[1]) + trans.btc+=1 print(abs(x)) +print("Nombre de BTC : {:f}".format(MaSi.fees_btc(trans.btc)*0.0000001))