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

Improvement concerning the release of resources #89

Open
giffels opened this issue Mar 25, 2021 · 1 comment
Open

Improvement concerning the release of resources #89

giffels opened this issue Mar 25, 2021 · 1 comment

Comments

@giffels
Copy link
Member

giffels commented Mar 25, 2021

It seems to be reasonable to take into account also the age of resources, when releasing them. Currently, only the utilization and supply is used to decide, if a resource well-suited to be released next.

Background to this feature request can be found in MatterMiners/tardis#172.

@maxfischer2781
Copy link
Member

For reference, this is about how the FactoryPool selects the children to reap. Current code:

def _shrink(self, target: float):
# we can only reap children that are not already shutting down
# prefer reaping children that supply few used resources
hit_list = sorted(
self._hatchery, key=lambda child: child.supply * child.utilisation
)

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

No branches or pull requests

2 participants