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

Method addActionFromState

native/model/Graph.cpp:72–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 void Graph::addActionFromState(const StatePtr &node) {
73 auto nodeActions = node->getActions();
74 for (const auto &action: nodeActions) {
75 auto itervisted = this->_visitedActions.find(action);
76 bool visitedadd = itervisted != this->_visitedActions.end();
77 auto iterunvisited = this->_unvisitedActions.find(action);
78 bool unvisitedadd = !visitedadd && iterunvisited != this->_unvisitedActions.end();
79 if (visitedadd || unvisitedadd) {
80 action->setId((visitedadd ? (*itervisted)->getIdi() : (*iterunvisited)->getIdi()));
81 } else {
82 action->setId((int) this->_actionCounter.getTotal());
83 this->_actionCounter.countAction(action);
84 }
85
86 if (!visitedadd && action->isVisited())
87 this->_visitedActions.emplace(action);
88
89 if (!unvisitedadd && !action->isVisited())
90 this->_unvisitedActions.emplace(action);
91 }
92 BDLOG("unvisited action: %zu, visited action %zu", this->_unvisitedActions.size(),
93 this->_visitedActions.size());
94 }
95
96 Graph::~Graph() {
97 this->_states.clear();

Callers

nothing calls this directly

Calls 8

getActionsMethod · 0.80
setIdMethod · 0.80
getIdiMethod · 0.80
getTotalMethod · 0.80
countActionMethod · 0.80
isVisitedMethod · 0.80
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected