Description Usage Arguments Details Value Examples
Create NetLogo procedure network
1 | procedure_nw(modelfiles)
|
modelfiles |
vector of filepaths to model files |
procedure_nw reads model code from the provided model files. The procedure identifies NetLogo proecdures and searches for procedure calls within the code. From this data, an igraph network is created and returned. This network can be used to plot the model procedure network and identify model components.
network of model procedures (igraph)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# Determine the function network:
nw <- procedure_nw(modelfiles)
# Determine communities within the network and plot using Igraph package:
library(igraph)
com <- walktrap.community(nw)
V(nw)$community <- com$membership
rain <- rainbow(14, alpha=.5)
V(nw)$color <- rain[V(nw)$community]
plot(nw,
edge.arrow.size=.2,
vertex.label.color="black",
vertex.label.dist=1,
vertex.size=5,
edge.curved=0,
vertex.label.cex=.5,
layout=layout_with_fr(nw, niter = 2000))
# Interactive plot using igraph::tkplot
tkplot(nw, layout=layout_with_fr(nw, niter = 2000))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.