Added a way to make a custom strategy.
This commit is contained in:
parent
42e4296b04
commit
4b2ef408d7
1 changed files with 5 additions and 0 deletions
|
@ -184,6 +184,11 @@ class QuorumSystem(Generic[T]):
|
||||||
sigma_w = {frozenset(q): 1 / len(write_quorums) for q in write_quorums}
|
sigma_w = {frozenset(q): 1 / len(write_quorums) for q in write_quorums}
|
||||||
return Strategy(self, sigma_r, sigma_w)
|
return Strategy(self, sigma_r, sigma_w)
|
||||||
|
|
||||||
|
def make_strategy(self,
|
||||||
|
sigma_r: Dict[FrozenSet[T], float],
|
||||||
|
sigma_w: Dict[FrozenSet[T], float]) -> 'Strategy[T]':
|
||||||
|
return Strategy(self, sigma_r=sigma_r, sigma_w=sigma_w)
|
||||||
|
|
||||||
def strategy(self,
|
def strategy(self,
|
||||||
optimize: str = LOAD,
|
optimize: str = LOAD,
|
||||||
load_limit: Optional[float] = None,
|
load_limit: Optional[float] = None,
|
||||||
|
|
Loading…
Reference in a new issue