Skip to content

feat: layered networks with define_network replacing edge types - #1089

Open
k88hudson-cfa wants to merge 3 commits into
mainfrom
k88-network-module
Open

k88hudson-cfa wants to merge 3 commits into
mainfrom
k88-network-module

Conversation

@k88hudson-cfa

Copy link
Copy Markdown
Collaborator

This replaces the EdgeType network API with layered networks. A network is declared once with a set of layers (household, school, workplace, etc.). Every method takes a layer value (or in the case where you don't define layers, the name of the network):

define_network!(Contact, Person, layers = { Household, School }, data = f64);
define_network!(InfectionTree, Person); // one layer, no edge data

context.add_edge_bidi(Contact::Household, p1, p2, 1.0)?;
for edge in context.get_edges(Contact::School, p1) { /* edge.neighbor, edge.data */ }
let contact = context.sample_edge_weighted(TransmissionRng, Contact::School, p1, |e| e.data);

@k88hudson-cfa k88hudson-cfa changed the title Layered networks with define_network replacing edge types feat: layered networks with define_network replacing edge types Nov 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant