From 2fc7a91ef340bd874d08c5ac9a051d19968d593e Mon Sep 17 00:00:00 2001 From: Tasio Mendez Date: Fri, 21 Apr 2017 14:04:30 +0200 Subject: [PATCH] Settings modules --- models/models.py | 7 ++----- soil.py | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/models/models.py b/models/models.py index de78646..ab16ec0 100644 --- a/models/models.py +++ b/models/models.py @@ -1,13 +1,10 @@ import settings -settings.init() - -global networkStatus networkStatus = {} # Dict that will contain the status of every agent in the network -sentimentCorrelationNodeArray=[] +sentimentCorrelationNodeArray = [] for x in range(0, settings.number_of_nodes): - sentimentCorrelationNodeArray.append({'id':x}) + sentimentCorrelationNodeArray.append({'id': x}) # Initialize agent states. Let's assume everyone is normal. init_states = [{'id': 0, } for _ in range(settings.number_of_nodes)] # add keys as as necessary, but "id" must always refer to that state category diff --git a/soil.py b/soil.py index 5a8ec4c..0f983c3 100644 --- a/soil.py +++ b/soil.py @@ -27,7 +27,8 @@ if settings.network_type == 2: ############## sim = NetworkSimulation(topology=G, states=init_states, agent_type=ControlModelM2, - max_time=settings.max_time, num_trials=settings.num_trials, logging_interval=1.0) + max_time=settings.max_time, num_trials=settings.num_trials, logging_interval=1.0, + environment_params=settings) sim.run_simulation()