On this page

# AgentList

Geometry methods for patches, turtles, and other AgentArrays Return all agents within rect, radius, cone from given agent. If meToo, include given object, default excludes it Typically the AgentArray is a subset of larger sets, reducing the size, then uses these inRect, inRadius or inCone methods

## Constructor

### new AgentList(model, …args)

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`model` | Model |  | The Model this AgentList belongs to
`args` | any | <repeatable> | The arguments passed to super

Source
  - AgentList.js, line 12

## Methods

### inCone(agent, radius, coneAngle, heading, meToo)

As above, but also limited to the angle `coneAngle` around an `angle` from object `agent`. coneAngle and direction in radians.

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`agent` | Agent |  |
`radius` | number |  |
`coneAngle` | number |  |
`heading` | number |  |
`meToo` | boolean | false |

Source
  - AgentList.js, line 80

Returns:

An AgentList of agents within the angle. Include agent if metoo

### inRadius(agent, radius, meToo)

Return all agents in AgentArray within radius from given agent.

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`agent` | Agent |  |
`radius` | number |  |
`meToo` | boolean | false |

Source
  - AgentList.js, line 56

Returns:

An AgentList of agents within the radius. Include agent if metoo

### inRect(agent, dx, dy, meToo)

Return all agents within rectangle from given agent. dx & dy are (float) half width/height of rect

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`agent` | Agent |  |
`dx` | number |  |
`dy` | number |  |
`meToo` | boolean | false |

Source
  - AgentList.js, line 34

Returns:

An AgentList of agents within the rect. Include agent if metoo

Type anything to view search result