run-petri-net   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/core/petri-net.xtm

Implementation

;; simlulator
(define run-petri-net
  (lambda (cnt places transitions killstate)
    (println cnt 'state: places)
    (for-each (lambda (t) (t)) transitions)
    (if (killstate places)
        (println 'final 'state: places)
        (schedule (+ (now) (* .5 *second*)) 'run-petri-net
                  (+ cnt 1)
                  places transitions
                  killstate))))


Back to Index