# HG changeset patch # User Benjamin Weber # Date 1666780676 -7200 # Wed Oct 26 12:37:56 2022 +0200 # Node ID 13a76875c332f81650f1d0f304a4eca5bffa284c # Parent 666157f0aeaa15eee98fd190f4f98c14b708b0d0 actually integrate new setReworks mechanism into round mode diff --git a/src/Rework.elm b/src/Rework.elm --- a/src/Rework.elm +++ b/src/Rework.elm @@ -25,11 +25,6 @@ Random.weighted ( p, NeedsRework ) [ ( 100 - p, NoRework ) ] -setReworksSingleMode : ProbPerRound -> List Job -> Random.Generator (List Job) -setReworksSingleMode p = - Random.Extra.traverse (setRework p) - - -- new setRework mechanism to improve perf with increasing no. of jobs on w0 -- aim: constant computing amount for increasing no. of jobs on w0 diff --git a/src/Round.elm b/src/Round.elm --- a/src/Round.elm +++ b/src/Round.elm @@ -39,7 +39,7 @@ field2 = newRoundField r field in - Random.Extra.traverse (setRework p) field2.w0 |> Random.andThen (\x -> Random.constant ({ field2 | w0 = x } |> f r l)) + setReworksFieldWrapper p field2 |> Random.andThen (\x -> Random.constant (x |> f r l)) bothFieldsRound : Round -> ProbPerRound -> Maybe ScrapLimit -> ( Field, Field, Stats ) -> Random.Generator ( Field, Field, Stats )