(gen attrs pop)
Generate a world given attrs
and pop
.
Generate a world given `attrs` and `pop`.
(get-entities world [attr-name value])
Get all entities with the given attribute - value pair
Get all entities with the given attribute - value pair
(get-entity world ref)
Get first entity with the given ref (attribute - value pair; assumed to be unique)
Get first entity with the given ref (attribute - value pair; assumed to be unique)
(lookup-path world entity path)
Recursively lookup a value from path starting from an entity.
Recursively lookup a value from path starting from an entity.
(pick-ref)
Select a random reference to an attribute (from deps) in world
Select a random reference to an attribute (from deps) in world
(pick-unique-ref)
Select a random attribute-value tuple (from deps) that hasn't been used for the current attribute.
Select a random attribute-value tuple (from deps) that hasn't been used for the current attribute.
(pick-unique-refs)
(pick-unique-refs at-least-once)
Select a combination of refs (from deps) that's unique for this attribute
Select a combination of refs (from deps) that's unique for this attribute
(sort-attrs attrs)
Sort attrs
to ensure dependencies are met. Uses Kahn's algorithm, see
also: https://en.wikipedia.org/wiki/Topological_sorting#Kahn's_algorithm
Sort `attrs` to ensure dependencies are met. Uses Kahn's algorithm, see also: https://en.wikipedia.org/wiki/Topological_sorting#Kahn's_algorithm
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close