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

Add support for modelling resource supply and consumption #21

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

nhi-vanye
Copy link
Collaborator

Allow a seed mission to land resources so they can be generated and stored before settlers arrive.

Resources (CommoditySupplier) are supplied (generated) on a Sol basis and stored into CommodityResevoir, consumers (CommodityConsumer) always pull from the store.

Resources are consumed on per-sol and per-settler basis.

Allows resources (aka commodities) i.e. electrcity, water, O2 etc
to be generated, stored and consumed

Allows a seed mission to be landed before settlers to build up resources.

Additional suppliers and consumers can also be landed with each
batch of settlers.

Multiples of each are supported to allow for future failure and
availability issues...

Supply is per-Sol, consumption can be either per-Sol or per-Settler.

No effect if we run out of a commodity (except log lessage).
The initial commit handling resources was too slow as to be unusable,
so change how the resources are updated (fewer triggers) and use transactions.

Also support the use of APSW and its in-memory SQLite database (synced to disk every 28sols)

Also update notebooks to visualize the simulation results - still
a WIP.
@nhi-vanye nhi-vanye merged commit 3bec3c5 into badonhill-io:main Nov 21, 2023
1 check passed
@nhi-vanye nhi-vanye deleted the bhio-2 branch November 21, 2023 14:43
@nhi-vanye nhi-vanye linked an issue Nov 21, 2023 that may be closed by this pull request
@nhi-vanye
Copy link
Collaborator Author

This should probably be kept open to facilitate opening follow-on resources... yes we have completed the initial framework, but there is still work in this area

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

Successfully merging this pull request may close these issues.

Add modelling of physical resources
1 participant