The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
library(agena.ai)#setwd("/Users/user/repos/api-r")model <- from_cmpx("CarCosts.cmpx")dsId <- "mercedes"
dsIndex <- which(sapply(model$dataSets, function(sds) sds$id %in% dsId))
dataSet <- model$dataSets[[dsIndex]]network <- model$networks[[1]]
nodeCarType <- network$nodes[[which(sapply(network$nodes, function(item) item$id %in% "car_type"))]]
nodeMilesPerYear <- network$nodes[[which(sapply(network$nodes, function(item) item$id %in% "Miles_per_year"))]]
nodeReliability <- network$nodes[[which(sapply(network$nodes, function(item) item$id %in% "Reliability"))]]
nodeTotalAnnualCost <- network$nodes[[which(sapply(network$nodes, function(item) item$id %in% "total_cost"))]]model$enter_observation(dsId, node=nodeCarType$id, network=network$id, value="Small")
model$enter_observation(dsId, node=nodeMilesPerYear$id, network=network$id, value=1000)
model$enter_observation(dsId, node=nodeReliability$id, network=network$id, value="Low")local_api_calculate(model, dsId, "mercedes.json")dsIndex <- which(sapply(model$dataSets, function(sds) sds$id %in% dsId))
dataSet <- model$dataSets[[dsIndex]]
resIndex <- which(sapply(model$dataSets[[dsIndex]]$results, function(res) res$node %in% "total_cost"))
model$dataSets[[dsIndex]]$results[[resIndex]]$node
model$dataSets[[dsIndex]]$results[[resIndex]]$summaryStatistics$meanThese binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.