-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving assignments #49
Comments
Bump. In the python version I use
|
hi @wesg52 , thanks for the bump! We will work on this asap. Feel free to let me know if you have any feedback on GerryChain meanwhile! (at [email protected]) |
@wesg52 #121 should close this issue as the partition and score will be returned at each step when callilng the iterable version of using GerryChain
SHAPEFILE_PATH = "./PA_VTDs.json"
POPULATION_COL = "TOTPOP"
ASSIGNMENT_COL = "CD_2011"
# Initialize graph and partition
graph = BaseGraph(SHAPEFILE_PATH, POPULATION_COL)
partition = Partition(graph, ASSIGNMENT_COL)
# Define parameters of chain (number of steps and population constraint)
pop_constraint = PopulationConstraint(graph, partition, 0.02)
num_steps = 10000
# Run the chain
for (partition, _) in recom_chain_iter(graph, partition, pop_constraint, num_steps, [DistrictAggregate("presd", "PRES12D"),], progress_bar=false)
for (i, district in enumerate(partition.assignments)
println(district) # the district that node i is assigned to
end
end
flush(stdout) |
A Score to get assignments
The text was updated successfully, but these errors were encountered: