Costbenefit Module¶
-
class
powergama.costbenefit.
CostBenefit
¶ Experimental class for cost-benefit calculations.
Currently including allocation schemes based on “cooperative game theory”
Methods
gameIsMonotone
(values)Returns true if the game/valueFunction is monotonic. gameIsSuperadditive
(values)Returns true if the game/valueFunction is superadditive. gamePayoffHasNullplayer
(player_list, values, …)Return true if the payoff vector possesses the nullplayer property. gamePayoffIsEfficient
(player_list, values, …)Return `true if the payoff vector is efficient.A payoff vector v is efficient if the sum of payments equal the total value provided by a set of players.sum_{i=1}^N lambda_i = v(Omega);. gamePayoffIsSymmetric
(values, payoff_vector)Returns true if the resulting payoff vector possesses the symmetry property. gameShapleyValue
(player_list, values)compute the Shapley Value from cooperative game theory getBinaryCombinations
(num)Returns a sequence of different combinations 1/0 for a number of decision variables. nCr
(n, r)calculate the binomial coefficient, i.e. power_set
(List)function to return the powerset of a list, i.e. gameSetup -
gameIsMonotone
(values)¶ Returns true if the game/valueFunction is monotonic. A game G = (N, v) is monotonic if it satisfies the value function of a subset is less or equal then the value function from its union set: v(C_2) geq v(C_1) for all C_1 subseteq C_2
-
gameIsSuperadditive
(values)¶ Returns true if the game/valueFunction is superadditive. A characteristic function game G = (N, v) is superadditive if it the sum of two coalitions/subsets gives a larger value than the individual sum: v(C_1 cup C_2) geq v(C_1) + v(C_2) for all C_1, C_2 subseteq 2^{Omega} such that C_1 cap C_2 = emptyset.
-
gamePayoffHasNullplayer
(player_list, values, payoff_vector)¶ Return true if the payoff vector possesses the nullplayer property. A payoff vector v has the nullplayer property if there exists an i such that v(C cup i) = v(C) for all C in 2^{Omega} then, lambda_i = 0. In other words: if a player does not contribute to any coalition then that player should receive no payoff.
-
gamePayoffIsEfficient
(player_list, values, payoff_vector)¶ Return `true if the payoff vector is efficient. A payoff vector v is efficient if the sum of payments equal the total value provided by a set of players. sum_{i=1}^N lambda_i = v(Omega);
-
gamePayoffIsSymmetric
(values, payoff_vector)¶ Returns true if the resulting payoff vector possesses the symmetry property. A payoff vector possesses the symmetry property if players with equal marginal contribution receives the same payoff: v(C cup i) = v(C cup j) for all C in 2^{Omega} setminus {i,j}, then x_i = x_j.
-
gameSetup
(grid_data)¶
-
gameShapleyValue
(player_list, values)¶ compute the Shapley Value from cooperative game theory
-
getBinaryCombinations
(num)¶ Returns a sequence of different combinations 1/0 for a number of decision variables. E.g. three cable investments; (0,0,0), (1,0,0), (0,1,0), and so on.
-
nCr
(n, r)¶ calculate the binomial coefficient, i.e. how many different possible subsets can be made from the larger set n
-
power_set
(List)¶ function to return the powerset of a list, i.e. all possible subsets ranging from length of one, to the length of the larger list
-