Skip to content

Commit

Permalink
Merge branch 'update/pass-defender' of github.com:RoboTeamTwente/robo…
Browse files Browse the repository at this point in the history
…team into update/pass-defender
  • Loading branch information
Luuk committed Nov 1, 2023
2 parents 582d138 + 5c0e44d commit 0a959fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions roboteam_ai/src/stp/computations/PositionComputations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ void PositionComputations::calculateInfoForDefenders(std::unordered_map<std::str
enemies.emplace_back(enemyMap.begin()->second);
enemyMap.erase(enemyMap.begin());
}
for (int i = 0; i < activeDefenderNames.size(); i++) {
for (int j = 0; j < row_length; j++) {
cost_matrix[i][j] = stpInfos[activeDefenderNames[i]].getRobot()->get()->getPos().dist(enemies[j]);
}
}
// Calculate the optimal assignment of enemies to pass_defenders using the hungarian algorithm and set the position to defend for each
// active pass defender
std::vector<int> assignments;
Expand Down

0 comments on commit 0a959fa

Please sign in to comment.