On 01/04/14 18:48, Mitchell Joblin wrote: > - we need to rething how to store edge lists in the database > because the model does not seem to work well > - we already see a break down in the model by storing complete > graphs under the cluster number -1 and still with a > clustering method type agreed, that's only a hacky solution. I suppose the distinction between the global graph indexed by -1 and the local clusters indexed by postive numbers is the design choice you find ...suboptimal (completely agreed)? Or would you also want to pick a different format than edge lists to store the graph content? I don't see any reason for the latter. > > - address database issues before commiting to master so, in other words, this is something I should _not_ merge? I suppose so, but just to make sure. The commit message right now is not really aligned to the patch content, anyway. > > Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx> > --- > codeface/R/ml/analysis.r | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/codeface/R/ml/analysis.r b/codeface/R/ml/analysis.r > index 840443e..9b2b3b3 100644 > --- a/codeface/R/ml/analysis.r > +++ b/codeface/R/ml/analysis.r > @@ -599,7 +599,8 @@ dispatch.steps <- function(conf, repo.path, data.path, > forest.corp, cycle, > interest.networks=interest.networks, > twomode.graphs=twomode.graphs, > networks.dat=networks.dat, > - thread.info=thread.info) > + thread.info=thread.info, > + communication.network=communication.network) dispatch.steps acquires a new parameter here, but where do you change the caller? Maybe I missed this change somewhere. Thanks, Wolfgang > save(file=file.path(data.path, "vis.data"), res) > > ####### End of actual computation. Generate graphs and store data etc. > ####### > @@ -645,10 +646,20 @@ store.initiate.response <- function(conf, ir, ml.id, > range.id) { > } > } > > +store.communication.graph <- function(conf, communication.network, range.id) > { > + g <- graph.adjacency(communication.network) > + edgelist <- get.data.frame(g, what="edges") > + colnames(edgelist) <- c("fromId", "toId") > + edgelist <- gen.weighted.edgelist(edgelist) > + type <- "email" > + write.graph.db(conf, range.id, type, edgelist, -1) > +} > + > ## Dispatcher for all data storing functions above > store.data <- function(conf, res, range.id, ml.id) { > store.initiate.response(conf, res$networks.dat$ir, ml.id, range.id) > store.twomode.graphs(conf, res$twomode.graphs, ml.id, range.id) > + store.communication.graph(conf, res$communication.network, range.id) > } > > create.network.plots <- function(conf, plots.path, res) { >