Reference 〉 Class

Primitive()

list-like object storing agents of a primitive, along with data defining the primitive. Do not instantiate directly; instead, use Agents.addPrimitive() (and see that page for details on primitives). Most of the properties of the Primitive object correspond to arguments of that function.

Agents can be retrieved by breed using a str index, i.e. model.agents['agent']['female'] will return all agent-primitive agents with female breed. int indices will return individual agents as from a list.

Object Properties

  • class_ Class

    The class used to instantiate the primitive object. Should subclass baseAgent.

  • plural str

    Stores the plural name of the primitive. Generated by appending 's' to the name unless otherwise specified in Agents.addPrimitive().

  • priority int

    The execution order of the primitive in relation to the others during the model step. Lower numbers step first.

  • order str|list[str]

    The order in which the agents within the primitive should be stepped, if different from the global agent ordering specified in model.order. Can take the same values, namely 'linear', ''random', 'match', and 'match-n', or a list of strings corresponding to the stages of the model.

  • breeds Breeds{str:Breed}

    The Breeds container, an interface for adding, storing, and removing Breed objects.

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.

History