ColonyConfiguration.py 610B

12345678910111213141516171819202122
  1. from synergine.synergy.collection.Configuration import Configuration
  2. from intelligine.synergy.object.ant.Ant import Ant
  3. from synergine.metas import metas
  4. from intelligine.cst import ALIVE
  5. from synergine.synergy.Simulation import Simulation
  6. class ColonyConfiguration(Configuration):
  7. _start_position = (0, 20, 20)
  8. _ant_class = Ant
  9. def get_start_objects(self):
  10. ants = []
  11. for i in range(100):
  12. ant = self._ant_class()
  13. ant.set_position(self._start_position)
  14. metas.list.add(Simulation.STATE, ant.get_id(), ALIVE)
  15. ants.append(ant)
  16. return ants