org.alicebot.server.core.processor
Class RandomProcessor
java.lang.Object
org.alicebot.server.core.processor.Processor
org.alicebot.server.core.processor.AIMLProcessor
org.alicebot.server.core.processor.RandomProcessor
public class RandomProcessor
- extends AIMLProcessor
Handles a
random
element.
This improved version (since 4.1.5) employs the notion that to achieve
the kind of randomness expected by users and AIML authors, the following
requirements exist:
-
Each
random
element should have its own "space".
This means that, for example, if random
element A
contains five li
children, and random
element B
contains seven li
children, the probability that any given li
of A
will be chosen when A
is activated should consistently be 1:5,
and the probability that any given li
of B
will be chosen
when B
is chosen should consistently be 1:7. Essentially, each random
must have its own unique series of random numbers.
-
A "unique space" requirement exists as well on a per-user basis: each
user should have an equivalent experience of randomness for each
random
element, independent of any other users.
-
The individual bot also has a uniqueness requirement, multiplying the previous two.
In effect, if there are
m
bots, n
users, and p
random elements, there are (potentially) m * n * n
independent random
number series.
- Version:
- 4.1.5
- Author:
- Noel Bush, Jon Baer, Thomas Ringate, Pedro Colla, Jay Myers
Field Summary |
static java.lang.String |
label
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
label
public static final java.lang.String label
- See Also:
- Constant Field Values
RandomProcessor
public RandomProcessor()
process
public java.lang.String process(int level,
XMLNode tag,
TemplateParser parser)
throws AIMLProcessorException
- Specified by:
process
in class AIMLProcessor
- Throws:
AIMLProcessorException