Description Usage Arguments Value Methods (by generic) Note Examples
The function macroregion()
is the constructor function for
the homonymous class.
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 29 30 31 32 | ## S3 method for class 'macroregion'
get_centers(x, ...)
## S3 method for class 'macroregion'
get_regions(x, ...)
## S3 method for class 'macroregion'
get_all_region(x, ...)
## S3 method for class 'macroregion'
get_state(x, ...)
## S3 method for class 'macroregion'
get_p_accept(x, ...)
## S3 method for class 'macroregion'
get_offered(x, ...)
## S3 method for class 'macroregion'
get_initial_strip(x, ...)
## S3 method for class 'macroregion'
get_current_strip(x, ...)
## S3 method for class 'macroregion'
get_time(x, ...)
macroregion(name, regions, initial_strip = purrr::map_chr(regions,
"region"))
## S3 method for class 'macroregion'
print(x, ...)
|
x |
an object used to select a method. |
... |
further arguments passed to or from other methods. |
name |
[chr] the name of the macroregion |
regions |
[lst] a list of objects of class |
initial_strip |
[chr] e sequence of |
An object of class macroregion
.
get_centers
: function to access to all the centers in a
macroregion.
get_regions
: wrapper function to access to the detail
"regions".
get_all_region
: wrapper function to access to the all the names
of regions appear in the detail "regions".
get_state
: wrapper function to access to the name of the
state
get_p_accept
: compute the probability that at least one center
in any region of the macroregion accept an offered organ.
get_offered
: wrapper function to access to the detail
"offered".
get_initial_strip
: wrapper function to access to the detail
"initial_strip".
get_current_strip
: wrapper function to access to the detail
"current_strip".
get_time
: wrapper function to access to the detail
"time_period".
print
: nice (and coloured, if supported) print method.
exclude a region
from the base_strip
is the
same as include a region
with zero
get_p_accept
parameter. Anyway, in such a case, it is
always preferred to set get_p_accept
to zero for those
region
(i.e. for all their center
s) and
also exclude them from the strip. Note also that if a region is
included in a macroregion with a zero get_p_accept
parameter
and/or not in the strip, it will provide anyway its surplus organ
with a priority for the macroregion
.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | pavia <- center('Pavia', 'Lombardia', offered = 5, p_accept = 0.6)
bergamo <- center('Bergamo', 'Lombardia', 8)
milano <- center('Milano', 'Lombardia', 10, 0.8)
lombardia <- region(set_centers(pavia, bergamo, milano), default_p = 0.7)
padova <- center('Padova', 'Veneto', 8, 0.7)
veneto <- region(set_centers(padova))
nitp <- macroregion('NITp',
regions = set_regions(lombardia, veneto),
initial_strip = c('lombardia', 'lombardia', 'veneto')
)
get_centers(nitp)
get_regions(nitp)
get_all_region(nitp)
get_state(nitp) # "italy"
pavia <- center('Pavia', 'Lombardia', offered = 5, p_accept = 0.6)
bergamo <- center('Bergamo', 'Lombardia', 8)
milano <- center('Milano', 'Lombardia', 10, 0.8)
lombardia <- region(set_centers(pavia, bergamo, milano), default_p = 0.7)
padova <- center('Padova', 'Veneto', 8, 0.7)
veneto <- region(set_centers(padova))
nitp <- macroregion('NITp',
regions = set_regions(lombardia, veneto),
initial_strip = c('lombardia', 'lombardia', 'veneto')
)
get_p_accept(nitp)
get_offered(nitp)
get_initial_strip(nitp)
get_current_strip(nitp)
get_time(nitp)
pavia <- center('Pavia', 'Lombardia', offered = 5, p_accept = 0.6)
bergamo <- center('Bergamo', 'Lombardia', 8)
milano <- center('Milano', 'Lombardia', 10, 0.8)
lombardia <- region(set_centers(pavia, bergamo, milano), default_p = 0.7)
padova <- center('Padova', 'Veneto', 8, 0.7)
veneto <- region(set_centers(padova))
nitp <- macroregion('NITp',
regions = set_regions(lombardia, veneto),
initial_strip = c('lombardia', 'lombardia', 'veneto')
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.