1
0
mirror of https://github.com/gsi-upm/soil synced 2024-11-13 23:12:28 +00:00

More translated variables

This commit is contained in:
JesusMSM 2016-09-26 19:01:34 +02:00
parent d3d7e1d4c9
commit 127a220fa6
2 changed files with 12 additions and 12 deletions

View File

@ -67,7 +67,7 @@ def init():
tweet_probability_users = 0.44 tweet_probability_users = 0.44
tweet_relevant_probability = 0.25 tweet_relevant_probability = 0.25
tweet_probability_about = [0.15, 0.15, 0.15] 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 ##Enterprises
tweet_probability_enterprises = [0.3, 0.3, 0.3] tweet_probability_enterprises = [0.3, 0.3, 0.3]

22
soil.py
View File

@ -51,18 +51,18 @@ for time in range(0, settings.max_time):
real_time = time * settings.timeout real_time = time * settings.timeout
activity= False activity= False
for x in range(0, settings.number_of_nodes): for x in range(0, settings.number_of_nodes):
if attribute_plot in models.networkStatus["agente_%s" % x]: if attribute_plot in models.networkStatus["agent_%s" % x]:
if real_time in models.networkStatus["agente_%s" % x][attribute_plot]: if real_time in models.networkStatus["agent_%s" % x][attribute_plot]:
if models.networkStatus["agente_%s" % x][attribute_plot][real_time] == 1: ##Representar infectados if models.networkStatus["agent_%s" % x][attribute_plot][real_time] == 1: ##Infected
value_infectados += 1 value_infectados += 1
activity = True 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 value_neutral += 1
activity = True 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 value_cured += 1
activity = True 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 value_vaccinated += 1
activity = True activity = True
@ -89,14 +89,14 @@ plt.savefig('control_model.png')
for x in range(0, settings.number_of_nodes): 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=[] emotionStatusAux=[]
for tiempo in models.networkStatus["agente_%s"%x][empresa]: for t_step in models.networkStatus["agent_%s"%x][attribute]:
prec = 2 prec = 2
output = math.floor(models.networkStatus["agente_%s"%x][empresa][tiempo] * (10 ** prec)) / (10 ** prec) #Para tener 2 decimales solo output = math.floor(models.networkStatus["agent_%s"%x][attribute][t_step] * (10 ** prec)) / (10 ** prec) #2 decimals
emotionStatusAux.append((output,tiempo,None)) emotionStatusAux.append((output,t_step,None))
attributes = {} attributes = {}
attributes[empresa] = emotionStatusAux attributes[attribute] = emotionStatusAux
G.add_node(x, attributes) G.add_node(x, attributes)