Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
RandomTools[AddFlavor] - add a flavor template to generate random objects
Calling Sequence
AddFlavor(flvr)
Parameters
flvr
-
equation of the form where x is any symbol and flavor is a procedure or module; defines the name of the flavor to add
Description
The AddFlavor(flvr) function teaches the Generate function about a new flavor. The flavor can be a procedure or a module definition, and it determines the form of the returned random object.
If flavor is a procedure, RandomTools[Generate](flvr) calls that procedure.
If flavor is a module, it must have an export named Main that is of type procedure. In this case, RandomTools[Generate](flvr) calls .
Note: The call x[op1, op2](arg1, arg2) translates into the function call flavor['Main'][op1, op2](arg1, arg2).
This function is part of the RandomTools package, and so it can be used in the form AddFlavor(..) 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[AddFlavor](..).
Examples
Error, (in RandomTools:-Generate) the flavor `a` does not exist
Error, (in RandomTools:-Generate) the flavor `alphachar` does not exist
AddFlavor(alphachar = proc() [a,b,c,d,e,f][rand(1..6)()] end proc):
See Also
module, procedure, RandomTools, RandomTools[Generate], RandomTools[GetFlavors]
Download Help Document