Nothing
## This code writes the list of constraints (8) of the ILP problem for all the
## conditions.
##
## Enio Gjerga, 2020
write_constraints_8 <- function(variables=variables,
inputs=inputs,
pknList=pknList){
## constraints8 <- c()
##
## for(ii in seq_len(length(variables))){
##
## ##
## cc <- paste0(
## variables[[ii]]$variables[variables[[ii]]$idxNodesUp],
## " - ",
## variables[[ii]]$variables[variables[[ii]]$idxNodesDown],
## " + ", variables[[ii]]$variables[variables[[ii]]$idxB],
## " - ", variables[[ii]]$variables[variables[[ii]]$idxNodes], " = 0")
##
## constraints8 <- c(constraints8, cc)
##
## ##
## kk <- paste0("Species ", colnames(inputs), " in experiment ", ii)
## cc <- paste0(
## variables[[ii]]$variables[variables[[ii]]$idxB[which(
## !(variables[[ii]]$exp[variables[[ii]]$idxNodes] %in% kk))]], " = 0")
## constraints8 <- c(constraints8, cc)
##
## ##
## kk <- paste0("Species ", colnames(inputs), " in experiment ", ii)
## cc= c()
## for(jj in seq_len(length(kk))){
## cName = strsplit(x = kk[jj], split = " ")[[1]][2]
## cc = c(cc, paste0(
## variables[[ii]]$variables[which(
## variables[[ii]]$exp==paste0(
## "Species ", cName, " in experiment ", ii))], " = ", inputs[ii, jj]))
## }
## constraints8 <- c(constraints8, cc)
##
## ##
## if (length(
## setdiff(
## as.character(pknList[, 1]),
## as.character(pknList[, 3])))>0) {
## kk <- paste0(
## "Species ",
## setdiff(as.character(pknList[, 1]),
## as.character(pknList[, 3])), " in experiment ", ii)
## cc <- paste0(
## variables[[ii]]$variables[variables[[ii]]$idxNodes[which(
## variables[[ii]]$exp[variables[[ii]]$idxNodes] %in% kk)]], " - ",
## variables[[ii]]$variables[variables[[ii]]$idxB[which(
## variables[[ii]]$exp[variables[[ii]]$idxNodes] %in% kk)]],
## " = 0")
## constraints8 <- c(constraints8, cc)
## }
##
## }
ii=1
##
cc1 <- paste0(
variables[[ii]]$variables[variables[[ii]]$idxNodesUp],
" - ",
variables[[ii]]$variables[variables[[ii]]$idxNodesDown],
" + ", variables[[ii]]$variables[variables[[ii]]$idxB],
" - ", variables[[ii]]$variables[variables[[ii]]$idxNodes], " = 0")
## constraints8 <- c(constraints8, cc)
##
kk <- paste0("Species ", colnames(inputs), " in experiment ", ii)
cc2 <- paste0(
variables[[ii]]$variables[variables[[ii]]$idxB[which(
!(variables[[ii]]$exp[variables[[ii]]$idxNodes] %in% kk))]], " = 0")
## constraints8 <- c(constraints8, cc)
##
kk <- paste0("Species ", colnames(inputs), " in experiment ", ii)
cc3= c()
for(jj in seq_len(length(kk))){
cName = strsplit(x = kk[jj], split = " ")[[1]][2]
cc3 = c(cc3, paste0(
variables[[ii]]$variables[which(
variables[[ii]]$exp==paste0(
"Species ", cName, " in experiment ", ii))], " = ", inputs[ii, jj]))
}
## constraints8 <- c(constraints8, cc)
##
if (length(
setdiff(
as.character(pknList[, 1]),
as.character(pknList[, 3])))>0) {
kk <- paste0(
"Species ",
setdiff(as.character(pknList[, 1]),
as.character(pknList[, 3])), " in experiment ", ii)
cc4 <- paste0(
variables[[ii]]$variables[variables[[ii]]$idxNodes[which(
variables[[ii]]$exp[variables[[ii]]$idxNodes] %in% kk)]], " - ",
variables[[ii]]$variables[variables[[ii]]$idxB[which(
variables[[ii]]$exp[variables[[ii]]$idxNodes] %in% kk)]],
" = 0")
## constraints8 <- c(constraints8, cc)
}
constraints8 <- c(cc1, cc2, cc3, cc4)
return(constraints8)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.