Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to restrict reconstruction demand to affected regions #67

Open
spjuhel opened this issue Nov 23, 2023 · 0 comments
Open

Be able to restrict reconstruction demand to affected regions #67

spjuhel opened this issue Nov 23, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@spjuhel
Copy link
Owner

spjuhel commented Nov 23, 2023

Is your feature request related to a problem? Please describe.
Reconstruction demand is directed toward all regions by default. It would be interesting to be able to restrict it to the affected region.
It would perhaps make more sense to distribute this demand in the model module rather than the event actually

Describe the solution you'd like
Handle the distribution of reconstruction demand in the model ? Or use a specific function ?

Describe alternatives you've considered
Implement new mechanism in the event module to distribute only to the affected region.
Modifying these lines :

BoARIO/boario/event.py

Lines 1036 to 1049 in ddf764d

industrial_rebuilding_demand = np.zeros(shape=self.z_shape)
tmp = np.zeros(self.z_shape, dtype="float")
mask = np.ix_(
np.union1d(
self._rebuilding_industries_RoW_idx, self._rebuilding_industries_idx
),
self._aff_industries_idx,
)
industrial_rebuilding_demand = np.outer(
self.rebuilding_sectors_shares,
self.regional_sectoral_productive_capital_destroyed,
)
industrial_rebuilding_demand = industrial_rebuilding_demand * rebuilding_factor
tmp[mask] = self.Z_distrib[mask] * industrial_rebuilding_demand[mask]

with something inspired by:

industrial_rebuilding_demand = np.zeros(shape=ev.z_shape)
mask = np.ix_(
            np.union1d(
                ev._rebuilding_industries_RoW_idx, ev._rebuilding_industries_idx
            ),
            ev._aff_industries_idx,
        )
mask = np.ix_(
          ev._rebuilding_industries_idx, ev._aff_industries_idx,
        )
tmp = np.zeros(ev.z_shape, dtype="float")

ev._rebuilding_sectors_shares[
                ev._rebuilding_industries_RoW_idx
            ] = 0
@spjuhel spjuhel added the enhancement New feature or request label Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant