Skip to content

Instantly share code, notes, and snippets.

@RedaAffane
Created February 2, 2018 13:43
Show Gist options
  • Save RedaAffane/d3245bcb6a002f0405f9c243028dc42d to your computer and use it in GitHub Desktop.
Save RedaAffane/d3245bcb6a002f0405f9c243028dc42d to your computer and use it in GitHub Desktop.
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