validate_cellplan: Validate cellplan

View source: R/validate_cellplan.R

validate_cellplanR Documentation

Validate cellplan

Description

Validate the cellplan. The cellplan is made valid whenever possible. It checks the format and whether are all required variables present. When land, a mutlipolygon object that defines the region of interest, is specified, it checks whether all cells are inside this region.

Usage

validate_cellplan(
  cp,
  param,
  elevation = NULL,
  region = NULL,
  envir = NULL,
  fix = TRUE
)

Arguments

cp

cellplan sf object containing the cell data. Each data record should be a point (i.e., st_geometry_type(cp) should return POINTs). The optional variables are:

  • height. Height of the cell. If omitted, it will be derived from variable z if specified and otherwise, the default value height from the parameter list param will be used.

  • z. Note that z = elevation + height. Elevation is taken from the argument elevation. If this is not specified, it will be assumed 0.

  • direction. Direction of the antanna in degrees. Use NA for omnidirectional cells.

  • tilt. Tilt of the cells in degrees. Only applicable for directional cells If omitted, the default value tilt from the parameter list param will be used.

  • beam_h. Horizontal beam width in degrees. The signal loss at -beam_h/2 and +beam_h/2 degrees is 3 dB. Run radiation_plot(beam_width = 65, db_back = -30). If omitted, the default value beam_h from the parameter list param will be used.

  • beam_v. Vertical beam width in degrees. The signal loss at -beam_v/2 and +beam_v/2 degrees is 3 dB. Run radiation_plot(type = "e", beam_width = 9, db_back = -30). If omitted, the default value beam_v from the parameter list param will be used.

  • W. Power of the cell in Watt.

  • small. Logical value that determines whether the cell is a 'small cell'. If omitted, it will be set to FALSE. In the mobloc package, small cells have different default values for a couple of parameters (i.e. the "_small" parameters in param).

  • range. The maximum range of the cell. If omitted, the value max_range from the parameter list param will be used. If small is defined, the value max_range_small is used for each cell for which small == TRUE.

  • ple. The path loss exponent, which is an approximation of the level of reflection: 2 is open field, 4 is urban area, 6 is inside buildings. It can be derived when envir is specific.

param

parameter list created with mobloc_param

elevation

see argument cp (variable z)

region

polygon shape. If specified, it checks if all cells are contained inside it

envir

raster layer that specifies the environment. For each raster tile, an indicator between 0 and 1 is required (open space is 0 and dense environment is 1). These values are scaled to the parameters ple_0 and ple_1.

fix

should the cellplan that is not yet valid be made valid? If FALSE, only errors, warnings, and messages regarding the validation will be returned. If TRUE, the cellplan will be returned with a validation stamp (specifically, the attribute valid_cellplan is set to codeTRUE)

See Also

vignette("mobloc")

Examples

## Not run: 
# set parameters
ZL_param <- prop_param()

# load data
data("ZL_cellplan", "ZL_muni", "ZL_elevation", "ZL_landuse")

# create environment layer (needed to calculate path loss exponent (ple))
ZL_envir <- combine_raster_layers(ZL_landuse, weights = c(1, 1, 1, 0, 0))

# validate cellplan
ZL_cellplan <- validate_cellplan(ZL_cellplan, param = ZL_param, region = ZL_muni,
    envir = ZL_envir, elevation = ZL_elevation)

## End(Not run)

MobilePhoneESSnetBigData/mobloc documentation built on Feb. 18, 2024, 3:41 a.m.