Resource consumption is what is happening when a resource is available and an entity seizing it.
A consumption has two steps, a consume and a free of the resource.
The resource updates a ::sim-de-rc/currently-consuming
list events that are consuming resources
Resource consumption is what is happening when a resource is available and an entity seizing it. A consumption has two steps, a consume and a free of the resource. The resource updates a `::sim-de-rc/currently-consuming` list events that are consuming resources
(consume resource consumed-quantity seizing-event)
Consume consumed-quantity
number of resource
, store this consuming informations in the currently-consuming
attribute of the resource.
Returns a pair with:
consumption-uuid
resource
with currently-consuming
updated with an entry under consumption-uuid
entry with a map consisting in the two following entries:
seizing-event
the event that has triggered a seizing.consumed-quantity
number consumed.Consume `consumed-quantity` number of `resource`, store this consuming informations in the `currently-consuming` attribute of the resource. Returns a pair with: * the `consumption-uuid` * `resource` with `currently-consuming` updated with an entry under `consumption-uuid` entry with a map consisting in the two following entries: * `seizing-event` the event that has triggered a seizing. * `consumed-quantity` number consumed.
(free resource consumption-uuid)
Remove the seizing informations matching consumption-uuid
for that resource.
Returns the updated resource without that consumption
anymore.
Remove the seizing informations matching `consumption-uuid` for that resource. Returns the updated resource without that `consumption` anymore.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close