@@ -254,7 +254,7 @@ export class MultiCA1D implements IClear {
254
254
const fn =
255
255
target === "prob" ? ( ) => rnd . float ( ) : ( ) => rnd . int ( ) % num ;
256
256
for ( let x = 0 , width = this . width ; x < width ; x ++ ) {
257
- if ( rnd . float ( ) < prob ) dest [ x ] = fn ( ) ;
257
+ if ( rnd . probability ( prob ) ) dest [ x ] = fn ( ) ;
258
258
}
259
259
return this ;
260
260
}
@@ -284,10 +284,9 @@ export class MultiCA1D implements IClear {
284
284
const { width, prob, gens, configs, mask } = this ;
285
285
const [ next , curr ] = gens ;
286
286
for ( let x = 0 ; x < width ; x ++ ) {
287
- next [ x ] =
288
- rnd . float ( ) < prob [ x ]
289
- ? this . computeCell ( configs [ mask [ x ] ] , x , curr [ x ] )
290
- : curr [ x ] ;
287
+ next [ x ] = rnd . probability ( prob [ x ] )
288
+ ? this . computeCell ( configs [ mask [ x ] ] , x , curr [ x ] )
289
+ : curr [ x ] ;
291
290
}
292
291
gens . unshift ( gens . pop ( ) ! ) ;
293
292
}
@@ -356,7 +355,7 @@ export class MultiCA1D implements IClear {
356
355
const $ = ( id : Target , conf ?: Partial < UpdateBufferOpts > ) => {
357
356
conf &&
358
357
conf . perturb &&
359
- rnd . float ( ) < conf . perturb &&
358
+ rnd . probability ( conf . perturb ) &&
360
359
this . setNoise ( id , conf . density || 0.05 , rnd ) ;
361
360
} ;
362
361
for ( let y = 0 ; y < height ; y ++ ) {
0 commit comments