help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

probability


From: Emanuel Berg
Subject: probability
Date: Mon, 15 Aug 2022 03:04:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

I just wrote this ...

(require 'pcase)

(defun get-prob-perc (prob)
  (pcase prob
    ("very-rare"      1)
    ("rare"           2)
    ("uncommon"       4)
    ("pretty-common"  8)
    ("common"        16)
    ("routine"       32)
    ("habitual"      64) ))

It should be read as, "something is considered rare when one
estimates that it typically happens twice a year"

Now what I would like is a list of functions-probability
pairs, so that (list #'some-fun "uncommon") or (list
#'some-fun 4) means that means some-fun executes that often.

Then I'd like to have a function to set the time, i.e.
real human time, or duration I should say, say it should go on
for 5 minutes.

So then for 5 minutes, all funs added to the list are randomly
executed, but not randomly enough, they are executed as often
or rarely compared to their brethren as is indicted by their
associated probability value.

Only one function is executed at once, and when the time is
up, nothing more happens?

How would you do that?

TIA

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]