mirror of
https://github.com/gsi-upm/soil
synced 2024-12-22 08:18:13 +00:00
More translated variables
This commit is contained in:
parent
d3d7e1d4c9
commit
127a220fa6
@ -67,7 +67,7 @@ def init():
|
||||
tweet_probability_users = 0.44
|
||||
tweet_relevant_probability = 0.25
|
||||
tweet_probability_about = [0.15, 0.15, 0.15]
|
||||
sentiment_about = [0, 0, 0] #Valores por defecto
|
||||
sentiment_about = [0, 0, 0] #Default values
|
||||
##Enterprises
|
||||
tweet_probability_enterprises = [0.3, 0.3, 0.3]
|
||||
|
||||
|
22
soil.py
22
soil.py
@ -51,18 +51,18 @@ for time in range(0, settings.max_time):
|
||||
real_time = time * settings.timeout
|
||||
activity= False
|
||||
for x in range(0, settings.number_of_nodes):
|
||||
if attribute_plot in models.networkStatus["agente_%s" % x]:
|
||||
if real_time in models.networkStatus["agente_%s" % x][attribute_plot]:
|
||||
if models.networkStatus["agente_%s" % x][attribute_plot][real_time] == 1: ##Representar infectados
|
||||
if attribute_plot in models.networkStatus["agent_%s" % x]:
|
||||
if real_time in models.networkStatus["agent_%s" % x][attribute_plot]:
|
||||
if models.networkStatus["agent_%s" % x][attribute_plot][real_time] == 1: ##Infected
|
||||
value_infectados += 1
|
||||
activity = True
|
||||
if models.networkStatus["agente_%s" % x][attribute_plot][real_time] == 0: ##Representar neutrales
|
||||
if models.networkStatus["agent_%s" % x][attribute_plot][real_time] == 0: ##Neutral
|
||||
value_neutral += 1
|
||||
activity = True
|
||||
if models.networkStatus["agente_%s" % x][attribute_plot][real_time] == 2: ##Representar cured
|
||||
if models.networkStatus["agent_%s" % x][attribute_plot][real_time] == 2: ##Cured
|
||||
value_cured += 1
|
||||
activity = True
|
||||
if models.networkStatus["agente_%s" % x][attribute_plot][real_time] == 3: ##Representar vaccinated
|
||||
if models.networkStatus["agent_%s" % x][attribute_plot][real_time] == 3: ##Vaccinated
|
||||
value_vaccinated += 1
|
||||
activity = True
|
||||
|
||||
@ -89,14 +89,14 @@ plt.savefig('control_model.png')
|
||||
|
||||
|
||||
for x in range(0, settings.number_of_nodes):
|
||||
for empresa in models.networkStatus["agente_%s"%x]:
|
||||
for attribute in models.networkStatus["agent_%s"%x]:
|
||||
emotionStatusAux=[]
|
||||
for tiempo in models.networkStatus["agente_%s"%x][empresa]:
|
||||
for t_step in models.networkStatus["agent_%s"%x][attribute]:
|
||||
prec = 2
|
||||
output = math.floor(models.networkStatus["agente_%s"%x][empresa][tiempo] * (10 ** prec)) / (10 ** prec) #Para tener 2 decimales solo
|
||||
emotionStatusAux.append((output,tiempo,None))
|
||||
output = math.floor(models.networkStatus["agent_%s"%x][attribute][t_step] * (10 ** prec)) / (10 ** prec) #2 decimals
|
||||
emotionStatusAux.append((output,t_step,None))
|
||||
attributes = {}
|
||||
attributes[empresa] = emotionStatusAux
|
||||
attributes[attribute] = emotionStatusAux
|
||||
G.add_node(x, attributes)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user