Description Usage Arguments Value Methods (by generic) Note Examples
The function macroarea()
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 33 34 35 36 37 38 39 40 41 42 43 44 45 | ## S3 method for class 'macroarea'
get_macroregions(x, ...)
## S3 method for class 'macroarea'
get_regions(x, ...)
## S3 method for class 'macroarea'
get_all_region(x, ...)
## S3 method for class 'macroarea'
get_all_macroregion(x, ...)
## S3 method for class 'macroarea'
get_state(x, ...)
## S3 method for class 'macroarea'
get_centers(x, ...)
## S3 method for class 'macroarea'
get_p_accept(x, ...)
## S3 method for class 'macroarea'
get_offered(x, ...)
## S3 method for class 'macroarea'
get_initial_strip(x, ...)
## S3 method for class 'macroarea'
get_current_strip(x, ...)
## S3 method for class 'macroarea'
get_initial_time(x, ...)
## S3 method for class 'macroarea'
get_time(x, ...)
## S3 method for class 'macroarea'
get_final_time(x, ...)
macroarea(name, macroregions,
initial_strip = get_all_macroregion(macroregions), initial_time = 0L,
final_time = Inf)
## S3 method for class 'macroarea'
print(x, ...)
|
x |
an object used to select a method. |
... |
further arguments passed to or from other methods. |
name |
[chr] the name of the macroarea |
macroregions |
[lst] a list of objects of class |
initial_strip |
[chr] a sequence of |
initial_time |
[int] (default is '0') the time in which the
|
final_time |
[int] (default is 'Inf', i.e. forever) the time in which the macroarea finish to be used |
An object of class macroarea
.
get_macroregions
: wrapper function to access to the 'macroregion'
detail.
get_regions
: wrapper function to access to all the reagions in
macroarea
get_all_region
: wrapper function to access to the all the
names of reagions appear in the 'set_macroregion',
recursively.
get_all_macroregion
: wrapper function to access to the all the names
of macroregions (regions included).
get_state
: wrapper function to access to the name of the
state
get_centers
: wrapper function to access to all the centers of
a macroarea
get_p_accept
: compute the probability that at least one center
in any region of the macroarea 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_initial_time
: wrapper function to access to the detail
"initial_time".
get_time
: wrapper function to access to the detail
"current_time".
get_final_time
: wrapper function to access to the detail
"final_time".
print
: nice (and coloured, if supported) print method.
Even if improbable, a macroarea
can be composed by a
single macroregion
which can be composed by a single
region
which can be composed by a single
center
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | pavia <- center('Pavia', 'Lombardia', offered = 5, p_accept = 0.6)
pavia
bergamo <- center('Bergamo', 'Lombardia', 8)
milano <- center('Milano', 'Lombardia', 10, 0.8)
lombardia <- region(set_centers(pavia, bergamo, milano), default_p = 0.7)
lombardia
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')
)
nitp
torino <- center('Torino', 'Piemonte', 7, 0.6)
piemonte <- region(set_centers(torino))
nord <- macroarea('Macroarea Nord',
macroregions = set_macroregions(piemonte, nitp)
)
get_macroregions(nord)
get_regions(nord)
get_all_region(nord)
get_all_macroregion(nord)
get_state(nord) # "italy"
get_centers(nord)
get_p_accept(nord)
get_offered(nord)
get_initial_strip(nord)
get_current_strip(nord)
get_initial_time(nord)
get_time(nord)
get_final_time(nord)
pavia <- center('Pavia', 'Lombardia', offered = 5, p_accept = 0.6)
pavia
bergamo <- center('Bergamo', 'Lombardia', 8)
milano <- center('Milano', 'Lombardia', 10, 0.8)
lombardia <- region(set_centers(pavia, bergamo, milano), default_p = 0.7)
lombardia
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')
)
nitp
torino <- center('Torino', 'Piemonte', 7, 0.6)
piemonte <- region(set_centers(torino))
nord <- macroarea('Nord',
macroregions = set_macroregions(piemonte, nitp)
)
nord
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.