PurposeThe purpose of this paper is to demonstrate a novel use of a generalized Lennard‐Jones (LJ) force law in Physicomimetics, combined with offline evolutionary learning, for the control of swarms of robots moving through obstacle fields towards a goal. The paper then extends the paradigm to demonstrate the utility of a real‐time online adaptive approach named distributed agent evolution with dynamic adaptation to local unexpected scenarios (DAEDALUS).Design/methodology/approachTo achieve the best performance, the parameters of the force law used in the Physicomimetics approach are optimized, using an evolutionary algorithm (EA) (offline learning). A weighted fitness function is utilized consisting of three components: a penalty for collisions, lack of swarm cohesion, and robots not reaching the goal. Each robot of the swarm is then given a slightly mutated copy of the optimized force law rule set found with offline learning and the robots are introduced to a more difficult environment. The online learning framework (DAEDALUS) is used for swarm adaptation in this more difficult environment.FindingsThe novel use of the generalized LJ force law combined with an EA surpasses the prior state‐of‐the‐art in the control of swarms of robots moving through obstacle fields. In addition, the DAEDALUS framework allows the swarms of robots to not only learn and share behavioral rules in changing environments (in real time), but also to learn the proper amount of behavioral exploration that is appropriate.Research limitations/implicationsThere are significant issues that arise with respect to “wall following methods” and “local minimum trap” problems. “Local minimum trap” problems have been observed in this paper, but this issue is not addressed in detail. The intention is to explore other approaches to develop more robust adaptive algorithms for online learning. It is believed that the learning of the proper amount of behavioral exploration can be accelerated.Practical implicationsIn order to provide meaningful comparisons, this paper provides a more complete set of metrics than prior papers in this area. The paper examines the number of collisions between robots and obstacles, the distribution in time of the number of robots that reach the goal, and the connectivity of the formation as it moves.Originality/valueThis paper addresses the difficult task of moving a large number of robots in formation through a large number of obstacles. The important real‐world constraint of “obstructed perception” is modeled. The obstacle density is approximately three times the norm in the literature. The paper shows how concepts from population genetics can be used with swarms of agents to provide fast online adaptive learning in these challenging environments. In addition, this paper also presents a more complete set of metrics of performance.