Reference 〉 Class
funcStore

Breeds( Helipad model, str primitive )

A dict-like container class for storing Breed objects.

Because breeds are registered on a per-primitive basis, model.addBreed() can be used instead of Breeds.add(), with the primitive specified in the function signature if more than one primitive is registered.

Initialization Parameters

  • model Helipad, required

    The model object.

  • primitive str, required

    The primitive described by the Breeds object.

Methods

Click a method name for more detailed documentation.

  • add( name, color )

    Registers an agent breed, useful for heterogeneity within agent primitives.

    This function is aliased by the top-level method model.addBreed() for convenience, because Breeds is instantiated in Primitive.breeds rather than the model object.

  • clear( )

    Clears all added data from the container.

  • remove( name, fname, removeall )

    Removes data stored at a certain key.

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

  • primitive str

    The primitive described by the Breeds object.

Notes and Examples

  1. Contribute a Note

    Your email address will not be published.

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