commit b81c5c1e62fdc3287e425482d9fe4028957d0f1e Author: Mushu Date: Mon Oct 8 12:41:59 2018 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bee8a64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ diff --git a/MagnaSim.py b/MagnaSim.py new file mode 100755 index 0000000..2072106 --- /dev/null +++ b/MagnaSim.py @@ -0,0 +1,79 @@ +#! /usr/bin/env python3 + +import math +import numpy as np +import pandas as pd + +class Populations: + """ + This class is made of a pd.Series of the clients and the operation that + can be made on the population. + """ + def __init__(self, carac): + """ + Population constructor, initialises the client population with + the caracterictic given to it. + """ + self.population = pd.Series() + self.nmbr = carac + self.add_client(self.nmbr) + """ + We have to define more caracteristics. We will start with a + simple serie of inds and their number + """ + return + + def add_client(self, nb):#Need to add an arg "habits" + """ + Add 'nb' clients to the population. + """ + start = len(self.population) + end = start + nb + inds = [] + for i in range(nb): + inds.append(Individu()) + self.population = self.population.append(pd.Series(inds, index=range(start, end))) + self.nmbr += nb + return + + +class Individu: #tout OK + """ + This class define the clients, it's caracteristics being : + - User habits : + - The habits with the Magna Wallet and the 3 tokens : + -self.magna_wallet_btc + -self.magna_wallet_eth + -self.magna_wallet_mgn + They containe statisctical law of the user habits. + The methods of this class operate on only one client. + """ + + def __init__(self):#OK + """ + Constructeur d'une instance 'individu'. + Ce constructeur fait appel aux fonction especes et aleatoire + pour initialisé les variables d'un individu aux valeurs propres + à son espèce. + """ + # Those 3 caracteristic are the users habits concerning the client + # use of Magna Wallet + self.magna_wallet_btc = ( + np.random.normal( + loc=0.00001, scale=0.002), + abs(np.random.normal( + loc=0.002, scale=0.01)) + ) + self.magna_wallet_eth = ( + np.random.normal( + loc=0.01, scale=0.9), + abs(np.random.normal( + loc=0.5, scale=5)) + ) + self.magna_wallet_mgn = ( + np.random.normal( + loc=1, scale=10), + abs(np.random.normal( + loc=10, scale=50)) + ) + return \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7c4f400 --- /dev/null +++ b/README.md @@ -0,0 +1,80 @@ +#Project title + +MagnaSim is intended to simulation clients usage of the Magna ecosystem. + +#Motivation + +From that simulation we want to obtain different information : +- What should be the pricing ? +- What should be the descrease rate of token's volume, assuming \ +the current eurostat demographic projections ? + +#Status + +__to be done__ +*Build status of continus integration i.e. travis, appveyor etc. Ex. -* + +##Task list +- [x]Population generation. +- []Crypto fees : + - [x]BTC fees calculation + - []ETH fees calculation + - []Stellar fees calculation +- []Setting user interface to modify parameters + +#Code style + +[PEP8](https://www.python.org/dev/peps/pep-0008/) + +#Screenshots + +__to be done__ +*Include logo/demo screenshot etc.* + +#Tech/framework used + +__to be done__ + +#Features + +__to be done__ +*What makes your project stand out?* + +#Code Example + +__to be done__ +*Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.* + +#Installation + +__to be done__ +Provide step by step series of examples and explanations about how to get a development env running. + +#API Reference + +__to be done__ +*Depending on the size of the project, if it is small and simple enough the reference docs can be added to the README. For medium size to larger projects it is important to at least provide a link to where the API reference docs live.* + +#Tests + +__to be done__ +*Describe and show how to run the tests with code examples.* + +#How to use? + +__to be done__ +*If people like your project they’ll want to learn how they can use it. To do so include step by step guide to use your project.* + +#Contribute + +__to be done__ +*Let people know how they can contribute into your project. A contributing guideline will be a big plus.* + +#Credits + +__to be done__ + +#License + +__to be done__ +*MIT © Yourname* diff --git a/main.py b/main.py new file mode 100755 index 0000000..dfcb97e --- /dev/null +++ b/main.py @@ -0,0 +1,10 @@ +#! /usr/bin/env python3 +import math +import numpy as np +import pandas as pd +import MagnaSim +pop = MagnaSim.Populations(10) + +for i in pop.population: + x = np.random.normal(i.magna_wallet_btc[0],i.magna_wallet_btc[1]) + print(abs(x))