diff --git a/__pycache__/clase_base.cpython-34.pyc b/__pycache__/clase_base.cpython-34.pyc deleted file mode 100644 index 0ea739f..0000000 Binary files a/__pycache__/clase_base.cpython-34.pyc and /dev/null differ diff --git a/__pycache__/models.cpython-34.pyc b/__pycache__/models.cpython-34.pyc deleted file mode 100644 index 0aa6cd0..0000000 Binary files a/__pycache__/models.cpython-34.pyc and /dev/null differ diff --git a/__pycache__/settings.cpython-34.pyc b/__pycache__/settings.cpython-34.pyc deleted file mode 100644 index b9fc86e..0000000 Binary files a/__pycache__/settings.cpython-34.pyc and /dev/null differ diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index b32a537..b3f8a4c 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/models.doctree b/docs/_build/doctrees/models.doctree index 1b705ba..30136fa 100644 Binary files a/docs/_build/doctrees/models.doctree and b/docs/_build/doctrees/models.doctree differ diff --git a/docs/_build/doctrees/usage.doctree b/docs/_build/doctrees/usage.doctree index 363cdae..4ef69f3 100644 Binary files a/docs/_build/doctrees/usage.doctree and b/docs/_build/doctrees/usage.doctree differ diff --git a/docs/_build/html/_sources/models.rst.txt b/docs/_build/html/_sources/models.rst.txt index 654effb..d179d7b 100644 --- a/docs/_build/html/_sources/models.rst.txt +++ b/docs/_build/html/_sources/models.rst.txt @@ -9,7 +9,7 @@ A model defines the behaviour of the agents with a view to assessing their effec In practice, a model consists of at least two parts: * Python module: the actual code that describes the behaviour. -* Setting up the variables in the Simulation Settings JSON file. +* Setting up the variables in the Settings JSON file. This separation allows us to run the simulation with different agents. @@ -25,10 +25,10 @@ All the models are imported to the main file. The initialization look like this: networkStatus = {} # Dict that will contain the status of every agent in the network sentimentCorrelationNodeArray = [] - for x in range(0, settings.number_of_nodes): + for x in range(0, settings.network_params["number_of_nodes"]): sentimentCorrelationNodeArray.append({'id': x}) # Initialize agent states. Let's assume everyone is normal. - init_states = [{'id': 0, } for _ in range(settings.number_of_nodes)] + init_states = [{'id': 0, } for _ in range(settings.network_params["number_of_nodes"])] # add keys as as necessary, but "id" must always refer to that state category A new model have to inherit the BaseBehaviour class which is in the same module. @@ -77,7 +77,7 @@ passed as a parameter to the simulation. } In this file you will also define the models you are going to simulate. You can simulate as many models as you want. -The simulation returns one result for each model. For the usage, see :doc:`usage`. +The simulation returns one result for each model, executing each model separately. For the usage, see :doc:`usage`. Example Model ============= diff --git a/docs/_build/html/_sources/usage.rst.txt b/docs/_build/html/_sources/usage.rst.txt index 4d61fe2..17b3291 100644 --- a/docs/_build/html/_sources/usage.rst.txt +++ b/docs/_build/html/_sources/usage.rst.txt @@ -8,18 +8,19 @@ Simulation Settings Once installed, before running a simulation, you need to configure it. -* In the settings.py file you will find the configuration of the network. +* In the Settings JSON file you will find the configuration of the network. .. code:: python - # Network settings - network_type = 1 - number_of_nodes = 1000 - max_time = 50 - num_trials = 1 - timeout = 2 + { + "network_type": 1, + "number_of_nodes": 1000, + "max_time": 50, + "num_trials": 1, + "timeout": 2 + } -* In the Simulation Settings JSON file, you will find the configuration of the models. +* In the Settings JSON file, you will also find the configuration of the models. Network Types ============= @@ -40,7 +41,7 @@ Models Settings =============== After having configured the simulation, the next step is setting up the variables of the models. -For this, you will need to modify the Simulation Settings JSON file. +For this, you will need to modify the Settings JSON file again. .. code:: json @@ -76,7 +77,7 @@ For this, you will need to modify the Simulation Settings JSON file. } In this file you will define the different models you are going to simulate. You can simulate as many models -as you want. +as you want. Each model will be simulated separately. After setting up the models, you have to initialize the parameters of each one. You will find the parameters needed in the documentation of each model. @@ -90,7 +91,7 @@ After setting all the configuration, you will be able to run the simulation. All .. code:: bash - python soil.py + python3 soil.py The simulation will return a dynamic graph .gexf file which could be visualized with `Gephi `__. diff --git a/docs/_build/html/models.html b/docs/_build/html/models.html index f2a3735..374bb10 100644 --- a/docs/_build/html/models.html +++ b/docs/_build/html/models.html @@ -51,7 +51,7 @@ In practice, a model consists of at least two parts:

This separation allows us to run the simulation with different agents.

@@ -63,10 +63,10 @@ In practice, a model consists of at least two parts:

networkStatus = {} # Dict that will contain the status of every agent in the network sentimentCorrelationNodeArray = [] -for x in range(0, settings.number_of_nodes): +for x in range(0, settings.network_params["number_of_nodes"]): sentimentCorrelationNodeArray.append({'id': x}) # Initialize agent states. Let's assume everyone is normal. -init_states = [{'id': 0, } for _ in range(settings.number_of_nodes)] +init_states = [{'id': 0, } for _ in range(settings.network_params["number_of_nodes"])] # add keys as as necessary, but "id" must always refer to that state category @@ -114,7 +114,7 @@ passed as a parameter to the simulation.

In this file you will also define the models you are going to simulate. You can simulate as many models as you want. -The simulation returns one result for each model. For the usage, see Usage.

+The simulation returns one result for each model, executing each model separately. For the usage, see Usage.

Example Model

diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index f887fb6..2a6388f 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index","usage"],envversion:51,filenames:["index.rst","usage.rst"],objects:{},objnames:{},objtypes:{},terms:{"class":[],"default":1,"import":[],"new":0,"return":1,"super":[],For:1,The:1,There:1,__init__:[],abl:1,about:0,actual:[],add:1,added:1,after:1,agent:[0,1],agent_id:[],all:1,allow:[],also:1,alwai:[],analysi:[],anger:[],anger_prob:[],append:[],assess:[],assum:[],barabasi_albert_graph:1,base:0,basebehaviour:[],basic:[],been:1,befor:1,behaviour:[],can:1,categori:[],clone:[],cluster:[],code:0,complete_graph:1,configur:1,consist:[],contain:[],content:[],content_discont:1,content_neutr:1,controlmodelm2:1,correl:[],could:1,def:[],defin:1,describ:[],develop:0,dict:[],differ:1,discontent_cont:1,discontent_neutr:1,disgust:[],disgust_prob:[],dit:[],doc:[],document:1,dynam:1,each:1,effect:[],env:[],environ:[],environment_param:[],everi:[],everyon:[],exampl:0,execut:1,fail:1,file:1,fill:[],find:1,first:1,from:[],gephi:1,gexf:1,git:[],gitlab:[],going:1,graph:1,gsi:[],has:1,have:1,here:1,how:[],http:[],implement:1,includ:[],index:[],inherit:[],init_st:[],initi:[0,1],instal:[0,1],instruct:1,joi:[],joy_prob:[],json:1,kei:[],lab:[],latest:[],learn:0,least:[],let:[],like:[],look:[],main:[],mani:1,margulis_gabber_galil_graph:1,max_tim:1,method:[],model:0,modifi:1,modul:[],more:[0,1],must:[],necessari:[],need:1,network:0,network_typ:1,networkstatu:[],neutral_content_infected_prob:1,neutral_content_spon_prob:1,neutral_discontent_infected_prob:1,neutral_discontent_spon_prob:1,next:1,none:1,normal:[],now:[],num_trial:1,number_of_nod:1,onc:1,one:1,outside_effects_prob:[],over:[],packag:1,page:[],paramet:1,part:[],pass:[],pictur:1,plugin:[],png:1,practic:[],prob_cured_healing_infect:1,prob_cured_vaccinate_neutr:1,prob_generate_anti_rumor:1,prob_infect:1,prob_neutral_making_deni:1,prob_vaccinated_healing_infect:1,prob_vaccinated_vaccinate_neutr:1,provid:1,python:[0,1],rang:[],refer:[],requir:1,result:[],run:0,sad:[],sadness_prob:[],same:[],search:[],section:[],see:1,self:[],sentiment:[],sentimentcorrelationmodel:[],sentimentcorrelationnodearrai:[],separ:[],set:0,simul:0,sisamodel:1,social:0,soil:1,standard_vari:1,state:[],statu:[],step:1,system:[],them:[],thi:1,three:1,through:[],time:[],time_awar:[],timeout:1,two:[],type:0,upm:[],usag:0,used:[],user:[],valid:1,variabl:[0,1],variance_c_d:1,variance_d_c:1,version:[],view:[],visual:1,want:1,what:0,which:1,whole:[],without:1,would:[],you:1},titles:["Welcome to Soil’s documentation!","Usage"],titleterms:{"new":[],code:[],develop:[],document:0,exampl:[],indic:[],initi:[],instal:[],model:1,network:1,run:1,set:1,simul:1,soil:0,tabl:[],type:1,usag:1,variabl:[],welcom:0,what:[]}}) \ No newline at end of file +Search.setIndex({docnames:["index","models","usage"],envversion:51,filenames:["index.rst","models.rst","usage.rst"],objects:{},objnames:{},objtypes:{},terms:{"class":1,"default":2,"import":1,"new":0,"return":[1,2],"super":1,For:[1,2],The:[1,2],There:[1,2],__init__:1,abl:2,about:0,actual:1,add:[1,2],added:2,after:2,again:2,agent:[0,1,2],agent_id:1,all:[1,2],allow:1,also:[1,2],alwai:1,analysi:1,anger:1,anger_prob:1,append:1,assess:1,assum:1,barabasi_albert_graph:2,base:0,basebehaviour:1,basic:1,been:2,befor:2,behaviour:1,can:[1,2],categori:1,clone:[],cluster:[],code:0,complete_graph:2,configur:2,consist:1,contain:1,content:[],content_discont:[1,2],content_neutr:[1,2],controlmodelm2:[1,2],correl:1,could:2,def:1,defin:[1,2],describ:1,develop:0,dict:1,differ:[1,2],discontent_cont:[1,2],discontent_neutr:[1,2],disgust:1,disgust_prob:1,dit:[],doc:[],document:[1,2],dynam:2,each:[1,2],effect:1,env:1,environ:1,environment_param:1,everi:1,everyon:1,exampl:0,execut:[1,2],fail:2,file:[1,2],fill:[],find:2,first:2,from:1,gephi:2,gexf:2,git:[],gitlab:[],going:[1,2],graph:2,gsi:[],has:2,have:[1,2],here:2,how:1,http:[],implement:[1,2],includ:1,index:[],inherit:1,init_st:1,initi:[0,2],instal:[0,2],instruct:2,joi:1,joy_prob:1,json:[1,2],kei:1,lab:[],latest:[],learn:0,least:1,let:1,like:1,look:1,main:1,mani:[1,2],margulis_gabber_galil_graph:2,max_tim:2,method:1,model:0,modifi:[1,2],modul:1,more:[0,2],must:1,necessari:1,need:2,network:[0,1],network_param:1,network_typ:2,networkstatu:1,neutral_content_infected_prob:[1,2],neutral_content_spon_prob:[1,2],neutral_discontent_infected_prob:[1,2],neutral_discontent_spon_prob:[1,2],next:2,none:[1,2],normal:1,now:1,num_trial:2,number_of_nod:[1,2],onc:2,one:[1,2],outside_effects_prob:1,over:1,packag:2,page:[],paramet:[1,2],part:1,pass:1,pictur:2,plugin:[],png:2,practic:1,prob_cured_healing_infect:[1,2],prob_cured_vaccinate_neutr:[1,2],prob_generate_anti_rumor:[1,2],prob_infect:[1,2],prob_neutral_making_deni:[1,2],prob_vaccinated_healing_infect:[1,2],prob_vaccinated_vaccinate_neutr:[1,2],provid:2,python3:2,python:[0,1],rang:1,refer:1,requir:2,result:1,run:[0,1],sad:1,sadness_prob:1,same:1,search:[],section:1,see:[1,2],self:1,sentiment:1,sentimentcorrelationmodel:1,sentimentcorrelationnodearrai:1,separ:[1,2],set:[0,1],simul:[0,1],sisamodel:[1,2],social:0,soil:2,standard_vari:[1,2],state:1,statu:1,step:[1,2],system:1,them:1,thi:[1,2],three:2,through:[],time:1,time_awar:1,timeout:2,two:1,type:0,upm:[],usag:[0,1],used:1,user:1,valid:2,variabl:[0,2],variance_c_d:[1,2],variance_d_c:[1,2],version:[],view:1,visual:2,want:[1,2],what:0,which:[1,2],whole:1,without:2,would:1,you:[1,2]},titles:["Welcome to Soil’s documentation!","Developing new models","Usage"],titleterms:{"new":1,code:1,develop:1,document:0,exampl:1,indic:[],initi:1,instal:[],model:[1,2],network:2,run:2,set:2,simul:2,soil:0,tabl:[],type:2,usag:2,variabl:1,welcom:0,what:1}}) \ No newline at end of file diff --git a/docs/_build/html/usage.html b/docs/_build/html/usage.html index f58dc7d..32d5442 100644 --- a/docs/_build/html/usage.html +++ b/docs/_build/html/usage.html @@ -50,17 +50,18 @@

Simulation Settings

Once installed, before running a simulation, you need to configure it.

@@ -80,7 +81,7 @@

Models Settings

After having configured the simulation, the next step is setting up the variables of the models. -For this, you will need to modify the Simulation Settings JSON file.

+For this, you will need to modify the Settings JSON file again.

{
     "agent": ["SISaModel","ControlModelM2"],
 
@@ -114,7 +115,7 @@ For this, you will need to modify the Simulation Settings JSON file.

In this file you will define the different models you are going to simulate. You can simulate as many models -as you want.

+as you want. Each model will be simulated separately.

After setting up the models, you have to initialize the parameters of each one. You will find the parameters needed in the documentation of each model.

Parameter validation will fail if a required parameter without a default has not been provided.

@@ -122,7 +123,7 @@ in the documentation of each model.

Running the Simulation

After setting all the configuration, you will be able to run the simulation. All you need to do is execute:

-
python soil.py
+
python3 soil.py
 

The simulation will return a dynamic graph .gexf file which could be visualized with diff --git a/docs/models.rst b/docs/models.rst index 654effb..d179d7b 100644 --- a/docs/models.rst +++ b/docs/models.rst @@ -9,7 +9,7 @@ A model defines the behaviour of the agents with a view to assessing their effec In practice, a model consists of at least two parts: * Python module: the actual code that describes the behaviour. -* Setting up the variables in the Simulation Settings JSON file. +* Setting up the variables in the Settings JSON file. This separation allows us to run the simulation with different agents. @@ -25,10 +25,10 @@ All the models are imported to the main file. The initialization look like this: networkStatus = {} # Dict that will contain the status of every agent in the network sentimentCorrelationNodeArray = [] - for x in range(0, settings.number_of_nodes): + for x in range(0, settings.network_params["number_of_nodes"]): sentimentCorrelationNodeArray.append({'id': x}) # Initialize agent states. Let's assume everyone is normal. - init_states = [{'id': 0, } for _ in range(settings.number_of_nodes)] + init_states = [{'id': 0, } for _ in range(settings.network_params["number_of_nodes"])] # add keys as as necessary, but "id" must always refer to that state category A new model have to inherit the BaseBehaviour class which is in the same module. @@ -77,7 +77,7 @@ passed as a parameter to the simulation. } In this file you will also define the models you are going to simulate. You can simulate as many models as you want. -The simulation returns one result for each model. For the usage, see :doc:`usage`. +The simulation returns one result for each model, executing each model separately. For the usage, see :doc:`usage`. Example Model ============= diff --git a/docs/usage.rst b/docs/usage.rst index 4d61fe2..17b3291 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -8,18 +8,19 @@ Simulation Settings Once installed, before running a simulation, you need to configure it. -* In the settings.py file you will find the configuration of the network. +* In the Settings JSON file you will find the configuration of the network. .. code:: python - # Network settings - network_type = 1 - number_of_nodes = 1000 - max_time = 50 - num_trials = 1 - timeout = 2 + { + "network_type": 1, + "number_of_nodes": 1000, + "max_time": 50, + "num_trials": 1, + "timeout": 2 + } -* In the Simulation Settings JSON file, you will find the configuration of the models. +* In the Settings JSON file, you will also find the configuration of the models. Network Types ============= @@ -40,7 +41,7 @@ Models Settings =============== After having configured the simulation, the next step is setting up the variables of the models. -For this, you will need to modify the Simulation Settings JSON file. +For this, you will need to modify the Settings JSON file again. .. code:: json @@ -76,7 +77,7 @@ For this, you will need to modify the Simulation Settings JSON file. } In this file you will define the different models you are going to simulate. You can simulate as many models -as you want. +as you want. Each model will be simulated separately. After setting up the models, you have to initialize the parameters of each one. You will find the parameters needed in the documentation of each model. @@ -90,7 +91,7 @@ After setting all the configuration, you will be able to run the simulation. All .. code:: bash - python soil.py + python3 soil.py The simulation will return a dynamic graph .gexf file which could be visualized with `Gephi `__. diff --git a/models/BaseBehaviour/BaseBehaviour.py b/models/BaseBehaviour/BaseBehaviour.py index 820658a..aef94b1 100644 --- a/models/BaseBehaviour/BaseBehaviour.py +++ b/models/BaseBehaviour/BaseBehaviour.py @@ -23,7 +23,7 @@ class BaseBehaviour(BaseNetworkAgent): def run(self): while True: self.step(self.env.now) - yield self.env.timeout(settings.timeout) + yield self.env.timeout(settings.network_params["timeout"]) def step(self, now): networkStatus['agent_%s'% self.id] = self.to_json() diff --git a/models/ModelM2/ControlModelM2.py b/models/ModelM2/ControlModelM2.py index b8f818b..2a15025 100644 --- a/models/ModelM2/ControlModelM2.py +++ b/models/ModelM2/ControlModelM2.py @@ -24,12 +24,12 @@ class ControlModelM2(BaseBehaviour): """ # Init infected - init_states[random.randint(0, settings.number_of_nodes-1)] = {'id': 1} - init_states[random.randint(0, settings.number_of_nodes-1)] = {'id': 1} + init_states[random.randint(0, settings.network_params["number_of_nodes"]-1)] = {'id': 1} + init_states[random.randint(0, settings.network_params["number_of_nodes"]-1)] = {'id': 1} # Init beacons - init_states[random.randint(0, settings.number_of_nodes-1)] = {'id': 4} - init_states[random.randint(0, settings.number_of_nodes-1)] = {'id': 4} + init_states[random.randint(0, settings.network_params["number_of_nodes"]-1)] = {'id': 4} + init_states[random.randint(0, settings.network_params["number_of_nodes"]-1)] = {'id': 4} def __init__(self, environment=None, agent_id=0, state=()): super().__init__(environment=environment, agent_id=agent_id, state=state) diff --git a/models/ModelM2/SpreadModelM2.py b/models/ModelM2/SpreadModelM2.py index ee3dc09..a7f6b84 100644 --- a/models/ModelM2/SpreadModelM2.py +++ b/models/ModelM2/SpreadModelM2.py @@ -23,8 +23,8 @@ class SpreadModelM2(BaseBehaviour): prob_generate_anti_rumor """ - init_states[random.randint(0, settings.number_of_nodes)] = {'id': 1} - init_states[random.randint(0, settings.number_of_nodes)] = {'id': 1} + init_states[random.randint(0, settings.network_params["number_of_nodes"])] = {'id': 1} + init_states[random.randint(0, settings.network_params["number_of_nodes"])] = {'id': 1} def __init__(self, environment=None, agent_id=0, state=()): super().__init__(environment=environment, agent_id=agent_id, state=state) diff --git a/models/models.py b/models/models.py index ab16ec0..5a508fa 100644 --- a/models/models.py +++ b/models/models.py @@ -3,8 +3,8 @@ import settings networkStatus = {} # Dict that will contain the status of every agent in the network sentimentCorrelationNodeArray = [] -for x in range(0, settings.number_of_nodes): +for x in range(0, settings.network_params["number_of_nodes"]): sentimentCorrelationNodeArray.append({'id': x}) # Initialize agent states. Let's assume everyone is normal. -init_states = [{'id': 0, } for _ in range(settings.number_of_nodes)] +init_states = [{'id': 0, } for _ in range(settings.network_params["number_of_nodes"])] # add keys as as necessary, but "id" must always refer to that state category diff --git a/simulation_settings.json b/settings.json similarity index 88% rename from simulation_settings.json rename to settings.json index ac9bcd0..ac38187 100644 --- a/simulation_settings.json +++ b/settings.json @@ -1,4 +1,13 @@ -{ +[ + { + "network_type": 1, + "number_of_nodes": 1000, + "max_time": 50, + "num_trials": 1, + "timeout": 2 + }, + + { "agent": ["BaseBehaviour","SISaModel","ControlModelM2"], @@ -19,7 +28,7 @@ "tweet_probability_users": 0.44, "tweet_relevant_probability": 0.25, "tweet_probability_about": [0.15, 0.15, 0.15], - "sentiment_about": [0, 0, 0], + "sentiment_about": [0, 0, 0], "tweet_probability_enterprises": [0.3, 0.3, 0.3], @@ -49,4 +58,5 @@ "prob_vaccinated_healing_infected": 0.035, "prob_vaccinated_vaccinate_neutral": 0.035, "prob_generate_anti_rumor": 0.035 -} \ No newline at end of file + } +] \ No newline at end of file diff --git a/settings.py b/settings.py index 1b1f531..53f9ca4 100644 --- a/settings.py +++ b/settings.py @@ -1,15 +1,11 @@ # General configuration import json -# Network settings -network_type = 1 -number_of_nodes = 1000 -max_time = 50 -num_trials = 1 -timeout = 2 +with open('settings.json', 'r') as f: + settings = json.load(f) -with open('simulation_settings.json', 'r') as f: - environment_params = json.load(f) +network_params = settings[0] +environment_params = settings[1] ''' diff --git a/soil.py b/soil.py index 332667a..684233c 100644 --- a/soil.py +++ b/soil.py @@ -1,6 +1,6 @@ from models import * from nxsim import NetworkSimulation -import numpy +# import numpy from matplotlib import pyplot as plt import networkx as nx import settings @@ -15,7 +15,7 @@ import json def visualization(graph_name): - for x in range(0, settings.number_of_nodes): + for x in range(0, settings.network_params["number_of_nodes"]): for attribute in models.networkStatus["agent_%s" % x]: emotionStatusAux = [] for t_step in models.networkStatus["agent_%s" % x][attribute]: @@ -46,14 +46,14 @@ def results(model_name): vaccinated_values = [] attribute_plot = 'status' - for time in range(0, settings.max_time): + for time in range(0, settings.network_params["max_time"]): value_infectados = 0 value_neutral = 0 value_cured = 0 value_vaccinated = 0 - real_time = time * settings.timeout + real_time = time * settings.network_params["timeout"] activity = False - for x in range(0, settings.number_of_nodes): + for x in range(0, settings.network_params["number_of_nodes"]): 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 @@ -93,12 +93,12 @@ def results(model_name): # Network creation # #################### -if settings.network_type == 0: - G = nx.complete_graph(settings.number_of_nodes) -if settings.network_type == 1: - G = nx.barabasi_albert_graph(settings.number_of_nodes, 10) -if settings.network_type == 2: - G = nx.margulis_gabber_galil_graph(settings.number_of_nodes, None) +if settings.network_params["network_type"] == 0: + G = nx.complete_graph(settings.network_params["number_of_nodes"]) +if settings.network_params["network_type"] == 1: + G = nx.barabasi_albert_graph(settings.network_params["number_of_nodes"], 10) +if settings.network_params["network_type"] == 2: + G = nx.margulis_gabber_galil_graph(settings.network_params["number_of_nodes"], None) # More types of networks can be added here @@ -112,16 +112,16 @@ print("Using Agent(s): {agents}".format(agents=agents)) if len(agents) > 1: for agent in agents: - sim = NetworkSimulation(topology=G, states=init_states, agent_type=locals()[agent], max_time=settings.max_time, - num_trials=settings.num_trials, logging_interval=1.0, **settings.environment_params) + sim = NetworkSimulation(topology=G, states=init_states, agent_type=locals()[agent], max_time=settings.network_params["max_time"], + num_trials=settings.network_params["num_trials"], logging_interval=1.0, **settings.environment_params) sim.run_simulation() print(str(agent)) results(str(agent)) visualization(str(agent)) else: agent = agents[0] - sim = NetworkSimulation(topology=G, states=init_states, agent_type=locals()[agent], max_time=settings.max_time, - num_trials=settings.num_trials, logging_interval=1.0, **settings.environment_params) + sim = NetworkSimulation(topology=G, states=init_states, agent_type=locals()[agent], max_time=settings.network_params["max_time"], + num_trials=settings.network_params["num_trials"], logging_interval=1.0, **settings.environment_params) sim.run_simulation() results(str(agent)) visualization(str(agent))