cgp.runtime.newtypes
Class Util

java.lang.Object
  |
  +--cgp.runtime.Type
        |
        +--cgp.runtime.newtypes.Util

public class Util
extends Type


Field Summary
private  java.util.Random rng
           
 
Fields inherited from class cgp.runtime.Type
kbStack, scopeStack, type
 
Constructor Summary
Util()
           
 
Method Summary
 NumberType random(NumberType n)
          Return a random integer in the range -N-1 <= 0 <= N-1.
 void sleep(NumberType secs)
          Sleep for the specified number of seconds or fraction thereof.
 
Methods inherited from class cgp.runtime.Type
addOp, andOp, divideOp, eqOp, geOp, getAttr, getKBStack, getNthOp, getScopeStack, getType, gtOp, invokeMemberFunc, isOp, leOp, ltOp, modulusOp, multiplyOp, negateOp, neOp, notOp, operationError, orOp, setAttr, setKBStack, setNthOp, setScopeStack, setType, subtractOp
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

rng

private java.util.Random rng
Constructor Detail

Util

public Util()
Method Detail

sleep

public void sleep(NumberType secs)
Sleep for the specified number of seconds or fraction thereof.

random

public NumberType random(NumberType n)
Return a random integer in the range -N-1 <= 0 <= N-1. This uses a RNG which is seeded by default from the time.