Problem:
The UK behavioral response toggle in the PolicyEngine app was not working because the API wasn't calling apply_dynamics() when behavioral response parameters were present in reforms. This meant that labor supply adjustments were being ignored, and users weren't seeing the intended behavioral effects of policy changes.
Solution:
Added automatic detection of behavioral response parameters (gov.simulation.labor_supply_responses.income_elasticity and substitution_elasticity) in the API. When these parameters are present in a UK household calculation request, the API now automatically calls simulation.apply_dynamics(year) to enable behavioral adjustments before calculating results.
Problem:
The UK behavioral response toggle in the PolicyEngine app was not working because the API wasn't calling
apply_dynamics()when behavioral response parameters were present in reforms. This meant that labor supply adjustments were being ignored, and users weren't seeing the intended behavioral effects of policy changes.Solution:
Added automatic detection of behavioral response parameters (
gov.simulation.labor_supply_responses.income_elasticityandsubstitution_elasticity) in the API. When these parameters are present in a UK household calculation request, the API now automatically callssimulation.apply_dynamics(year)to enable behavioral adjustments before calculating results.