Skip to content

Commit 6b1d192

Browse files
committed
updated post to fit last modifs in net extr fct
1 parent fdf0f37 commit 6b1d192

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

src/post/asoiaf/extr_dyn.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ tlog(0,"Extract dynamic networks for ASOIAF")
2020
# read raw data
2121
tlog(2,"Reading previously computed corpus stats")
2222
data <- read.corpus.data(char.det="implicit")
23+
inter.df <- data$inter.df
2324
char.stats <- data$char.stats
2425
scene.stats <- data$scene.stats
2526
scene.chars <- data$scene.chars
@@ -31,15 +32,17 @@ tlog(2,"Extracting publication-ordered dynamic networks")
3132
for(filtered in c(FALSE,TRUE))
3233
{ tlog(4,"Dealing with ",if(filtered) "" else "un","filtered networks")
3334
gg <- cum.graph.extraction(
35+
inter.df=inter.df,
3436
char.stats=char.stats,
3537
scene.chars=scene.chars, scene.stats=scene.stats,
3638
volume.stats=volume.stats,
3739
filtered=filtered,
38-
pub.order=pub.order,
39-
char.det="implicit"
40+
pub.order=FALSE
4041
)
41-
cum.write.graph(gs=gg, filtered=filtered, pub.order="publication", char.det="implicit")
42+
cum.write.graph(gs=gg, filtered=filtered, pub.order=FALSE, char.det="implicit")
43+
gg <- cum.read.graph(filtered=filtered, remove.isolates=TRUE, pub.order=FALSE, char.det="implicit")
4244
}
45+
4346

4447
# extract dynamic networks using the novel publication order (slightly different from the comic's)
4548
tlog(2,"Extracting novel-ordered dynamic networks")

src/post/description/avgdist_evol.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ for(pub.order in c(FALSE, TRUE))
4040

4141
# compute the sequence of scene-based graphs (possibly one for each scene)
4242
tlog(0, "Extract graph sequence")
43-
gs <- extract.static.graph.scenes(
43+
gs <- cum.graph.extraction(
4444
inter.df=data$inter.df,
4545
char.stats=data$char.stats,
4646
scene.stats=data$scene.stats, scene.chars=data$scene.chars,
4747
volume.stats=data$volume.stats,
48-
ret.seq=TRUE, pub.order=pub.order
48+
filtered=FALSE,
49+
pub.order=pub.order,
50+
narr.unit="scene"
4951
)
5052

5153
# init lists

src/post/description/char_sim.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,16 @@ for(narr.smooth in c(FALSE,TRUE))
110110
else
111111
{ net.type <- "cumulative"
112112
tlog(14,"Extracting the sequence of graphs")
113-
gs[["unfiltered"]] <- extract.static.graph.scenes(
113+
gs[["unfiltered"]] <- cum.graph.extraction(
114114
inter.df=data$inter.df,
115115
char.stats=char.stats,
116116
volume.stats=volume.stats,
117117
scene.stats=scene.stats, scene.chars=scene.chars,
118-
ret.seq=TRUE, pub.order=pub.order
118+
filtered=FALSE,
119+
pub.order=pub.order,
120+
narr.unit="scene"
119121
)
122+
120123
# possibly set weights
121124
if(weighted)
122125
{ gs[["unfiltered"]] <- future_lapply(gs[["unfiltered"]], function(g) {E(g)$weight <- E(g)$Occurrences; return(g)})

src/post/description/pref_attach.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,16 @@ if(length(filt.names)==0) stop("Empty list of filtered characters")
6666
tlog(0,"Extract the sequence of scene-related cumulative graphs")
6767
data <- read.corpus.data(char.det="implicit")
6868
# compute the sequence of scene-based graphs (possibly one for each scene)
69-
gs.unf <- extract.static.graph.scenes(
69+
gs.unf <- cum.graph.extraction(
7070
inter.df=data$inter.df,
7171
char.stats=data$char.stats,
7272
scene.stats=data$scene.stats, scene.chars=data$scene.chars,
7373
volume.stats=data$volume.stats,
74-
ret.seq=TRUE, pub.order=TRUE # TODO check that this parm is used in the rest of the graph (should be a main script param)
74+
filtered=FALSE,
75+
pub.order=TRUE,
76+
narr.unit="scene"
7577
)
78+
7679
gs.filt <- future_lapply(gs.unf, function(g) delete_vertices(g, v=intersect(filt.names,V(g)$name)))
7780
# build the list for latter use
7881
gsl <- list()

0 commit comments

Comments
 (0)