From c3479f224b84d4d7013d148aaa86e67335cc4e87 Mon Sep 17 00:00:00 2001 From: "Carlos A. Iglesias" Date: Thu, 19 Jan 2017 12:56:28 +0100 Subject: [PATCH] Update SOIL Tutorial.ipynb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cambiado infectados por infected y alguna traducción más --- SOIL Tutorial.ipynb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/SOIL Tutorial.ipynb b/SOIL Tutorial.ipynb index 665fcfa..f6b8671 100644 --- a/SOIL Tutorial.ipynb +++ b/SOIL Tutorial.ipynb @@ -179,14 +179,14 @@ ], "source": [ "for x in range(0, settings.number_of_nodes):\n", - " for empresa in models.networkStatus[\"agente_%s\"%x]:\n", + " for enterprise in models.networkStatus[\"agent_%s\"%x]:\n", " emotionStatusAux=[]\n", - " for tiempo in models.networkStatus[\"agente_%s\"%x][empresa]:\n", + " for time in models.networkStatus[\"agent_%s\"%x][enterprise]:\n", " prec = 2\n", - " output = math.floor(models.networkStatus[\"agente_%s\"%x][empresa][tiempo] * (10 ** prec)) / (10 ** prec) #Para tener 2 decimales solo\n", - " emotionStatusAux.append((output,tiempo,None))\n", + " output = math.floor(models.networkStatus[\"agent_%s\"%x][enterprise][time] * (10 ** prec)) / (10 ** prec) #Para tener 2 decimales solo\n", + " emotionStatusAux.append((output,time,None))\n", " attributes = {}\n", - " attributes[empresa] = emotionStatusAux\n", + " attributes[enterprise] = emotionStatusAux\n", " G.add_node(x, attributes)\n", "\n", "\n", @@ -221,31 +221,31 @@ "\n", "attribute_plot = 'status'\n", "for time in range(0, settings.max_time):\n", - " value_infectados = 0\n", + " value_infected = 0\n", " value_neutral = 0\n", " value_cured = 0\n", " value_vaccinated = 0\n", " real_time = time * settings.timeout\n", " activity= False\n", " for x in range(0, settings.number_of_nodes):\n", - " if attribute_plot in models.networkStatus[\"agente_%s\" % x]:\n", - " if real_time in models.networkStatus[\"agente_%s\" % x][attribute_plot]:\n", - " if models.networkStatus[\"agente_%s\" % x][attribute_plot][real_time] == 1: ##Representar infectados\n", - " value_infectados += 1\n", + " if attribute_plot in models.networkStatus[\"agent_%s\" % x]:\n", + " if real_time in models.networkStatus[\"agent_%s\" % x][attribute_plot]:\n", + " if models.networkStatus[\"agent_%s\" % x][attribute_plot][real_time] == 1: ##Represent infected\n", + " value_infected += 1\n", " activity = True\n", - " if models.networkStatus[\"agente_%s\" % x][attribute_plot][real_time] == 0: ##Representar neutrales\n", + " if models.networkStatus[\"agent_%s\" % x][attribute_plot][real_time] == 0: ##Represent neutrals\n", " value_neutral += 1\n", " activity = True\n", - " if models.networkStatus[\"agente_%s\" % x][attribute_plot][real_time] == 2: ##Representar cured\n", + " if models.networkStatus[\"agent_%s\" % x][attribute_plot][real_time] == 2: ##Represent cured\n", " value_cured += 1\n", " activity = True\n", - " if models.networkStatus[\"agente_%s\" % x][attribute_plot][real_time] == 3: ##Representar vaccinated\n", + " if models.networkStatus[\"agent_%s\" % x][attribute_plot][real_time] == 3: ##Represent vaccinated\n", " value_vaccinated += 1\n", " activity = True\n", "\n", " if activity:\n", " x_values.append(real_time)\n", - " infected_values.append(value_infectados)\n", + " infected_values.append(value_infected)\n", " neutral_values.append(value_neutral)\n", " cured_values.append(value_cured)\n", " vaccinated_values.append(value_vaccinated)\n", @@ -353,7 +353,7 @@ " yield self.env.timeout(settings.timeout)\n", "\n", " def step(self, now):\n", - " networkStatus['agente_%s'% self.id] = self.a_json()\n", + " networkStatus['agent_%s'% self.id] = self.a_json()\n", "\n", " def a_json(self):\n", " final = {}\n",