Skip to content

Commit 7fa931f

Browse files
committed
fix: use the correct stretch parameter name
1 parent a263618 commit 7fa931f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

school_center.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,15 @@ def allocate_to_centers(centers: List[Dict[str, str]], school: Dict[str, str], t
221221

222222
# per_center = math.ceil(to_allot / min(calc_num_centers(to_allot), len(centers_for_school)))
223223
to_allot, allocated_centers = allocate_to_centers(centers_for_school, s, to_allot, centers_remaining_cap)
224+
225+
if int(s['scode']) == 27159:
226+
logger.info('FOR 27159:::::::')
227+
logger.info(to_allot)
228+
logger.info(allocated_centers)
224229

225230
if to_allot > 0: # try again with relaxed constraints and more capacity at centers
226231
expanded_centers = centers_within_distance(s, centers, ABS_DISTANCE_THRESHOLD)
227-
to_allot, allocated_centers = allocate_to_centers(expanded_centers, s, to_allot, centers_remaining_cap, stretch_capacity=True)
232+
to_allot, allocated_centers = allocate_to_centers(expanded_centers, s, to_allot, centers_remaining_cap, stretch=True)
228233

229234
for c in allocated_centers.values():
230235
allocation_file.writerow([s['scode'], s['name-address'], c['cscode'], c['name'], c['address'], allocations[s['scode']][c['cscode']], c['distance_km']])

0 commit comments

Comments
 (0)