Liking cljdoc? Tell your friends :D

nl.surf.demo-data.world


*retries*clj

source

*retry-attempt-nr*clj

source

attribute-entity-typeclj

(attribute-entity-type attr-name)

Given an attribute name, return the entity it belongs to.

Given an attribute name, return the entity it belongs to.
sourceraw docstring

genclj

(gen attrs pop)

Generate a world given attrs and pop.

Generate a world given `attrs` and `pop`.
sourceraw docstring

get-entitiesclj

(get-entities world [attr-name :as ref])

Get all entities with the given attribute - value pair (ref)

Get all entities with the given attribute - value pair (ref)
sourceraw docstring

get-entityclj

(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)
sourceraw docstring

get-referring-entitiesclj

(get-referring-entities world attr-name entity)

Get all entities that refer to entity through a ref value for attr-name

Get all entities that refer to `entity` through a ref value for
`attr-name`
sourceraw docstring

lookup-pathclj

(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.
sourceraw docstring

pick-refclj

(pick-ref)
(pick-ref {:keys [graph nilable]})

Select a random reference to an attribute (from deps) in world

(pick-ref options) (pick-ref)

Options is a map of keywords to values

  • :graph :tree

If option :graph is non-nil the refs should be recursive; the attribute should depend on an attribute of the same entity type, and the refs in the generated world will describe a directed graph.

If :graph option is :tree, the graph is an acyclic directed tree; there is a single nil reference in the world which describes the value for the tree's root, and there is only a single path between any two nodes in the graph.

  • :nilable CHANCE

If option :nilable is non-nil, the ref has a CHANCE (between 0 and

  1. of becoming nil.

If option :nilable and :graph :tree are both specified this implies a forest; the refs describe a collection of unconnected trees.

Select a random reference to an attribute (from deps) in world

   (pick-ref options)
   (pick-ref)

Options is a map of keywords to values

* `:graph :tree`

If option :graph is non-nil the refs should be recursive; the
attribute should depend on an attribute of the same entity type, and
the refs in the generated world will describe a directed graph.

If :graph option is :tree, the graph is an acyclic directed tree;
there is a single nil reference in the world which describes the value
for the tree's root, and there is only a single path between any two
nodes in the graph.

* `:nilable CHANCE`

If option :nilable is non-nil, the ref has a CHANCE (between 0 and
1) of becoming nil.

If option :nilable and :graph :tree are both specified this implies a
forest; the refs describe a collection of unconnected trees.
sourceraw docstring

pick-unique-refclj

(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.
sourceraw docstring

pick-unique-refsclj

(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
sourceraw docstring

refers-to?clj

(refers-to? [attr-name value :as ref] entity)

True if ref refers to entity.

True if ref refers to entity.
sourceraw docstring

sort-attrsclj

(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
sourceraw docstring

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

× close