Line graph

Example I

[1]:
import networkx as nx

import pop2net

model = pop2net.Model()
creator = pop2net.Creator(model)
inspector = pop2net.NetworkInspector(model)


class Line(pop2net.LocationDesigner):
    nxgraph = nx.path_graph(10)


for _ in range(10):
    pop2net.Agent(model)

creator.create_locations(
    location_designers=[
        Line,
    ]
)
[1]:
LocationList (9 objects)
[2]:
inspector.plot_bipartite_network()
[3]:
inspector.plot_agent_network()