getcapability.cc
来自「2007年机器人足球世界杯3D仿真组亚军于07年底的源程序。该队还于2008年获」· CC 代码 · 共 43 行
CC
43 行
#include "beam.ih"Behavior::ConfidenceInterval Beam::getCapability(rf<Behavior::State> s, rf<Behavior::Goal> g){ /*_debugLevel4("Beam::getCapability"); rf<StateVarNode> gameStateNode, xNode; gameStateNode = rf_cast<StateVarNode>(s->findDeep("GameState")); if(!gameStateNode) { _debugLevel1("Beam doesn't understand state!"); return ConfidenceInterval(-1.0, 0.0); } StateVar gameState = gameStateNode->getVar(); // If we aren't in BEFORE_KICKOFF, our capability is -1.0 with infinite confidence if ((int)gameState.second.first != WorldModel::BEFORE_KICKOFF) return ConfidenceInterval(-1.0, 0.0); if (!(xNode = rf_cast<StateVarNode>(g->findDeep("X")))) { _debugLevel1("Beam doesn't understand goal!"); return ConfidenceInterval(-1.0, 0.0); } StateVar x = xNode->getVar(); Range xRange = x.second; double xTarget = (xRange.first + xRange.second) / 2.0; // If we want to beam to a position on other side of the field, we can't do it either if (xTarget > 0) return ConfidenceInterval(-1.0, 0.0); // Else we can certainly do it return ConfidenceInterval(1.0, 0.0);*/ return ConfidenceInterval(1.0, 0.0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?