Reference 〉 Function

Breeds.add( str name, str 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.

Parameters

  • name str, required

    The name of the breed.

  • color str, required

    The color that ought to represent the breed in the control panel and visualizations. Can take a hex string, a color name string (see the Matplotlib documentation for valid values), an RGB tuple with ranges from 0.0 to 1.0, or a Color object.

Return Value Breed

The newly created Breed 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.