Class: ABM.Agents

Defined in: src/agents.coffee
Inherits: ABM.BreedSet

Overview

Agents is a subclass of BreedSet which creates and stores instances of Agent.

Variables Summary

Variable inherited from ABM.BreedSet

_push

Instance Method Summary

Inherited Method Summary

Methods inherited from ABM.BreedSet

#create #push #remove #pop #reBreed .from #setDefault #exclude #draw #show #hide #inRadius #inCone #toFixed #any #empty #clear #clone #first #last #select #reject #sample #contains #removeItem #shuffle #min #max #sum #average #median #histogram #sort #uniq #flatten #concat #normalize #normalizeInt #ask #with #getProperty #setProperty #other

Constructor Details

# (void) constructor()

Creates the empty Set instance and installs the agentClass (breed) variable shared by all the Agents in this set.

Instance Method Details

# (void) setUseSprites(useSprites = true)

Use sprites rather than drawing.

# (void) in(agents)

Filter to return all instances of this breed. Note: if used by the mainSet, returns just the agents that are not subclassed breeds.

# (void) create(num, initialize = function() {})

Factory: create num new agents stored in this agentset. The optional init proc is called on the new agent after inserting in its agentSet.

# (void) clear()

Remove all agents from set via agent.die()

# (void) neighboring(agent, rangeOptions)

Return the members of this agentset that are neighbors of agent using patch topology.

# (void) formCircle(radius, startAngle = (Math.PI / 2), direction = -1)

Circle Layout: position the agents in the list in an equally spaced circle of the given radius, with the initial agent at the given start angle (default to pi / 2 or "up") and in the +1 or -1 direction (counder clockwise or clockwise) defaulting to -1 (clockwise).

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: