本文整理汇总了C++中Statistic::updateQML方法的典型用法代码示例。如果您正苦于以下问题:C++ Statistic::updateQML方法的具体用法?C++ Statistic::updateQML怎么用?C++ Statistic::updateQML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statistic
的用法示例。
在下文中一共展示了Statistic::updateQML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tick
void NoGUI::tick()
{
if(!isValid()) {
for(QVariant &variant : m_statistics) {
Statistic *statistic = variant.value<Statistic*>();
statistic->compute(m_geometry, m_timestep);
}
for(QVariant &variant : m_models) {
Statistic *statistic = variant.value<Statistic*>();
statistic->compute(m_geometry, m_timestep);
}
for(QVariant &variant : m_datas) {
Statistic *statistic = variant.value<Statistic*>();
statistic->compute(m_geometry, m_timestep);
}
if(!isValid()) {
qDebug() << "Error, NoGUI or children not ready...";
exit(1);
}
}
if(!m_timer.isValid()) m_timer.start();
if(m_monteCarlo) m_monteCarlo->tick(m_timestep);
if( m_monteCarlo && (m_timestep % m_printEvery) == 0) {
double timeLeft = m_timer.elapsed() / ( double(m_timestep+1)) * (m_timesteps-m_timestep) / 1000.; // seconds
QTextStream logStream(&m_log);
qDebug() << "MC step " << m_timestep << "/" << m_timesteps << ". χ^2: " << QString::number( m_monteCarlo->chiSquared(), 'f', 10 ) << ", T=" << m_monteCarlo->temperature() << " with acceptance ratio " << m_monteCarlo->acceptanceRatio() << " (" << m_monteCarlo->accepted() << " / " << m_monteCarlo->steps() << ") and random walk fraction " << m_geometry->randomWalkFraction() << ". Estimated time left: " << timeLeft << " seconds.";
logStream << "MC step " << m_timestep << "/" << m_timesteps << ". χ^2: " << QString::number( m_monteCarlo->chiSquared(), 'f', 10 ) << ", T=" << m_monteCarlo->temperature() << " with acceptance ratio " << m_monteCarlo->acceptanceRatio() << " (" << m_monteCarlo->accepted() << " / " << m_monteCarlo->steps() << ") and random walk fraction " << m_geometry->randomWalkFraction() << ". Estimated time left: " << timeLeft << " seconds.\n";
if(m_visualize) {
for(QVariant &variant : m_statistics) {
Statistic *statistic = variant.value<Statistic*>();
statistic->compute(m_geometry, m_timestep);
if(m_visualize) {
statistic->updateQML();
}
}
}
}
m_timestep++;
if(m_timestep >= m_timesteps) {
setFinished(true);
}
}
示例2: compute
void NoGUI::compute() {
qDebug() << "Doing compute";
m_timestep++;
for(QVariant &variant : m_models) {
Statistic *statistic = variant.value<Statistic*>();
statistic->compute(m_geometry, m_timestep);
}
for(QVariant &variant : m_datas) {
Statistic *statistic = variant.value<Statistic*>();
statistic->compute(m_geometry, m_timestep);
}
for(QVariant &variant : m_statistics) {
Statistic *statistic = variant.value<Statistic*>();
statistic->compute(m_geometry, m_timestep);
if(m_visualize) {
statistic->updateQML();
}
}
}