<commit_before>(in-package :event-bullet-world)

(defparameter ros-binding-name "event_bullet_world/Event_CRAM")

(defun check-map ((node-name "event_raising_node") (loop-rate 20)) ; following ROS conventions on naming nodes
  "Periodically check with a rate to see if some event occured"
  (with-ros-node(node-name: spin t)
    (ros-warn WORLD-EVENT-CLASS "Event raising node started")
    (loop-at-most-every loop-rate
      ;; @TODO: Create threads for each object? mskes sense if the number of objects becomes large
      ;; How will this work?
      ;; Option 1: for each object create a thread which runs in a
      ;; seperate loop-at-most-every, then, removing an object from the list has to
      ;; be handled
      ;; Option 2: current model: check each object parallely, problem: too many
      ;; thread created and destroyed every cycle.
      (loop for event in *world-event-accessor-list* when (funcall (raise-event-on-true event))
        do (on-event event)))))

<commit_msg>brain wave<commit_after>(in-package :event-bullet-world)

(defparameter ros-binding-name "event_bullet_world/Event_CRAM")

(defun check-map ((node-name "event_raising_node") (loop-rate 20)) ; following ROS conventions on naming nodes
  "Periodically check with a rate to see if some event occured"
  (with-ros-node(node-name: spin t)
    (ros-warn WORLD-EVENT-CLASS "Event raising node started")
    (loop-at-most-every loop-rate
      ;; @TODO: Create threads for each object? mskes sense if the number of objects becomes large
      ;; after adding an event, create a thread with loop-rate
      ;; on asking for deletion, destroy the thread.
      ;; Maintain a seperate list of objects to be destroyed.
      ;; In the thread, look for the event in the to-be-destroyed list, if present,
      ;; exit thread after calling remove fn for that object.
      ;; PS: maintain read-write lock
      (loop for event in *world-event-accessor-list* when (funcall (raise-event-on-true event))
        do (on-event event)))))


{'fraction_non_alphanumeric': 0.09885742672627919, 'fraction_numerical': 0.0029806259314456036, 'mean_word_length': 3.4557522123893807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2328721', 'n_tokens_mistral': 614, 'n_tokens_neox': 579, 'n_words': 230}