Exemple #1
0
void GameOfLife::run()
{

  int **fp, **fr;
  while ( true )
    {
      QThread::msleep ( m_delay );

      if ( !paused )
        {

          ++m_time;

          qDebug() << "<<<" << m_time << "<<<";

          development();

          if ( samuBrain )
            {
              samuBrain->learning ( lattices[latticeIndex], center_of_tape, 10, predictions, &fp, &fr );
              qDebug() << m_time
                       << "   #MPUs:" << samuBrain->nofMPUs()
                       << "Observation (MPU):" << samuBrain->get_foobar().c_str();
            }
            
          //latticeIndex = ( latticeIndex+1 ) %2;
          emit cellsChanged ( lattices[latticeIndex], predictions, fp, fr );

          qDebug() << ">>>" << m_time << ">>>";

        }
    }

}
Exemple #2
0
void GameOfLife::run()
{
  while ( true )
    {
      QThread::msleep ( m_delay );

      if ( !paused )
        {
          ++m_time;
          development();
          learning();
          latticeIndex = ( latticeIndex+1 ) %2;
          emit cellsChanged ( lattices[latticeIndex], predictions );
        }
    }

}
void GameOfLife::run()
{
  while ( true )
    {
      QThread::msleep ( m_delay );

      if ( !paused )
        {
          ++m_time;
          development();
          learning();
          latticeIndex = ( latticeIndex+1 ) %2;
          emit cellsChanged ( lattices[latticeIndex], predictions );
          ++m_frame_num;
          {
            QMutexLocker lck(m_mutex);
            if(m_stopped)
              break;
          }
        }
    }
}