region: Constructor for object of class 'region'

Description Usage Arguments Value Methods (by generic) Examples

View source: R/region.R

Description

The function region() is the constructor function for the homonymous class.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## S3 method for class 'region'
get_p_accept(x, ...)

## S3 method for class 'region'
get_offered(x, ...)

## S3 method for class 'region'
get_p_default(x, ...)

## S3 method for class 'region'
get_state(x, ...)

## S3 method for class 'region'
get_region(x, ...)

## S3 method for class 'region'
get_regions(x, ...)

## S3 method for class 'region'
get_all_region(x, ...)

## S3 method for class 'region'
get_centers(x, ...)

region(centers, default_p = 1)

## S3 method for class 'region'
print(x, ...)

Arguments

x

an object used to select a method.

...

further arguments passed to or from other methods.

centers

[lst] a list of objects of class center, passed by set_centers(). Note: all the center in a region must be of the same region and state.

default_p

[dbl] a single number between 0 and 1 (possibly included) representing the default probability for the centers in the region (if not explicitelly specified in the center properties) to accept an offered organ. Default is 1, which means that if offered, an organ is always accepted.

Value

An object of class region.

Methods (by generic)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
pavia   <- center('Pavia',   'Lombardia', 10, 0.8)
bergamo <- center('Bergamo', 'Lombardia', 10, 0.5)
milano  <- center('Milano',  'Lombardia', 10)

lombardia <- region(set_centers(pavia, bergamo, milano), default_p = 0.2)
get_p_accept(lombardia)
get_offered(lombardia)
get_p_default(lombardia)
get_state(lombardia) # italy
get_state(lombardia) # italy
get_regions(lombardia)
get_all_region(lombardia) # lombardia
get_centers(lombardia)
pavia   <- center('Pavia',   'Lombardia', 10, 0.8)
bergamo <- center('Bergamo', 'Lombardia', 10, 0.5)
milano  <- center('Milano',  'Lombardia', 10)

lombardia <- region(set_centers(pavia, bergamo, milano), default_p = 0.2)

pavia
bergamo
milano

lombardia

UBESP-DCTV/clumpr documentation built on July 3, 2021, 11:23 p.m.