Liking cljdoc? Tell your friends :D

automaton-simulation-de.rc.impl.state

Store and update resource consumer informations in the ::sim-rc/resource key of the state. Assuming state is associative.

Store and update resource consumer informations in the `::sim-rc/resource` key of the state.
Assuming state is associative.
raw docstring

define-resourcesclj/s

(define-resources state
                  defined-resources
                  unblocking-policy-registry
                  preemption-policy-registry)

Returns the state with the resources added in it, and values defaulted.

Returns the state with the resources added in it, and values defaulted.
raw docstring

disposeclj/s

(dispose state resource-name consumption-uuid)

Returns a pair:

  • the unblockings event.
  • the state, with the resource resource-name consumption of seizing-event is disposed.
Returns a pair:
* the `unblockings` event.
* the `state`, with the resource `resource-name` consumption of `seizing-event` is disposed.
raw docstring

failureclj/s

(failure state _resource-name _seizing-event)

Updates the state with the resource-name failing.

Updates the `state` with the resource-name failing.
raw docstring

resourceclj/s

(resource state resource-name)

Returns the resource called resource-name, nil if does not exist. The resource-name should be called as described in the resources map of the middleware

Returns the resource called `resource-name`, nil if does not exist.
The `resource-name` should be called as described in the `resources` map of the middleware
raw docstring

seizeclj/s

(seize state resource-name consumed-quantity consuming-event)

Seize the resource called resource-name and update the state accordingly. consuming-event event that should be executed only when the consumed-quantity of resource-name was available for that event.

Returns a pair:

  • consumption-uuid if the seizing found available resources.
  • the state, with the resource resource-name seizing consumed-quantity before the execution of the posponed-event.
Seize the resource called `resource-name` and update the `state` accordingly.
`consuming-event` event that should be executed only when the `consumed-quantity` of `resource-name` was available for that event.

Returns a pair:
* `consumption-uuid` if the seizing found available resources.
* the state, with the resource `resource-name` seizing `consumed-quantity` before the execution of the `posponed-event`.
raw docstring

update-resource-capacityclj/s

(update-resource-capacity state resource-name new-capacity)

Returns a pair of:

  • unblocked-events
  • state where the resource called resource-name is set to its new capacity new-capacity.
Returns a pair of:
* `unblocked-events`
* `state` where the resource called `resource-name` is set to its new capacity `new-capacity`.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close