Description Usage Arguments Value Methods (by generic) Examples
The function state()
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 | ## S3 method for class 'state'
get_macroareas(x, ...)
## S3 method for class 'state'
get_macroregions(x, ...)
## S3 method for class 'state'
get_regions(x, ...)
## S3 method for class 'state'
get_all_region(x, ...)
## S3 method for class 'state'
get_state(x, ...)
## S3 method for class 'state'
get_centers(x, ...)
## S3 method for class 'state'
get_p_accept(x, ...)
## S3 method for class 'state'
get_offered(x, ...)
## S3 method for class 'state'
get_initial_strip(x, ...)
## S3 method for class 'state'
get_current_strip(x, ...)
## S3 method for class 'state'
get_time(x, ...)
state(name, macroareas, initial_strip = get_all_macroarea(macroareas))
## S3 method for class 'state'
print(x, ...)
|
x |
an object used to select a method. |
... |
further arguments passed to or from other methods. |
name |
[chr] the name of the state |
macroareas |
[lst] a list of objects of class
|
initial_strip |
[chr] a sequence of |
An object of class state
.
get_macroareas
: wrapper function to access to the 'macroareas' detail.
get_macroregions
: wrapper function to access to all the macroreagions in
a state
get_regions
: wrapper function to access to all the reagions in
state
get_all_region
: wrapper function to access to the all the
names of reagions appear in the 'set_macroregion',
recursively.
get_state
: wrapper function to access to the name of the
state
get_centers
: wrapper function to access to all the centers of
a state
get_p_accept
: compute the probability that at least one center
in any region of the state 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
"current_time".
print
: nice (and coloured, if supported) print method.
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 61 62 63 64 65 66 67 68 69 70 71 72 | 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')
)
torino <- center('Torino', 'Piemonte', 7, 0.6)
piemonte <- region(set_centers(torino))
nord <- macroarea('Macroarea Nord',
macroregions = set_macroregions(piemonte, nitp)
)
roma <- center('Roma', 'Lazio', 10, 0.9)
lazio <- region(set_centers(roma))
sud <- macroarea('Macroarea Sud', macroregions = set_macroregions(lazio))
italy <- state('Italy', set_macroareas(nord, sud))
get_macroareas(italy)
get_macroregions(italy)
get_regions(italy)
get_all_region(italy)
get_state(italy) # "italy"
get_centers(italy)
get_p_accept(italy)
get_offered(italy)
get_initial_strip(italy)
get_current_strip(italy)
get_time(italy)
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
roma <- center('Roma', 'Lazio', 10, 0.9)
lazio <- region(set_centers(roma))
sud <- macroarea('Sud',
macroregions = set_macroregions(lazio)
)
sud
italy <- state('Italy',
macroareas = set_macroareas(nord, sud)
)
italy
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.