Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def amopt_brute(eAp, eAn, eBp, eBn):
- AMstrats = list()
- uAMs = list()
- BRs = list()
- uMs = list()
- ##### needs 4 for loop #################, 0.05 increment
- for sA1 in np.arange(0, 1.05, 0.05):
- for sB1 in np.arange(0, 1.05 - sA1, 0.05):
- if not sA1 + sB1 <= 1:
- continue
- for sA2 in np.arange(0, 1.05, 0.05):
- for sB2 in np.arange(0, 1.05 - sA2, 0.05):
- if not sA2 + sB2 <= 1:
- continue
- AMstrats.append((sA1, sB1, sA2, sB2))
- ((pA,pB), uM) = bestresponse_brute(eAp, eAn, eBp, eBn, sA1, sB1, sA2, sB2)
- uAM = compute_uAM(eAp, eBp, sA1, sB1, sA2, sB2, pA, pB)
- uAMs.append(uAM)
- BRs.append((pA,pB))
- uMs.append(uM)
- maxids = list(np.where(np.array(uAMs).flatten() == max(uAMs))[0])
- return (AMstrats[maxids[0]], uAMs[maxids[0]], BRs[maxids[0]], uMs[maxids[0]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement