This commit is contained in:
Andrew Clark 2020-08-20 15:53:34 -04:00
commit a51669185d
47 changed files with 411 additions and 365 deletions

5
.gitignore vendored
View File

@ -2,3 +2,8 @@ __pycache__
.vscode
.ipynb_checkpoints
.DS_Store
.idea
models/__pycache__
models/v3/__pycache__
models/v3/model/__pycache__
models/v3/model/parts/__pycache__

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -34,7 +34,16 @@ exp.append_configs(
)
# Initialize network x
for c in configs:
c.initial_state = deepcopy(c.initial_state)
print("Params (config.py) : ", c.sim_config['M'])
c.initial_state['network'] = initialize_network(initial_values['n'],initial_values['m'],
initial_values['funds'],
initial_values['supply'],c.sim_config['M'])
def get_configs():
'''
Function to extract the configuration information for display in a notebook.

View File

@ -1,35 +1,23 @@
import numpy as np
# Define parameter values
beta = int(0.2) # maximum share of funds a proposal can take
rho = 0.0025 # tuning param for the trigger function
# Alpha from solidity code - uint256 _decay = 9999599; // 3 days halftime. halftime_alpha = (1/2)**(1/t)
# Half life associated with solidity code alpha (in number of blocks on xDai).
# Our simulation is associated with timesteps, so our half life is based of of days.
alpha = 2**(-1/3) # timescale set in days with 3 day halflife
# Initial values
initial_values = {
'sentiment': 0.6,
'n': 30, #initial participants
'm': 7, #initial proposals
'funds': 4867.21, # in honey, as of 8-5-2020
'supply': 22392.22, # Honey total supply balance as of 8-5-2020
'params': { 'beta': beta,
'rho': rho, # tuning param for the trigger function
'alpha': alpha
},
'supply': 22392.22, # Honey total supply balance as of 8-5-2020
}
# Alpha from solidity code - uint256 _decay = 9999599; // 3 days halftime. halftime_alpha = (1/2)**(1/t)
# Half life associated with solidity code alpha (in number of blocks on xDai).
# Our simulation is associated with timesteps, so our half life is based of of days.
# Parameters
params = {
'beta': [beta],
'rho': [rho],
'alpha': [alpha],
'beta': [0.2], # maximum share of funds a proposal can take
'rho': [0.0025], # tuning param for the trigger function
'alpha': [2**(-1/3)], # timescale set in days with 3 day halflife (see above)
'gamma': [0.001], # expansion of supply per per day
'sensitivity': [.75],
'tmin': [1], #unit days; minimum periods passed before a proposal can pass

View File

@ -2,9 +2,7 @@ from .parts.utils import *
from .parts.sys_params import *
state_variables = {
'network': initialize_network(initial_values['n'],initial_values['m'],
initial_values['funds'],
initial_values['supply'],initial_values['params']),
'network': 0, # will initialize during config.py
'funds':initial_values['funds'],
'sentiment': initial_values['sentiment'],
'effective_supply': (initial_values['supply']-initial_values['funds'])*.8,