Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Andrew Friedman
/
Fairly Draw Election Districts
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f8bbd753
authored
Mar 14, 2017
by
Anne Rogers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try
parent
9f3065af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
algorithms/algorithms_new.py
algorithms/algorithms_new.py
View file @
f8bbd753
...
...
@@ -871,7 +871,7 @@ def make_gap_lower(districts_dict, all_tracts, num_districts, used_tracts,
'''
Use the efficiency gap to construct an optimal district plan using
the entire population. It looks through districts randomly to find
a district under "goal" or stops if has looked at districts
1
000 times.
a district under "goal" or stops if has looked at districts
70
000 times.
Inputs:
districts_dict: a dictionary of dictionaries containing a tract plans in the state
...
...
@@ -890,7 +890,7 @@ def make_gap_lower(districts_dict, all_tracts, num_districts, used_tracts,
gap
=
calculate_efficiency_gap_from_dict
(
districts_dict
)
goal_percent
=
goal
/
100
print
(
goal_percent
,
gap
)
while
abs
(
gap
)
>
goal_percent
and
(
count
-
1
0000
):
while
abs
(
gap
)
>
goal_percent
and
(
count
-
7
0000
):
count
+=
1
new
=
False
check_pop
=
random
.
choice
(
range
(
1
,
num_districts
+
1
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment