Changeset 12113 in project for release/3/nemo/trunk/nemo-nmodl.scm
- Timestamp:
- 10/06/08 09:17:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
release/3/nemo/trunk/nemo-nmodl.scm
r12074 r12113 1 1 2 ;; TODO: * uniquify state names in state complexes 3 ;; * check that open states are valid 4 ;; 2 ;; TODO: * check that open states are valid 3 ;; * include option for generating kinetic eqs 5 4 ;; 6 5 ;; An extension for translating NeuroML models to NMODL descriptions. … … 91 90 expr)) 92 91 ((s . es) (if (symbol? s) (cons s (map (lambda (x) (rhsexpr x)) es)) expr)) 93 (id id)))92 (id (nmodl-name id)))) 94 93 95 94 … … 346 345 347 346 (define (state-eqs n initial open transitions power) 348 (let* ((g (make-digraph n (string-append (->string n) " transitions graph"))) 347 (let* ((sn (lambda (x) (string->symbol (s+ n ":" x)))) 348 (g (make-digraph n (string-append (->string n) " transitions graph"))) 349 349 (add-node! (g 'add-node!)) 350 350 (add-edge! (g 'add-edge!)) … … 356 356 (match (car tlst) 357 357 (('-> s0 s1 rate-expr) 358 (loop (cons s0 (cons s1lst)) (cdr tlst)))358 (loop (cons (sn s0) (cons (sn s1) lst)) (cdr tlst))) 359 359 (('-> _) 360 360 (nemo:error 'nemo:nmodl-state-eqs ": invalid transition equation " … … 371 371 (for-each (lambda (e) 372 372 (match e (('-> s0 s1 rate-expr) 373 (let ((i (car (alist-ref s0name->id-map)))374 (j (car (alist-ref s1name->id-map)))373 (let ((i (car (alist-ref (sn s0) name->id-map))) 374 (j (car (alist-ref (sn s1) name->id-map))) 375 375 (x (if (eq? s0 (second snode)) snex s0))) 376 376 (add-edge! (list i j `(* ,x ,rate-expr))))) … … 605 605 606 606 (pp indent ,nl (STATE "{")) 607 (for-each (lambda (st) (apply define-state (list indent+ st))) 607 (for-each (lambda (st) 608 (if (pair? st) 609 (apply define-state (list indent+ (->string (second st)))) 610 (apply define-state (list indent+ st)))) 608 611 states) 609 612 (for-each (lambda (st) (apply define-state (list indent+ st)))
Note: See TracChangeset
for help on using the changeset viewer.