Add channel-limited cellular uptake proposal
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (postgres) (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (client) (push) Canceled after 3m14s
Foundation / checks (checks) (push) Canceled after 3m19s
Foundation / checks (network) (push) Canceled after 1m19s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (postgres) (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (client) (push) Canceled after 3m14s
Foundation / checks (checks) (push) Canceled after 3m19s
Foundation / checks (network) (push) Canceled after 1m19s
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "evo/biology/metabolism.hpp"
|
||||
|
||||
#include <compare>
|
||||
#include <expected>
|
||||
|
||||
namespace evo::biology {
|
||||
struct CellularUptakeProposal {
|
||||
accounting::Inventory patch_after;
|
||||
accounting::Inventory reserve_after;
|
||||
accounting::Inventory acquired;
|
||||
auto operator<=>(const CellularUptakeProposal&) const = default;
|
||||
};
|
||||
enum class CellularUptakeError : std::uint8_t { unsupported_rate_period, overflow };
|
||||
|
||||
// Pure, channel-by-channel uptake proposal for one 50 ms tick from a patch
|
||||
// already confirmed in contact. The caller commits patch and reserve together.
|
||||
[[nodiscard]] std::expected<CellularUptakeProposal, CellularUptakeError>
|
||||
propose_cellular_uptake(accounting::Inventory patch, accounting::Inventory reserve,
|
||||
const MetabolicBudget& budget) noexcept;
|
||||
} // namespace evo::biology
|
||||
Reference in New Issue
Block a user