Reference 〉 Class

Primitives( )

A dict-like container class for creating, storing, and removing Primitive objects, i.e. different types of agents. The instantiated object is stored in model.primitives, where data on primitives can be accessed by name like a dict, but should not be instantiated by user code.


Click a method name for more detailed documentation.

  • add( name, class, plural, … )

    Registers an agent primitive. A primitive, like a breed, is a way of introducing heterogeneity into a model, but there are several differences.

    1. Breeds do not affect the order of stepping. All agents of a primitive are stepped before any agents of another (this order can be changed with the priority argument).
    2. Breed is set as a property of the agent, which can be used with conditional logic in agent hooks. Building a primitive requires building a new agent class, which allows cleaner separation of logic where different types of agents behave in completely different ways.
    3. A use case of breeds would be different types of consumers. A use case of primitives would be consumers versus stores.

  • clear( )

    Clears all added data from the container.

  • remove( name )

    Removes a previously added primitive. See also Primitives.add().

Static Properties

  • multi bool

    Whether the dict values should store a function, or a list of functions. This is a static property and should be changed only by subclassing funcStore.

    Initial value: False

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.