-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
189 changed files
with
12,681 additions
and
6,921 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,6 @@ network.xml.gz | |
analysis_berlin10/ | ||
kelheim/ | ||
test/ | ||
dashboard_test/ | ||
.sentinel* | ||
inst/doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: matsim | ||
Type: Package | ||
Title: R library for interfacing with MATSim agent-based microsimulation model | ||
Version: 0.1.9 | ||
Version: 0.2.0 | ||
Authors@R: c( | ||
person("Billy", "Charlton", email = "[email protected]", role=c("aut","cre")), | ||
person("Oleksandr", "Soboliev", role="aut")) | ||
|
@@ -11,10 +11,10 @@ Description: MATSim support package for R | |
of the Python matsim-tools package, and thus supports reading standard | ||
MATSim networks and soon, plans and events as well. | ||
. | ||
Developed with support from the Technische Universität Berlin's | ||
Developed with support from the Technische Universität Berlin's | ||
VSP Transport Planning and Transport Telematics department. | ||
. | ||
This project is under ongoing development and submissions are welcome! | ||
This project is under ongoing development and submissions are welcome! | ||
License: GPL (>= 3) | ||
Encoding: UTF-8 | ||
Imports: | ||
|
@@ -42,5 +42,8 @@ URL: https://github.com/matsim-vsp/matsim-r | |
BugReports: https://github.com/matsim-vsp/matsim-r/issues | ||
RoxygenNote: 7.2.3 | ||
Suggests: | ||
knitr, | ||
rmarkdown, | ||
testthat (>= 3.0.0) | ||
Config/testthat/edition: 3 | ||
VignetteBuilder: knitr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,5 @@ docs: .sentinel-make-docs | |
clean: | ||
> rm -rf docs | ||
> rm -rf man | ||
> rm .sentinel* | ||
.PHONY: clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#' Load MATSIM config file into Memory | ||
#' | ||
#' Loads a MATSim xml config from file or archive, | ||
#' creating a list with parameters as in xml file | ||
#' | ||
#' @param input_path character string, path to matsim output directory or http link to the file. | ||
#' @param n_max integer, maximum number of lines to read within output_trips | ||
#' @return tibble of trips_output | ||
#' | ||
#' @export | ||
read_config <- function(input_path = ".", n_max = Inf) { | ||
|
||
result_tibble <- tibble(module = character(), | ||
param = character(), | ||
value = character()) | ||
|
||
config_xml<-read_xml(input_path) | ||
|
||
module_nodeset<-xml_children(config_xml) | ||
|
||
result_list <- list() | ||
|
||
for(i in 1:length(module_nodeset)){ | ||
module_name = xml_attr(module_nodeset[[i]],"name") | ||
|
||
param_nodeset = xml_children(module_nodeset[[i]]) | ||
for(j in 1:length(param_nodeset)){ | ||
param_name<-xml_attr(param_nodeset[[j]],"name") | ||
value_name<-xml_attr(param_nodeset[[j]],"value") | ||
#print(param_name,value_name) | ||
|
||
result_list[[module_name]][[param_name]] <- value_name | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
return(result_list) | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.