Searches the local area for a combination of minimizing county splits, compactness, population parity, and keeping close to the original plan

persily(plan, map, counties = NULL)

Arguments

plan

a single plan to optimize from

map

a redist map object

counties

Required

Value

a redist_plans object with one plan

Examples

# \donttest{
data(iowa)
map <- redist_map(iowa, existing_plan = cd_2010, pop_tol = 0.01, total_pop = pop)
plan <- get_plans_matrix(redist_smc(map, 1))[, 2]
#> SEQUENTIAL MONTE CARLO
#> Sampling 1 99-unit maps with 4 districts and population between 753,973 and 769,205.
#> Split [0/3]  | ETA?
#> Split [3/3] ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  | ETA 0s
#> 
local <- persily(plan = plan, map = map, counties = region)
#> FLIP SHORT BURSTS
#> Sampling up to 100 bursts of 50 iterations each.
#> Burst  Improve?  Score
#>     1     🎇     0.478828
#>     2     🥳     0.494949
#>     9     🪅     0.498660
#>    10            0.498660
#>    20            0.498660
#>    30            0.498660
#>    35     🙂     0.508618
#>    37     😎     0.517074
#>    40     🥂     0.520502
#>    42     ⛄     0.541098
#>    44     😀     0.572034
#>    50            0.572034
#>    60            0.572034
#>    70            0.572034
#>    80            0.572034
#>    90            0.572034
#>   100            0.572034
# }