emergent 8.2.2 Random Class Reference
emergent 8.2.2   Home · Wiki Docs For: Random · Emergent Help Browser 

Random Class Reference

Random Number Generation

See for more info: Wiki Docs For: Random

 #include <Random>

defined at: /mnt/ssd/grey/local/include/Emergent/Random.h :36-118

Inherits From: taINBase, taNBase, taOBase, taBase

Inherited By: Random*, Random&, const Random, RandomSpec

Index: SubTypes, Members, Methods, Static Members, Static Methods, Expert Members, Expert Methods

Sub Types


SubType Documentation

enum Random::Type

ConstantValueDescription
Random::UNIFORM0x00000000uniform with var = range on either side of the mean
Random::BINOMIAL0x00000001binomial with var = p, par = n
Random::POISSON0x00000002poisson with lambda = var
Random::GAMMA0x00000003gamma with var scaling parameter and par = k stages
Random::GAUSSIAN0x00000004normal with var
Random::BETA0x00000005beta with var = a and par = b shape parameters
Random::NONE0x00000006just the mean


Regular (preferred) Member and Method Documentation

Members

Member Category: _NoCategory

Member Category: taBase

Methods

Method Category: ObjectMgmt

Method Category: UserData

Method Category: _NoCategory


Member Documentation

Member Category: _NoCategory

Random::mean : double

mean of random distribution

Random::par : double

extra parameter for distribution (depends on each one)

Random::type : Random::Type

type of random variable to generate

Random::var : double

'varibility' parameter for the random numbers (gauss = standard deviation, not variance; uniform = half-range)

Member Category: taBase

taINBase::name : taString

name of the object


Method Documentation

Method Category: ObjectMgmt

taString taNBase::GetName ( )

Get the name of the object

Show Source Code

bool taNBase::HasName ( )

does the object have a name field that can be set?

Show Source Code

void taNBase::MakeNameUnique ( )

make sure my name is unique relative to names of objects associated with my owner (e.g., if it is a list object), typically because my name has changed, and owner needs to ensure that all names are unique

Show Source Code

bool taNBase::SetName ( taString& nm )

Set the object's name

Show Source Code

Method Category: UserData

void taOBase::RemoveAllUserData ( )

get rid of our user data list entirely -- this is done automatically when saving something that has no user data items, but you can also force it with this method -- deletes the whole list

Show Source Code

Method Category: _NoCategory

bool taNBase::AddFromTemplate ( taBase* obj, bool& is_acceptable )

handles drops from toolbar - when adding an object to a program, network, etc - e.g. dropping generic data table onto a program - set is_acceptable for objects 'not handled' but which are acceptable

Show Source Code

double Random::Density ( double x )

get density of random variable according to current params

Show Source Code

double Random::Gen ( int thr_no = -1 )

generate a random variable according to current parameters -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

taBase* taOBase::GetOwner ( )

Show Source Code

TypeDef* Random::GetTypeDef ( )

Show Source Code

taSigLink** taOBase::addr_sig_link ( )

Show Source Code

Static Member and Method Documentation

Static Members

Static Methods

Static Method Category: Bool

Static Method Category: Float

Static Method Category: Int


Static Method Documentation

Static Method Category: Bool

bool Random::BoolProb ( double p, int thr_no = -1 )   [static]

boolean true/false with given probability -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

Static Method Category: Float

double Random::Beta ( double a, double b, int thr_no = -1 )   [static]

beta random number with two shape parameters a > 0 and b > 0 -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

double Random::BetaDen ( double x, double a, double b )   [static]

beta density at value 0 < x < 1 for shape parameters a, b

Show Source Code

double Random::Binom ( int n, double p, int thr_no = -1 )   [static]

binomial with n trials (par) each of probability p (var) -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

double Random::BinomDen ( int n, int j, double p )   [static]

binomial density at j with n trials (par) each of probability p (var)

Show Source Code

double Random::Gamma ( double var, double j, int thr_no = -1 )   [static]

gamma with given variance, number of exponential stages (par) -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

double Random::GammaDen ( int j, double l, double t )   [static]

gamma density at time t with given number of stages (par), lambda (var)

Show Source Code

double Random::Gauss ( double stdev, int thr_no = -1 )   [static]

gaussian (normal) random number with given standard deviation -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

double Random::GaussDen ( double x, double stdev )   [static]

gaussian (normal) density for given standard deviation (0 mean)

Show Source Code

double Random::Poisson ( double l, int thr_no = -1 )   [static]

poisson with parameter l (var) -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

double Random::PoissonDen ( int j, double l )   [static]

poisson density with parameter l (var)

Show Source Code

double Random::UniformDen ( double x, double range )   [static]

uniform density at x with given range on either size of 0 (subtr mean from x before)

Show Source Code

double Random::UniformMeanRange ( double mean, double range, int thr_no = -1 )   [static]

uniform random number with given range on either size of the mean: [mean - range, mean + range] -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

double Random::UniformMinMax ( double min, double max, int thr_no = -1 )   [static]

uniform random number between min and max values inclusive (Do not use for generating integers - will not include max!) -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

double Random::ZeroOne ( int thr_no = -1 )   [static]

uniform random number between zero and one (inclusive of 1 due to rounding!) -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

Static Method Category: Int

int Random::Discrete ( taMatrix* distribution, int thr_no = -1 )   [static]

Discrete distribtion. Samples from a discrete distribution with probabilities given (automatically renormalizes the values) -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

int Random::IntMeanRange ( int mean, int range, int thr_no = -1 )   [static]

uniform random integer with given range on either side of the mean: [mean - range, mean + range] -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

int Random::IntMinMax ( int min, int max, int thr_no = -1 )   [static]

uniform random integer in range between min and max, exclusive of max: [min,max) -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

int Random::IntZeroN ( int n, int thr_no = -1 )   [static]

uniform random integer in the range between 0 and n, exclusive of n: [0,n) -- (0 <= thr_no < 100) specifies thread or dmem proc number for parallel safe random sequences (-1 = taMisc::dmem_proc for auto-safe dmem)

Show Source Code

Expert Member and Method Documentation

Expert Members

Expert Member Category: taBase

Expert Methods

Expert Method Category: UserData


Expert Member Documentation

Expert Member Category: taBase

taOBase::owner : taBase*

pointer to owner

taOBase::user_data_ : UserDataItem_List*

storage for user data (created if needed) DO NOT ACCESS this list directly -- use the GetUserData / SetUserData etc interface!


Expert Method Documentation

Expert Method Category: UserData

UserDataItem_List* taOBase::GetUserDataList ( bool force = false )

gets the userdatalist for this class

Show Source Code


Copyright © 2017Regents of the University of Colorado, Carnegie Mellon University, Princeton University.
emergent 8.2.2