diff --git a/game.py b/game.py index 2ec48902a76008775d8c68d5b738e849b71d883f..77cc3c596fd835d0e27acad5a28a36b048a6477c 100644 --- a/game.py +++ b/game.py @@ -9,4 +9,30 @@ import utilis class game(): def __init__(self): datamap = utilis.read() - self.N = datamap['N'] \ No newline at end of file + self.N = datamap['N'] # N-Player Game + self.M = datamap['M'] # Randomly choose M players to play the game (normally 2) + self.RF = datamap['RF'] # Parsed number of risk function chosen for the game + self.alpha = datamap['alpha'] # Loss fraction + self.R = datamap['R'] # Rounds of a game + + + self.threshold = 0 # Threshold + + + def lossfrac(self, alpha): + + """the percentage of wealth that players are going to lose if collective-risk happens""" + + for risk in range(0,1): + return risk + + + def riskfunc(self,RF,contribution,anything): + + """the probability of collective-risk happening, given contribution""" + + if RF == 1: + return # probably parse more parameters here + elif RF == 2: + return 1 + return 0