R/ANLYS_expwy_basic_LOS.R

Defines functions ANLYS_expwy_basic

#' Analysis of the Operating Status of the Basic Section of Expressway
#'
#' It analyze the operating status(Level of service, LOS) of the basic section of expressway.
#'     - Input format : dataframe
#'     - It follows the example in KHCM(2013), p.42-43
#' @param obs Obstacle. Choose one from :\code{'one_side'}, \code{'both_sides'}
#' @param side_clearance The lateral clearance of lane. From the center line of the center line to the pavement edge of the lane. The Average of left lateral clearance and right lateral clearance.
#' @param lane The number of expressway lane(Round-trip). It must be 4 or more.
#' @param N The number of freeway lane(one-way lane). It means (# of normal one-way lane) - (# of lanes closed due to construction)
#' @param lane_width The width of each lane(m). It must be equal to or more than 2.75
#' @param landform Choose one from : \code{'flatland'}, \code{'hill'}, \code{'mountain'}, \code{'specific_slope}
#' @param P_T1 The ratio of small heavy vehicle composition(Trucks less than 2.5 tons, buses less than 16 passengers)
#' @param P_T2 The ratio of middle heavy vehicle composition(Trucks of 2.5 tons or more, buses with 16 passengers or more)
#' @param P_T3 The ratio of large heavy vehicle composition(Semi trailer or full trailer)
#' @param P_hv The ratio of total heavy vehicles.
#' @param slope Slope gradient(%)
#' @param slope_length The length of the slope(km)
#' @param v Current or future traffic volume(vph). It must be positive. See \code{\link{DDHV}}.
#' @param PHF Peak Hour Factor(PHF). See \code{\link{PHF_expwy_basic}}.
#' @param design_speed Design speed. Choose one from : \code{120}, \code{100}, \code{80}
#' @param weather Weather condition. Choose one from : \code{'sunny'}, \code{'rainy'}, \code{'snowy'}
#' @param precip Rainfall or snowfall or hail. Precipitation(mm/h).
#' @param day_night Distinguish between day and night. Choose one from : \code{'day'}, \code{'night'}
#' @keywords analysis operating status LOS service level
#' @seealso \code{\link{f_hv_expwy_basic}}, \code{\link{f_w_expwy_basic}}, \code{\link{f_iw_expwy_basic}}, \code{\link{f_dk}}, \code{\link{capa_expwy_basic_j}}, \code{\link{capa_expwy_basic}}, \code{\link{V_P_expwy_basic}}, \code{\link{LOS_expwy_basic}}.
#' @export ANLYS_expwy_basic_LOS
#' @examples
#' ANLYS_expwy_basic(obs = 'one_side',
#'                   side_clearance = 1.75,
#'                   lane = 4,
#'                   N = 2,
#'                   lane_width = 3.5,
#'                   landform = 'hill',
#'                   P_T1 = 0, P_T2 = 0.2, P_T3 = 0,
#'                   v = 2000, PHF = 0.95,
#'                   design_speed = 100,
#'                   weather = 'sunny',
#'                   precip = 0,
#'                   day_night = 'day')
ANLYS_expwy_basic <- function(obs = NULL, side_clearance = NULL, lane = NULL, N = NULL, lane_width = NULL,
                              landform = NULL, P_T1 = NULL, P_T2 = NULL, P_T3 = NULL, P_hv = NULL, slope = NULL, slope_length = NULL,
                              v = NULL, PHF = NULL, design_speed = NULL, weather = NULL, precip = NULL, day_night = NULL){
  f_hv <- f_hv_expwy_basic(landform = landform, P_T1 = P_T1, P_T2 = P_T2, P_T3 = P_T3, P_hv = P_hv, slope = slope, slope_length = slope_length)
  f_w <- f_w_expwy_basic(obs = obs, side_clearance = side_clearance, lane = lane, lane_width = lane_width)
  f_iw <- f_iw_expwy_basic(design_speed = design_speed, weather = weather, precip = precip)
  f_dk <- f_dk(design_speed = design_speed, day_night = day_night)
  c_j <- capa_expwy_basic_j(design_speed = design_speed)
  capacity <- capa_expwy_basic(c_j = c_j, N = N, f_w = f_w, f_hv = f_hv, f_iw = f_iw, f_dk = f_dk)
  V_P <- V_P_expwy_basic(v = v, PHF = PHF)
  v_c_ratio <- V_P/capacity
  LOS <- LOS_expwy_basic(design_speed = design_speed, v_c_ratio = v_c_ratio)
  LOS
}
regenesis90/KHCMinR documentation built on Dec. 22, 2021, 2:06 p.m.