preference-test-affinities ( seed -- affinities )


Vocabulary
compiler.cfg.register-allocation.validation.color-preferences

Inputs
seedan object


Outputs
affinitiesan object


Definition


:: preference-test-affinities ( seed -- affinities )
4 <iota> [ H{ } clone ] H{ } map>assoc
:> affinities preference-edges [| pair index |
seed 1 index shift bitand 0 > [
{ 1/8 1 8 } index 3 mod swap nth
:> weight pair first2 :> ( a b ) weight a b
affinities at set-at weight b a affinities at set-at
] when
] each-index affinities ;