void CSpaceMultiThreadBalanceLength::UpdateControllableEntities() {
    /* Reset the idle thread count */
    m_unSenseControlPhaseIdleCounter = CSimulator::GetInstance().GetNumThreads();
    m_unActPhaseIdleCounter = CSimulator::GetInstance().GetNumThreads();
    m_unPhysicsPhaseIdleCounter = CSimulator::GetInstance().GetNumThreads();
    /* Sense/control phase */
    MAIN_START_PHASE(SenseControl);
    MAIN_WAIT_FOR_END_OF(SenseControl);
    /* Act phase */
    MAIN_START_PHASE(Act);
    MAIN_WAIT_FOR_END_OF(Act);
 }
 void CSpaceMultiThreadBalanceLength::UpdatePhysics() {
    /* Physics phase */
    MAIN_START_PHASE(Physics);
    MAIN_WAIT_FOR_END_OF(Physics);
    /* Perform entity transfer from engine to engine, if needed */
    for(size_t i = 0; i < m_ptPhysicsEngines->size(); ++i) {
       if((*m_ptPhysicsEngines)[i]->IsEntityTransferNeeded()) {
          (*m_ptPhysicsEngines)[i]->TransferEntities();
       }
    }
 }
 void CSpaceMultiThreadBalanceLength::UpdateControllableEntitiesSenseStep() {
    /* Sense/control phase */
    MAIN_START_PHASE(SenseControl);
    MAIN_WAIT_FOR_END_OF(SenseControl);
 }
 void CSpaceMultiThreadBalanceLength::UpdateMedia() {
    /* Media phase */
    MAIN_START_PHASE(Media);
    MAIN_WAIT_FOR_END_OF(Media);
 }
 void CSpaceMultiThreadBalanceLength::UpdateControllableEntitiesAct() {
    /* Act phase */
    MAIN_START_PHASE(Act);
    MAIN_WAIT_FOR_END_OF(Act);
 }