1
0
mirror of https://github.com/gsi-upm/soil synced 2025-08-24 03:52:20 +00:00
This commit is contained in:
J. Fernando Sánchez
2022-10-06 15:49:10 +02:00
parent 0a9c6d8b19
commit f811ee18c5
53 changed files with 856 additions and 774 deletions

View File

@@ -10,7 +10,7 @@ network_params:
n: 10
n_edges: 5
network_agents:
- agent_type: CounterModel
- agent_class: CounterModel
weight: 1
state:
state_id: 0

View File

@@ -1,6 +1,5 @@
from networkx import Graph
import networkx as nx
from random import choice
def mygenerator(n=5, n_edges=5):
'''
@@ -14,9 +13,9 @@ def mygenerator(n=5, n_edges=5):
for i in range(n_edges):
nodes = list(G.nodes)
n_in = choice(nodes)
n_in = self.random.choice(nodes)
nodes.remove(n_in) # Avoid loops
n_out = choice(nodes)
n_out = self.random.choice(nodes)
G.add_edge(n_in, n_out)
return G
@@ -24,4 +23,4 @@ def mygenerator(n=5, n_edges=5):