From 127a220fa68fabbbfc6f09b0d5b4d3191f0f797a Mon Sep 17 00:00:00 2001 From: JesusMSM Date: Mon, 26 Sep 2016 19:01:34 +0200 Subject: [PATCH] More translated variables --- settings.py | 2 +- soil.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/settings.py b/settings.py index 904cb89..12c01ea 100644 --- a/settings.py +++ b/settings.py @@ -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] diff --git a/soil.py b/soil.py index defc8c0..43a4b5f 100644 --- a/soil.py +++ b/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)