Skip to content

Improve the distribution of scaleLinear - #405

Merged
moodmosaic merged 2 commits into
hedgehogqa:masterfrom
jonfowler:improve-scalelinear
Oct 8, 2020
Merged

moodmosaic merged 2 commits into
hedgehogqa:masterfrom
jonfowler:improve-scalelinear

Conversation

@jonfowler

@jonfowler jonfowler commented Oct 8, 2020 •

Copy link
Copy Markdown
Contributor

scaleLinear currently only allows the largest value to be generated when at the maximum size 99:

> fmap (\sz -> scaleLinea sz 0 4) [0..99] :: [Integer]
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2
,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4]

This improves the distribution so each value is the max for an equal number of sizes:

> fmap (\sz -> scaleLinear sz 0 4) [0..99] :: [Integer]
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2
,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4]

@jonfowler jonfowler changed the title improve the distribution of scaleLinear Improve the distribution of scaleLinear Oct 8, 2020
@moodmosaic
moodmosaic force-pushed the improve-scalelinear branch from b67309e to 9a88f44 Compare October 8, 2020 13:47

@moodmosaic moodmosaic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 💯

@moodmosaic
moodmosaic merged commit 06eb474 into hedgehogqa:master Oct 8, 2020
@moodmosaic

Copy link
Copy Markdown
Member

👍 Thank you, @jonfowler.

@jonfowler
jonfowler deleted the improve-scalelinear branch October 8, 2020 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants