Random

trait Random extends Control

A random number generator that can be used for operations such as .until and .range.

Example:

 val gen = Random()
 val r100 = gen.until(100)
 Act(
   r100, // draw new number between 0 and 99
   PrintLn("Random number: " ++ r100.toStr)  // print current value
 )
Companion:
object
trait Control
trait Lazy
trait Product
trait Equals
class Object
trait Matchable
class Any

Type members

Types

type Repr[T <: Txn[T]] <: IControl[T] & Random[T]

Value members

Concrete methods

def coin[A, B](prob: Ex[A])(implicit num: NumDouble[A] { type Boolean = B; }, default: HasDefault[B]): Coin[A, B]
def range[A](lo: Ex[A], hi: Ex[A])(implicit num: Num[A]): Range[A]
def until[A](hi: Ex[A])(implicit num: Num[A]): Until[A]

Inherited methods

def canEqual(that: Any): Boolean
Inherited from:
Equals
final def expand[T <: Txn[LazyRef(...)]](implicit ctx: Context[T], tx: T): Repr[T]
Inherited from:
Lazy
protected def mkRepr[T <: Txn[LazyRef(...)]](implicit ctx: Context[T], tx: T): Repr[T]
Inherited from:
Lazy
def productArity: Int
Inherited from:
Product
def productElement(n: Int): Any
Inherited from:
Product
def productElementName(n: Int): String
Inherited from:
Product
def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product
def productPrefix: String
Inherited from:
Product
final def token: AnyRef
Inherited from:
Control

Inherited fields

@transient
final protected val ref: Object
Inherited from:
Lazy