think.cc
来自「2007年机器人足球世界杯3D仿真组亚军于07年底的源程序。该队还于2008年获」· CC 代码 · 共 58 行
CC
58 行
#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 + =
减小字号Ctrl + -
显示快捷键?