Created
May 1, 2021 19:10
-
-
Save samueleresca/f1a43ab8acbc43b6f263a1aed2feaccb to your computer and use it in GitHub Desktop.
This file contains 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
""" | |
Original code available at: https://github.com/mwhittaker/quoracle/blob/master/quoracle/quorum_system.py#L498 | |
""" | |
def network() -> pulp.LpAffineExpression: | |
reads = fr * sum( | |
v * len(rq) | |
for (rq, v) in zip(read_quorums, read_quorum_vars) | |
) | |
writes = (1 - fr) * sum( | |
v * len(wq) | |
for (wq, v) in zip(write_quorums, write_quorum_vars) | |
) | |
return reads + writes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment