Household Tax Logic
ABMLP-X Household taxation behavioural logic: April 2024.
Flat Rate Taxation
flat-rate-tax.py
# Utility: Catch divide by zero error.
def zero_division(n, d):
return n / d if d else 0
def flat_tax_to_pay(self, amount, rate):
""" Flat rate tax to pay (wage and interest income). """
tax_to_pay = Decimal(0)
tax_to_pay = amount * zero_division(rate, 100)
return tax_to_pay
Marginal Rate Taxation
marginal-rate-tax.py
def marginal_tax_to_pay(self, amount):
""" Marginal rate tax to pay (wage only).
Tax Bracket 0:
No tax on any wage upto the first 50% of the historic average wage amount.
Tax Bracket 1:
Pay 60% tax on any remaining wage amount that is between 50% and 100%
of the historic average wage amount.
Tax Bracket 2:
Pay 70% tax on any remaining wage amount that exceeds 100% of the
historic average wage amount.
"""
marginal_tax_to_pay = Decimal(0)
bracket_one_amount = Decimal(0)
bracket_two_amount = Decimal(0)
if amount <= Household.average_wage:
bracket_one_amount = amount - (Household.average_wage * Decimal(0.5))
else:
bracket_one_amount = Household.average_wage * Decimal(0.5)
bracket_two_amount = amount - Household.average_wage
if amount > 0:
marginal_tax_to_pay = ((bracket_one_amount * Decimal(0.6))
+ (bracket_two_amount * Decimal(0.7)))
return marginal_tax_to_pay
Taxation Strategy
tax-strat.py
def tax_strategy(self, start_tax_amount):
""" Tax paid in the current step.
start_tax_amount:
An amount received from either,
flat_tax_to_pay() or marginal_tax_to_pay().
To research and develop..
"""
def alpha_strat():
# 1 == Pay 100% of the 'start_tax_amount'.
payment_percentage = Decimal(1)
return payment_percentage
def beta_strat():
# 1 == Pay 100% of the 'start_tax_amount'.
payment_percentage = Decimal(1)
return payment_percentage
def gamma_strat():
# 1 == Pay 100% of the 'start_tax_amount'.
payment_percentage = Decimal(1)
return payment_percentage
# See Producer employment by type.
strategy_by_household_type = {"alpha": alpha_strat,
"beta": beta_strat,
"gamma": gamma_strat}
end_tax_amount = Decimal(0)
strat_tax_percentage = strategy_by_household_type.get(self.type, lambda: 'Invalid')()
end_tax_amount = start_tax_amount * Decimal(strat_tax_percentage)
return end_tax_amount