R/capa_bs_png_pt.R

Defines functions capa_bs_png_pt

#' Bus passenger Capacity Per Hour at Bus Stops
#'
#' Bus passenger capacity per hour at bus stops in uninterrupted or interrupted flow(Buses/h)
#'     It follows <Formula 13-5>, <Formula 13-6> in KHCM(2013), p.601.
#' @param flow_type Choose one from: \code{'uninterrupted'}, \code{'interrupted'}
#' @param R Parking surface capacity correction factor. See \code{\link{R_pt}}
#' @param t_c Erasing time(seconds). See \code{\link{t_c_pt}}
#' @param t_D Stop time(seconds). See \code{\link{t_D_pt}}
#' @param g_c_ratio Ratio of valid green time.
#' @param N Utilization efficiency coefficient according to the number of stopping area. See \code{\link{ue_bs_pt}}
#' @param P Number of passengers by bus(person/bus)
#' @seealso \code{\link{ue_bs_pt}}, \code{\link{R_pt}}, \code{\link{t_c_pt}}, \code{\link{t_D_pt}}
#' @export capa_bs_png_pt
#' @examples
#' capa_bs_png_pt(flow_type = 'interrupted', R = 0.93, t_c = 13.2, t_D = 20, g_c_ratio = 0.3, N = 1.75, P = 20)
capa_bs_png_pt <- function(flow_type = NULL, R = NULL, t_c = NULL, t_D = NULL, g_c_ratio = NULL, N = NULL, P = NULL){
  cb <- capa_area_pt(flow_type = flow_type, R = R, t_c = t_c, t_D = t_D, g_c_ratio = g_c_ratio)
  if (is.numeric(cb) == TRUE){
    if (N > 0){
      if (P > 0){capap <- cb * N * P}
      else {capap <- 'Error : [P] must be positive integer. Please check that.'}
    }
    else {capap <- 'Error : [N] must be positive integer. Please check that.'}
  }
  else {capap <- cb}
  capap
}
regenesis90/KHCMinR documentation built on Dec. 22, 2021, 2:06 p.m.