MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / countActionPriority

Method countActionPriority

native/desc/State.cpp:187–203  ·  view source on GitHub ↗

for algorithm

Source from the content-addressed store, hash-verified

185
186 // for algorithm
187 int State::countActionPriority(const ActionFilterPtr &filter, bool includeBack) const {
188 int totalP = 0;
189 for (const auto &action: this->_actions) {
190 if (!includeBack && action->isBack()) {
191 continue;
192 }
193 if (filter->include(action)) {
194 int fp = filter->getPriority(action);
195 if (fp <= 0) {
196 BDLOG("Error: Action should has a positive priority, but we get %d", fp);
197 return -1;
198 }
199 totalP += fp;
200 }
201 }
202 return totalP;
203 }
204
205 ActivityStateActionPtrVec State::targetActions() const {
206 ActivityStateActionPtrVec retV;

Callers 1

randomPickActionMethod · 0.95

Calls 3

isBackMethod · 0.80
includeMethod · 0.45
getPriorityMethod · 0.45

Tested by

no test coverage detected