-
Notifications
You must be signed in to change notification settings - Fork 1
/
commonVar.py.case6
233 lines (171 loc) · 6.54 KB
/
commonVar.py.case6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# commonVar.py
import os
projectVersion = "6book"
case = "6" # if missing, use ""
fgIn=fgOu=None # used in myGauss.py
build = "20200331"
debug = False
# function for the management of the parameters
def setVar():
#print(nameValues)
globals().update(nameValues)
def check(nn):
try:
globals()[nn]
return (True, globals()[nn])
except BaseException:
return (False, False)
# controlling the existence of an agent with number==0 used by reset
# step in modelActions.txt
agent1existing = False
# the time is set by ObserverSwarm with
# common.cycle=1
# in the benginning
prune = False
pruneThreshold = 0
g = 0 # this variable will contain the address of the graph
g_labels = 0 # this variable will contain the address of the labels
g_edge_labels = 0 # this variable will contain the address of the labels of the edges
btwn = 0 # this variable will contain the betweenness centrality indicators
clsn = 0 # this variable will contain the closeness centrality indicators
orderedListOfNodes = []
verbose = False
clonedN = 0
# sigma of the normal distribution used in randomize the position of the agents/nodes
# sigma=0.7
sigma = 1.2
# size of the nodes
nsize = 150
# demand funtion paramenters (1) entrepreneurs as consumers (2) employed workers
#(3) unemployed workers
# with Ci = ai + bi Y + u
# u=N(0,consumptionErrorSD)
consumptionRandomComponentSD = 0.3 # nel paper pubblicato 0.3
#(1)
a1 = 0.4
b1 = 0.55 #0.6 #0.55
# Y1=profit(t-1)+wage NB no negative consumption if profit(t-1) < 0
#(2)
a2 = 0.3
b2 = 0.65 #0.7 #0.65
# Y2=wage
#(3)
socialWelfareCompensation = 0.3 #0.7 #0.4 #0.7 #0.4 #0.7 # 0.6 #0.70 #0.60 #0.75 #0.70 #0.3
a3 = 0
b3 = 1
# Y3=socialWelfareCompensation
# quota of the unspent consumption capability coming from the past to be
# added to the current consumption plan [0, 1]
reUseUnspentConsumptionCapability= 0 #0.5 #0.5 #0 #NBNBNB #0 #0.5 #1
#wages and revenues
wageBase = 1.
wage = wageBase
fullEmploymentThreshold = 0.05
wageStepInFullEmployment = 0.10
wageAddendum = 0
wageCorrectionInCycle=0
maxAcceptableOligopolistRelativeIncrement = 0.20 #0.30 # was 0.20 in the paper
cumulativelyMeasuringNewEntrantNumber=False
temporaryRelativeWageIncrementAsBarrier = 0.15
ReferenceLevel=0 # to avoit a referenced before assignment error in WorldState
revenuesOfSalesForEachWorker = 1.005
# work troubles, production correction Psi, relative value
productionCorrectionPsi = 0.10
# does it generate a cut of the wages
wageCutForWorkTroubles = False
# price penalty for work troubles
penaltyValue = 0 # was 0.10
# labor productivity
laborProductivity = 1
# thresholds (for Version 0)
hiringThreshold = 0
firingThreshold = 0
# macro variables
totalProductionInA_TimeStep = 0
totalPlannedConsumptionInValueInA_TimeStep = 0
totalConsumptionInQuantityInA_TimeStep = 0
totalConsumptionInQuantityInPrevious_TimeStep = 0
# Poisson mean in makeProoductionPlan, will be modified in paramenters.py
# in the function loadParameters
nu = 5
# to internally calculate the Poisson mean (nu) in makeProoductionPlan
# for time=1 in V3 we use the ratio rho
rho = 0.9
# threshold toEntrepreneur
thresholdToEntrepreneur = 0.15 #0.10 #0.08 #0.085 #0.09 #0.10 #0.075 #0.05 #0.05 #0.15 #0.10 #0.075 #0.045 #0.075 # was 0.15 in the paper # was 0.20 in the init. trials
extraCostsDuration = 3 #5 #3
newEntrantExtraCosts = 60 # was 100.0 # was 2.0
randomComponentOfPlannedProduction = 0.10
# max new entrant number in a time step
absoluteBarrierToBecomeEntrepreneur = 20 #10 #20
maxDemandRelativeRandomShock = 0.15 # was 0.10 #was 0.20
# threshold toWorker
thresholdToWorker = -0.20 #-0.25 # -0.20 was the value in the paper
# price warming has to be done only once (hayekian market)
priceWarmingDone = False
# start the hayekian market at cycle ... (NB > 0)
startHayekianMarket = 51 #3 #1 #6
# use full hayekian paradigm or quasi hayekian paradigm?
# for explanations see the document
# "Oligopoly: the Making of the Simulation Model", section
# "Version 6, the hayekian market"
hParadigm= "quasi" #"full" #"noPriceMod" #"full" #"quasi"
# checking falling plannedProduction
entrepreneursMindIfPlannedProductionFalls=True #False #True
thresholdToDecreaseThePriceIfTotalPlannedPFalls=0.05 # 0.10
# thresholds to decide
# to lower the prices in the 'quasi' hParadigm
soldThreshold1=0.90 #0.85
# to raise the prices in the 'quasi' hParadigm
soldThreshold2=0.99 #0.95
# 'quasi' hParadigm, decreasingRateRange
decreasingRateRange=-0.10
# 'quasi' hParadigm, increasingRateRange
increasingRateRange=0.01
# Range of the correction of agent starting prices (h. market)
initShock = 0.10 #0.2 #0.1 #0.3
# initial shift in individual starting prices (h. market)
initShift = 1.8 #1.1 #-0.15 #1.1 #0.7 #-0.15 #-0.10 #0.5 #0.1
# Range of the correction of agent current price (h. market), as buyer/seller
runningShockB = 0.01 #0.0008 #0.2 #0.001 #0.005 #0.001 #0.0008 #0.0005 #0.0001 #0.30 #0.01 #0.05 #0.20 #0.10 #0.05
runningShockS = 0.05 #0.02 #0.20 #0.05 #0.10 #0.05
# current shift in individual price correction (h. market)
runningShiftB = 0.1 #0 #0.1
runningShiftS = 0.1 #0 #0.1
# a jump in prices made by the sellers
jump= 0.05 #0.2 #0.10 #0. #0.20 #0.05 #0.02 #0.10 #0.20 #0.10 #0.05 #0.30 #0.20 #0.10
# pjump set to -1 avoids the calculation of the jump and the generation
# of a random number
pJump= 0.2 #0.1 #0.05 #-1 #0.20 #0.5 #0.10 # 0.05
priceSwitchIfProfitFalls= "raise" #"lower" #"raise" #"lower" #"raise" #"lower"
profitStrategyReverseAfterN=5 # 0 means: acting again always possible
# a value > the number of cycles means:
# acting again never possible
# Choosing among different quasi hayekian strategies in modifying seller
# price
quasiHchoice= "profit" #"randomUp" #"unsold" #"randomUp" #"unsold" # three choices: unsold, randomUp, profit
nodeNumbersInGraph = False
# step to be executed at end (plus an optional second part added
# within oActions.py)
toBeExecuted = "saveData()"
# specialAction in observerActions.txt is evaluated to "makeSpecialAction"
# defined in oActions.py
specialAction = "makeSpecialAction()"
# with
file_modPars=False
# as feasibility control
# pars definitions to use them in the table of the modified pars
parsDict={}
# to report hayekian price st. dev. if not still calculated
hPSd = -100 # -100 will not appear in graphs
# predefintion
totalConsumptionInQuantityInPrevious1_TimeStep=0
#instruments
startingHayekianCommonPriceAlreadyWritten=False
# infos on substep output management
checkResConsUnsoldProd=True
withinASubstep=False
currentCycle=0
subStepCounter=0
readySellerList=False
sellerList=[]