space_no_threads.cpp
Go to the documentation of this file.
1 
11 #include "space_no_threads.h"
12 #include <argos3/core/simulator/simulator.h>
13 
14 namespace argos {
15 
16  /****************************************/
17  /****************************************/
18 
20  for(size_t i = 0; i < m_vecControllableEntities.size(); ++i) {
21  if(m_vecControllableEntities[i]->IsEnabled())
22  m_vecControllableEntities[i]->Act();
23  }
24  }
25 
26  /****************************************/
27  /****************************************/
28 
30  /* Update the physics engines */
31  for(size_t i = 0; i < m_ptPhysicsEngines->size(); ++i) {
32  (*m_ptPhysicsEngines)[i]->Update();
33  }
34  /* Perform entity transfer from engine to engine, if needed */
35  for(size_t i = 0; i < m_ptPhysicsEngines->size(); ++i) {
36  if((*m_ptPhysicsEngines)[i]->IsEntityTransferNeeded()) {
37  (*m_ptPhysicsEngines)[i]->TransferEntities();
38  }
39  }
40  }
41 
42  /****************************************/
43  /****************************************/
44 
46  for(size_t i = 0; i < m_ptMedia->size(); ++i) {
47  (*m_ptMedia)[i]->Update();
48  }
49  }
50 
51  /****************************************/
52  /****************************************/
53 
55  for(size_t i = 0; i < m_vecControllableEntities.size(); ++i) {
56  if(m_vecControllableEntities[i]->IsEnabled()) {
57  m_vecControllableEntities[i]->Sense();
58  m_vecControllableEntities[i]->ControlStep();
59  }
60  }
61  }
62 
63  /****************************************/
64  /****************************************/
65 
67  const TControllableEntityIterCBType& c_cb) {
68  for (size_t i = 0; i < m_vecControllableEntities.size(); ++i) {
70  } /* for(i..) */
71  } /* IterateOverControllableEntities() */
72 
73  /****************************************/
74  /****************************************/
75 
76 }
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
CControllableEntity::TVector m_vecControllableEntities
A vector of controllable entities.
Definition: space.h:491
CPhysicsEngine::TVector * m_ptPhysicsEngines
A pointer to the list of physics engines.
Definition: space.h:497
CMedium::TVector * m_ptMedia
A pointer to the list of media.
Definition: space.h:500
std::function< void(CControllableEntity *)> TControllableEntityIterCBType
The callback type for iteration over controllable entities within the PreStep() and/or PostStep() par...
Definition: space.h:90
virtual void IterateOverControllableEntities(const TControllableEntityIterCBType &c_cb)
Given a callback specified in the loop functions, iterate over all controllable entities currently pr...
virtual void UpdateControllableEntitiesSenseStep()
virtual void UpdatePhysics()
virtual void UpdateControllableEntitiesAct()