activity-levels-pc/active [ Methods ]
[ Top ] [ activity-levels-pc ] [ Methods ]
DATE
1st March 2024
DESCRIPTION
Returns T or NIL depending on whether we're active given a number between 0 and 100.
ARGUMENTS
The activity-levels-pc object.
OPTIONAL ARGUMENTS
the 'level', between 0 and 100 inclusive, indicating the frequency of occurrence of the result T; comparable to a percentage chance but deterministic and pattern-oriented (see the data slot state lists in activity-levels.lsp). Although this is an optional argument (because of related classes' methods) this method only really makes sense if it is passed. Float arguments will be rounded. Default = 50.
RETURN VALUE
T or NIL
EXAMPLE
(let ((alpc (make-alpc))) (count t (loop repeat 1000 collect (active alpc 31)))) --> 310
SYNOPSIS
(defmethod active ((alpc activity-levels-pc) &optional level)
named-object/activity-levels-pc [ Classes ]
[ Top ] [ named-object ] [ Classes ]
NAME
activity-levels File: activity-levels-pc.lsp Class Hierarchy: named-object -> activity-levels-pc Version: 1.1.0 Project: slippery chicken (algorithmic composition) Purpose: At a minimum, this is replacement for fixed-seed weighted randomness using percentages--which will produce different results with different Lisp implementations--but in fact, because it uses two activity-levels objects, it will always produce pattern-based results. (The 'pc' stands for per cent.) Author: Michael Edwards: m@michael-edwards.org Creation date: 1st March 2024 $$ Last modified: 17:09:50 Fri Mar 1 2024 CET SVN ID: $Id$