@@ -1156,46 +1156,48 @@ generate.static.plots.scene <- function(arc=NA, vol=NA, filtered=FALSE)
11561156 }
11571157 }
11581158
1159- # compute and plot additional stuff
1160- # read the graph
1161- graph.file <- get.path.data.graph(mode = " scenes" , net.type = " static" , filtered = FALSE , pref = " graph" , ext = " .graphml" )
1162- g <- read.graphml.file(file = graph.file )
1163- if (filtered )
1164- g <- delete_vertices(graph = g , v = which(V(g )$ Filter == " Discard" ))
1165- g.dur <- g ; E(g.dur )$ weight <- E(g )$ Duration
1166- g.occ <- g ; E(g.occ )$ weight <- E(g )$ Occurrences
1167-
1168- # degree vs. neighbors' degree
1169- filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_DEGREE , weights = wmode , arc = arc , vol = vol , filtered = filt.txt , suf = " nei.deg_vs_degree" )
1170- neigh.degree.vs.degree(g , weights = FALSE , filename , col )
1171- for (wmode in c(" occurrences" ," duration" ))
1172- { filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_STRENGTH , weights = wmode , arc = arc , vol = vol , filtered = filt.txt , suf = " nei.str_vs_strength" )
1173- if (wmode == " duration" )
1174- neigh.degree.vs.degree(g.dur , weights = TRUE , filename , col )
1175- else if (wmode == " occurrences" )
1176- neigh.degree.vs.degree(g.occ , weights = TRUE , filename , col )
1177- }
1178-
1179- # degree vs. transitivity
1180- filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_MULTI_NODES , weights = wmode , arc = arc , vol = vol , filtered = filt.txt , suf = " transitivity_vs_degree" )
1181- transitivity.vs.degree(g , weights = FALSE , filename , col )
1182- for (wmode in c(" occurrences" ," duration" ))
1183- { filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_MULTI_NODES , weights = wmode , arc = arc , vol = vol , filtered = filt.txt , suf = " transitivity_vs_strength" )
1184- if (wmode == " duration" )
1185- transitivity.vs.degree(g.dur , weights = TRUE , filename , col )
1186- else if (wmode == " occurrences" )
1187- transitivity.vs.degree(g.occ , weights = TRUE , filename , col )
1188- }
1189-
1190- # hop plots
1191- filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_DISTANCE , weights = wmode , arc = arc , vol = vol , filtered = filt.txt , suf = " hop-plot" )
1192- hop.plot(g , weights = FALSE , filename , col )
1193- for (wmode in c(" occurrences" ," duration" ))
1194- { filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_DISTANCE , weights = wmode , arc = arc , vol = vol , filtered = filt.txt , suf = " hop-plot" )
1195- if (wmode == " duration" )
1196- hop.plot(g.dur , weights = TRUE , filename , col )
1197- else if (wmode == " occurrences" )
1198- hop.plot(g.occ , weights = TRUE , filename , col )
1159+ # compute and plot additional stuff (not for volume- or arc-specific graphs)
1160+ if (is.na(vol ) && is.na(arc ))
1161+ { # read the graph
1162+ graph.file <- get.path.data.graph(mode = " scenes" , net.type = " static" , filtered = FALSE , pref = " graph" , ext = " .graphml" )
1163+ g <- read.graphml.file(file = graph.file )
1164+ if (filtered )
1165+ g <- delete_vertices(graph = g , v = which(V(g )$ Filter == " Discard" ))
1166+ g.dur <- g ; E(g.dur )$ weight <- E(g )$ Duration
1167+ g.occ <- g ; E(g.occ )$ weight <- E(g )$ Occurrences
1168+
1169+ # degree vs. neighbors' degree
1170+ filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_MULTI_NODES , weights = " none" , arc = arc , vol = vol , filtered = filt.txt )
1171+ neigh.degree.vs.degree(g = g , weights = FALSE , filename = filename , col = col )
1172+ for (wmode in c(" occurrences" ," duration" ))
1173+ { filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_MULTI_NODES , weights = wmode , arc = arc , vol = vol , filtered = filt.txt )
1174+ if (wmode == " duration" )
1175+ neigh.degree.vs.degree(g = g.dur , weights = TRUE , filename = filename , col = col )
1176+ else if (wmode == " occurrences" )
1177+ neigh.degree.vs.degree(g = g.occ , weights = TRUE , filename = filename , col = col )
1178+ }
1179+
1180+ # degree vs. transitivity
1181+ filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_MULTI_NODES , weights = " none" , arc = arc , vol = vol , filtered = filt.txt )
1182+ transitivity.vs.degree(g = g , weights = FALSE , filename = filename , col = col )
1183+ for (wmode in c(" occurrences" ," duration" ))
1184+ { filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_MULTI_NODES , weights = wmode , arc = arc , vol = vol , filtered = filt.txt )
1185+ if (wmode == " duration" )
1186+ transitivity.vs.degree(g = g.dur , weights = TRUE , filename = filename , col = col )
1187+ else if (wmode == " occurrences" )
1188+ transitivity.vs.degree(g = g.occ , weights = TRUE , filename = filename , col = col )
1189+ }
1190+
1191+ # hop plots
1192+ filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_MULTI_NODEPAIRS , weights = " none" , arc = arc , vol = vol , filtered = filt.txt )
1193+ hop.plot(g = g , weights = FALSE , filename = filename , col = col )
1194+ for (wmode in c(" occurrences" ," duration" ))
1195+ { filename <- get.path.stats.topo(mode = mode , net.type = " static" , meas.name = MEAS_MULTI_NODEPAIRS , weights = wmode , arc = arc , vol = vol , filtered = filt.txt )
1196+ if (wmode == " duration" )
1197+ hop.plot(g = g.dur , weights = TRUE , filename = filename , col = col )
1198+ else if (wmode == " occurrences" )
1199+ hop.plot(g = g.occ , weights = TRUE , filename = filename , col = col )
1200+ }
11991201 }
12001202}
12011203
0 commit comments