📄 think.cc
字号:
#include "humanoidbat.ih"void HumanoidBat::think(){ d_fitness->update(); d_fitness->print(); Behavior::clearActionCommandBehaviors(); _debugLevel3("Running behaviors"); mvds::TimeVal t0 = mvds::TimeVal::getTimeOfDay(); rf<Behavior> win = Behavior::getWin(); if (!win) { _debugLevel1("No win behavior!"); } else { _debugLevel3("Setting goal"); win->update(); win->setGoal(new Behavior::Goal); _debugLevel3("Achieving goal " << win->ident()); if (!(win->achieveGoal())) _debugLevel1("Win behavior was unable to achieve goal!"); else _debugLevel3("Win behavior achieved goal!"); } /* ---------------- Collect action commands and send them to the server ------------*/ //if (wm.shouldSendAction()) //{ _debugLevel3("Send action commands"); _debugLevel1("FootForce: " << WorldModel::getInstance().getForceLeftFoot().length() << ", " << WorldModel::getInstance().getForceRightFoot().length()); Cerebellum& cer = Cerebellum::getInstance(); set<rf<Behavior> > acBehaviors = Behavior::getActionCommandBehaviors(); _debugLevel4("Nr of action behaviors: " << acBehaviors.size()); for (set<rf<Behavior> >::iterator iter = acBehaviors.begin(); iter != acBehaviors.end(); ++iter) { cer.addAction((*iter)->getAction()); } cer.outputCommands(d_comm); //} // Agent::run sends done thinking}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -