Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.26 KB

reference_sequences.rst

File metadata and controls

48 lines (36 loc) · 1.26 KB

agentpy

Sequences

This module offers various data structures to create and manage groups of both agents and environments. Which structure best to use depends on the specific requirements of each model.

  • AgentList is a list of agentpy objects with methods to select and manipulate its entries.
  • AgentDList is an ordered collection of agentpy objects, optimized for removing and looking up objects.
  • AgentSet is an unordered collection of agents that can access agent attributes.
  • AgentIter and AgentDListIter are a list-like iterators over a selection of agentpy objects.
  • AttrIter is a list-like iterator over the attributes of each agent in a selection of agentpy objects.

All of these sequence classes can access and manipulate the methods and variables of their objects as an attribute of the container. For examples, see AgentList.

Containers

AgentList

AgentDList

AgentSet

Iterators

AgentIter

AgentDListIter

AttrIter