Commit 0068799f authored by Jan Žižka's avatar Jan Žižka
Browse files

Add generation of second smaller system

parent e6b8de5f
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -273,3 +273,26 @@ net.grow_layer("Programs", 10, color="red")
net.grow_layer("Runtimes", 3, color="red")

net.draw()

# Reset colors of model to cancel highlights
net.set_color()
net.set_layer_color("lightgrey")


# Create model of second system, use same graph models and layers
# For demonstration
net2 = Network("A Second Software System")

net2.add_layer(Layer("Programmers", nx.barabasi_albert_graph(10, 1), GraphType.BA, 1), "blue", offset=65)
net2.add_layer(Layer("Git repositories", nx.barabasi_albert_graph(5, 1), GraphType.BA, 1), "orange", offset=22)
net2.add_layer(Layer("Programs", nx.erdos_renyi_graph(3, 0.3), GraphType.ER, 0.3), "magenta", offset=30)
net2.add_layer(Layer("Runtimes", nx.barabasi_albert_graph(3, 1), GraphType.BA, 1), offset=0)

net2.add_cross_layer("Programmers", "Git repositories", 0.5)
net2.add_cross_layer("Git repositories", "Programs", 0.8)
net2.add_cross_layer("Programs", "Runtimes", 0.5)

net2.set_color()
net2.set_layer_color("lightgrey")

net2.draw()