From 77f2f1c91b4aebd45a40d1577a5470fcc2650121 Mon Sep 17 00:00:00 2001 From: JesusMSM Date: Wed, 13 Apr 2016 18:45:19 +0200 Subject: [PATCH] Removed useless imports --- clase_base.py | 74 -------------------------------------------------- models.py | 11 +------- soil.py | 4 --- status.png | Bin 13578 -> 0 bytes 4 files changed, 1 insertion(+), 88 deletions(-) delete mode 100644 clase_base.py delete mode 100644 status.png diff --git a/clase_base.py b/clase_base.py deleted file mode 100644 index 76ae3e7..0000000 --- a/clase_base.py +++ /dev/null @@ -1,74 +0,0 @@ -import random -import time - -settings = { - "empresas": ["BBVA", "Santander"] -} - -class BaseNetworkAgent: - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.id = random.random() - - @property - def env(self): - class T(object): - pass - - temp = T() - temp.now = time.time() - return temp - - -def agentes_a_json(agentes): - final = {} - for agente in agentes: - for stamp, attrs in self._attrs.items(): - for a in attrs: - if a not in final: - final[a] = {} - final[a][stamp] = attrs[a] - return final - -class ComportamientoBase(BaseNetworkAgent): - def __init__(self, *args, **kwargs): - self._attrs = {} - - @property - def attrs(self): - now = self.env.now - if now not in self._attrs: - self._attrs[now] = {} - return self._attrs[now] - - @attrs.setter - def attrs(self, value): - self._attrs[self.env.now] = value - - def run(self): - while True: - self.step(self.env.now) - #yield self.env.timeout(settings.timeout) - - def step(self, now): - pass - - def a_json(self): - final = {} - for stamp, attrs in self._attrs.items(): - for a in attrs: - if a not in final: - final[a] = {} - final[a][stamp] = attrs[a] - return final - -class NuevoComportamiento(ComportamientoBase): - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.empresas = settings["empresas"] - - def step(self, now): - for i in self.empresas: - self.attrs['sentimiento_empresa_%s' % i] = random.random() diff --git a/models.py b/models.py index 006a6d0..82f03cf 100644 --- a/models.py +++ b/models.py @@ -1,12 +1,5 @@ -from nxsim import NetworkSimulation from nxsim import BaseNetworkAgent -from nxsim import BaseLoggingAgent -from random import randint -from pprint import pprint -from matplotlib import pyplot as plt import random -import numpy as np -import networkx as nx import settings settings.init() @@ -16,7 +9,7 @@ settings.init() ############################## def init(): global networkStatus - networkStatus={} # Dict that will contain the status of every agent in the network + networkStatus = {} # Dict that will contain the status of every agent in the network sentimentCorrelationNodeArray=[] for x in range(0, settings.number_of_nodes): @@ -223,13 +216,11 @@ class SentimentCorrelationModel(ComportamientoBase): if(numanger_prob): - self.state['id'] = 2 sentimentCorrelationNodeArray[self.id][self.env.now]=2 self.time_awareness[self.state['id']-1] = self.env.now diff --git a/soil.py b/soil.py index 4999ff8..c2275d1 100644 --- a/soil.py +++ b/soil.py @@ -1,10 +1,6 @@ -#from clase_base import * from models import * from nxsim import NetworkSimulation -from nxsim import BaseNetworkAgent from nxsim import BaseLoggingAgent -import random -import numpy as np import networkx as nx import settings import models diff --git a/status.png b/status.png deleted file mode 100644 index 4a503988a67e6b0c32fad8bde95435d0a2369a45..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13578 zcmeHud03P8x@|0Nsa0WnTW1E{qEry5A|g{_i;7W!mQiGg$|SQgg)!06O05bS1Y}I9 z3^FSSF-*~-Oc78<2}49C8A2pLLdbOAAMHM8-*dY6zV~_Vv-clo_n{aHhVT1+@4Mdh zuC;pY8w;~_pKkpWgTbuBA3tJ+!N_gLU_Lng$;a?tQbWJH2!DJS^flh*6Zj|U6Sp7X z>(v*JI|N}cis#V3tM23SyfB#U82pj1Y{JqxgXCMbiy0F#`Ij=EN6n)#G!EYa*x)Q%d6ygDeY0a%~Yd<>lSi!#x^mQoG6XvZ6CBQZRc%6^AtnooO-= z3?#V58SEAeMFvbwO_fCnc{jG`=DM>pjEEisk1vIDDtZGu&Gp@zZtV!4E~b@5EKbd^ zDhi*S`v7ye+S)qbMx$Hhm+W09lSU~gwehB=rn}8kyUHZLuF*N=>gswhU?|-pgCBkF zom9ka59xJI?k=?V9BsOdrw}Al_6CxL&Y-Su&D>j4^|VB7clYfi%LHWV;&kr>+_U&d z{AvtFVT1DQ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