0
(defun creer-bagage (=poids =categorie)
  (let* ((timestamp (get-universal-time))
         (=id (format nil "~8d" (mod timestamp 100000000)))
         (=dimensions 
           (case =categorie
             (1 (list 3 3))  ;; Example dimensions for category 1
             (2 (list 6 2))  ;; Example dimensions for category 2
             (3 (list 6 3))  ;; Example dimensions for category 3
             (otherwise (error "Catégorie invalide : ~a" =categorie)))))
    
    ;; Création du chunk en mémoire déclarative
    )

    (add-dm (isa baggage
                 id =id
                 categorie =categorie
                 poids =poids
                 dimensions =dimensions
                 position nil
                 est-place nil))
                 
               ;   (define-chunks-fct (("new chunk") isa bagage id =id))
                 )

When running this code with parameters say 1 and 1 I have this as result:

BAGGAGE0
   ID  =ID
   CATEGORIE  =CATEGORIE
   POIDS  =POIDS
   DIMENSIONS  =DIMENSIONS

So it does not pass the variables but instead treats them as strings. Please how do i fix it. Thanks

6
  • Where are definitions for isa and add-dm? Are you aware that (add-dm (isa baggage ;... occurs outside of the let form? It looks like you need to move the last parenth of the let form to be outside of the call to add-dm. Commented Nov 27, 2024 at 0:06
  • @adabsurdum I did that but still thesame result Commented Nov 27, 2024 at 2:46
  • What is add-dm and how is it defined? I am guessing that it is a macro. Commented Nov 27, 2024 at 3:19
  • add-dm is defined in act-r, it's used to create chunks and adds them in declarative memory Commented Nov 27, 2024 at 16:42
  • Please add context to explain what ACT-R is, for example add a link to github.com/asmaloney/ACT-R and/or en.wikipedia.org/wiki/ACT-R Commented Dec 2, 2024 at 14:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.