Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Add UBI Component #19

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Add UBI Component #19

wants to merge 8 commits into from

Conversation

sarahlc888
Copy link

I created a UBI component and a SimpleRevenue component for use alongside it.

The UBI component distributes a payment amount (set by the planner agent) to each mobile agent every n timesteps, subtracting the sum of all payments from the planner's coin endowment. (Actions are masked when the UBI amount is chosen at the start of each cycle such that the planner can only set payment amounts that its coin endowment can cover.)

The SimpleRevenue component is a modified version of PeriodicBracketTax that adds tax revenue to the planner's coin endowment rather than doing lumpsum redistribution, which is used to provide funds for the UBI component.

Please, let me know if the code looks good and what additions/changes you would suggest. Thank you for your help!

Create a UBI component that distributions a constant amount of coin
to each mobile agent every period, drawing from the planner agent's
coin endowment (which currently can run into the negatives).
Allow the planner agent to determine the UBI payment amount.

In more detail:
Convert UBI to have discretized amounts that the planner can choose from, define get_n_actions() to allow the planner’s actions to determine UBI payment amount, and define set_new_period_amt_model() to update the UBI payment amount each period.
Allow the planner and mobile agents to see the position in the UBI cycle
as well as the UBI amount and previous UBI amount.

Track the UBI payment amount of the previous step to use in observations.

Also add additional reset steps (for correctness).
Restrict planner actions so that the agent can only act/modify UBI
on the appropriate day of the cycle.

Also add logging that shows the size of UBI payments used at each
time step.
Create a version of PeriodicBracketTax that does not do lumpsum
redistribution and instead adds revenue to the planner agent's
coin endowment.
Fix bugs after testing UBI and SimpleRevenue components. Both appear
to run and seem in working order.
Require planner to choose a UBI payment amount that its current
coin endowment can pay out without becoming negative.

Also edit the NO-OP operation so that it sets UBI to 0.
(Otherwise, maintaining a UBI rate may drive planner coin
into the negatives.) This may change though.
Reformatted using format_and_lint.sh.
@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @sarahlc888 to sign the Salesforce.com Contributor License Agreement.



@component_registry.add
class SimpleRevenue(BaseComponent):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sarahlc888 -- SimpleRevenue seems to still be a copy of the old tax component? Are you still working on this, or is this no longer needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the same as the existing component but adds tax revenue to the planner coin endowment rather than redistributing it. (See line 389 for example.) I realize that the code is very redundant—is there an alternative approach you had in mind? I was not sure how to go about this.

self.amt_min, self.amt_max + self.amt_disc, self.amt_disc
)
self.disc_amts = self.disc_amts[self.disc_amts <= self.amt_max]
assert len(self.disc_amts) > 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs amt_min < amt_max and amt_max - amt_min >= amt_disc ... could be more transparent to check for that instead?

# When NO-OP, set UBI as 0 (cannot do nothing because agent may
# not be able to afford the same UBI rate as last time)
if planner_action == 0:
self.curr_amt_index = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amt_index = 0 sets the UBI amount to amt_min, not 0?

else:
raise ValueError

def pay_ubi(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should check whether the planner has enough money in its inventory to pay for the UBI, so check that the planner's Coin doesn't go below 0.

@StephanZheng
Copy link
Contributor

StephanZheng commented Mar 11, 2021 via email

@sarahlc888
Copy link
Author

Could you elaborate? Sorry, I was not sure how to use the taxation functionality of PeriodicBracketTax without using the redistribution functionality as well, since it's all in the enact_taxes() method. Unless it's alright to expand on that class itself and create a parameter for a new "mode"?

@StephanZheng
Copy link
Contributor

Yes, we could have the redistribution be optional. @alextrott16?

I would make SimpleRevenue -- which would just add Coin to the planner's inventory -- a separate component.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants