-
- if (C_shared_[cur_resource]) {
- /* shared resource: fairly share it between players */
- A_p.row(row) = A_.row(cur_resource);
- C_p[row] = get_resource_capacity(cur_resource, bounded_players);
- row++;
- if (e.second.size() > 1) {
- // if 2 players have chosen the same resource
- // they must have a fair sharing of this resource, adjust A_p and C_p accordingly
- auto it = e.second.begin();
- int i = *it; // first player
- /* for each other player sharing this resource */
- for (++it; it != e.second.end(); ++it) {
- /* player i and k on this resource j: so maxA_ji*rho_i - maxA_jk*rho_k = 0 */
- int k = *it;
- C_p[row] = 0;
- A_p(row, i) = maxA_(cur_resource, i);
- A_p(row, k) = -maxA_(cur_resource, k);
- row++;
- }
- }
- } else {
- /* not shared resource, each player can receive the full capacity of the resource */
+ /* not shared resource, each player can receive the full capacity of the resource */
+ if (not C_shared_[cur_resource]) {