tapios / risk-networks

Code for risk networks: a blend of compartmental models, graphs, data assimilation and semi-supervised learning
Other
2 stars 2 forks source link

Inherit attributes & update user_network from contact_network #149

Closed dburov190 closed 4 years ago

dburov190 commented 4 years ago

This PR deals with two issues:

  1. when creating a ContactNetwork object via from_networkx_graph all attributes are now passed on; the syntax hasn't changed:
    network = ContactNetwork.from_networkx_graph(graph)
    # with regards to user network creation:
    user_network = network.build_user_network_using(SomeGraphBuilder())
  2. when running a simulation for synthetic data, the user network should be updated accordingly; hence, a new method is implemented:
    for time in time_span:
    network = epidemic_simulator.run(network)
    user_network.update_from(network)
    # other stuff with user_network

The second feature hasn't been tested properly yet because there's currently no example in master that utilizes user networks. Once this is merged into master and then into paper-examples, we can test it.