Created
February 2, 2018 13:43
-
-
Save RedaAffane/d3245bcb6a002f0405f9c243028dc42d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def v_function(A,C_values): | |
''' | |
This function computes the worth of each coalition. | |
inputs: | |
- A : a coalition of channels. | |
- C_values : A dictionnary containing the number of conversions that each subset of channels has yielded. | |
''' | |
subsets_of_A = subsets(A.split(",")) | |
worth_of_A=0 | |
for subset in subsets_of_A: | |
if subset in C_values: | |
worth_of_A += C_values[subset] | |
return worth_of_A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment