dimanche 25 février 2018

Return random event out of last 2 events

Assume the following Esper events (Esper Tryout page):

StockTick={symbol='event1', price=1}
t=t.plus(10 seconds)
StockTick={symbol='event2', price=2}
t=t.plus(10 seconds)
StockTick={symbol='event3', price=3}
t=t.plus(10 seconds)
StockTick={symbol='event4, price=4}

I would like to return the last two events every 3 seconds.

Apart from a window and an output every 3 seconds I assume the statement must contain some Random() variable but I can't make it work. I am grateful about any ideas.




Aucun commentaire:

Enregistrer un commentaire