예제 #1
0
void Parallaction::runGameFrame(int event) {
	if (_input->_inputMode != Input::kInputModeGame) {
		return;
	}

	if (!processGameEvent(event)) {
		return;
	}

	_gfx->beginFrame();

	runPendingZones();

	if (shouldQuit())
		return;

	if (_engineFlags & kEngineChangeLocation) {
		changeLocation();
	}

	_programExec->runScripts(_location._programs.begin(), _location._programs.end());
	_char._ani->resetZ();
	updateWalkers();
	updateZones();
}
예제 #2
0
  bool VMCParticleByParticle::run() { 


    Estimators->reportHeader(AppendRun);
    Estimators->reset();

    IndexType block = 0;
    
    m_oneover2tau = 0.5/Tau;
    m_sqrttau = sqrt(Tau);

    G.resize(W.getTotalNum());
    dG.resize(W.getTotalNum());
    L.resize(W.getTotalNum());
    dL.resize(W.getTotalNum());
    
    nAcceptTot = 0;
    nRejectTot = 0;

    do {
      IndexType step = 0;
      nAccept = 0; nReject=0;
      nAllRejected = 0;

      Estimators->startBlock();

      do {
        advanceWalkerByWalker();
        ++step;++CurrentStep;
        Estimators->accumulate(W);
        if(CurrentStep%100 == 0) updateWalkers();
      } while(step<nSteps);
      
      Estimators->stopBlock(static_cast<RealType>(nAccept)/static_cast<RealType>(nAccept+nReject));

      nAcceptTot += nAccept;
      nRejectTot += nReject;
      
      branchEngine->accumulate(Estimators->average(0),1.0);
      
      nAccept = 0; nReject = 0;
      ++block;

      //record the current configuration
      recordBlock(block);

    } while(block<nBlocks);

    //Need MPI-IO
    app_log() << "Ratio = " 
      << static_cast<RealType>(nAcceptTot)/static_cast<RealType>(nAcceptTot+nRejectTot)
      << endl;
    
    //finalize a qmc section
    return finalize(block);
  }