Collective identity helps swarms remain coherent in the
presence of others. Building identity into artificial systems
enables groups of agents to work in the same area as one
another, without interference from other agents. By linking
the firefly algorithm to the control logic of the agents, we
present a method to form and maintain identity in swarms. By
measuring swarm polarization, and swarm overlap, we show
that the inclusion of an identity allows a swarm to remain
coherent for an extended period of time, without interference
from other swarms.