Skip to content

Commit

Permalink
update model1 to use threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
gidden committed Sep 11, 2017
1 parent eaa6062 commit 75108e6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions salamanca/models/project.py
Expand Up @@ -453,10 +453,13 @@ def construct(self, diffusion={}, direction={}, spread={}, threshold=1.0):
)
m = self.model
# Constraints specific to this model
m.cdf_lo = mo.Constraint(rule=threshold_lo_rule,
doc='Population under threshold within 5%')
m.cdf_hi = mo.Constraint(rule=threshold_hi_rule,
doc='Population under threshold within 5%')

m.cdf_lo = mo.Constraint(
rule=lambda m: threshold_lo_rule(m, f=threshold),
doc='Population under threshold within 5%')
m.cdf_hi = mo.Constraint(
rule=lambda m: threshold_hi_rule(m, f=threshold),
doc='Population under threshold within 5%')
# Objective
m.obj = mo.Objective(rule=theil_total_sum_obj, sense=mo.minimize)
return self
Expand Down

0 comments on commit 75108e6

Please sign in to comment.