'Return an array of payoff values, one for each own action, given
a profile of the opponents\' actions.
Parameters
opponents_actions : see `best_response`.
Returns
payoff_vector : ndarray(float, ndim=1)
An array representing the player\'s payoff vector given the
profile of the opponents\' actions.'

def payoff_vector(self, opponents_actions):

    def reduce_last_player(payoff_array, action):
        "\n                                                Given    `payoff_array`    with    ndim=M,    return    the    payoff    array\n                                                with    ndim=M-1    fixing    the    last    player's    action    to    be    `action`.\n\n                                                "
        if isinstance(action, numbers.Integral):
            return payoff_array.take(action, axis=(-1))
        else:
            return payoff_array.dot(action)
    if (self.num_opponents == 1):
        payoff_vector = reduce_last_player(self.payoff_array, opponents_actions)
    elif (self.num_opponents >= 2):
        payoff_vector = self.payoff_array
        for i in reversed(range(self.num_opponents)):
            payoff_vector = reduce_last_player(payoff_vector, opponents_actions[i])
    else:
        payoff_vector = self.payoff_array
    return payoff_vector
