RandomTools - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Random Objects : RandomTools package : Commands : RandomTools/GetFlavor

RandomTools

 GetFlavor
 return the flavor definition

 Calling Sequence GetFlavor(flvr)

Parameters

 flvr - symbol; represents a flavor in the form of a procedure or module

Description

 • The GetFlavor(flvr) function, where flvr specifies a flavor that is  known to function Generate, returns the procedure or module that defines the behavior of the flavor.
 If the flavor is not recognized by Generate, an exception is returned.
 • This function is part of the RandomTools package, and so it can be used in the form GetFlavor(..) only after executing the command with(RandomTools). However, it can always be accessed through the long form of the command by using the form RandomTools[GetFlavor](..).

Examples

 > $\mathrm{with}\left(\mathrm{RandomTools}\right):$
 > $\mathrm{AddFlavor}\left(A=\mathrm{rand}\left(1..20\right)\right):$
 > $\mathrm{Generate}\left(A\right)$
 ${15}$ (1)
 > $\mathrm{GetFlavor}\left(A\right)$
 ${\mathbf{proc}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{proc}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{builtin}}{=}{\mathrm{RandNumberInterface}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}{}\left({6}{,}{20}{,}{5}\right){+}{1}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (2)
 > $\mathrm{GetFlavor}\left(\mathrm{integer}\right)$
 ${\mathbf{proc}}\left(\left\{{\mathrm{range}}{::}\left({\mathrm{integer}}{..}{\mathrm{integer}}\right){:=}{−}{499999999994}{..}{499999999994}\right\}{,}{}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (3)
 > $\mathrm{member}\left(A,\left[\mathrm{GetFlavors}\left(\right)\right]\right)$
 ${\mathrm{true}}$ (4)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam