Changeset 29119 in project


Ignore:
Timestamp:
06/18/13 11:52:27 (8 years ago)
Author:
Ivan Raikov
Message:

nemo: initial version of constraints module

Location:
release/4/nemo/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • release/4/nemo/trunk/nemo-currents.scm

    r29116 r29119  
    11;;       
    22;;
    3 ;; Procedures for construction ionic current equations from NEMO models.
     3;; Procedures for construction of ionic current equations from NEMO models.
    44;;
    55;; Copyright 2008-2013 Ivan Raikov and the Okinawa Institute of Science and Technology
  • release/4/nemo/trunk/nemo-nest.scm

    r29116 r29119  
    2828        (require-extension lolevel posix matchable strictly-pretty
    2929                           varsubst datatype nemo-core nemo-utils
    30                            nemo-geometry nemo-defaults
     30                           nemo-geometry nemo-defaults nemo-constraints
    3131                           nemo-gate-complex nemo-synapse nemo-currents
     32
    3233                           )
    3334
     
    18291830(define (output-init sysname state-index-map steady-state-index-map
    18301831                     imports external-eq-defs const-defs asgn-eq-defs init-eq-defs rate-eq-defs
    1831                      reaction-eq-defs i-eqs pool-ions perm-ions defaults indent indent+)
     1832                     reaction-eq-defs i-eqs pool-ions perm-ions defaults constraints
     1833                     indent indent+)
    18321834
    18331835 
    18341836  (let* ((N (length state-index-map))
     1837
     1838         (c-eqs (lookup-def 'c-eqs constraints))
    18351839
    18361840         (i-eqs
     
    19091913     (lambda (n) (pp indent+ ,(expr->string/C++ (sprintf "p.~A" n) n)))
    19101914     (map (compose nest-name first) const-defs) )
     1915
     1916    (for-each
     1917     (lambda (eq)
     1918       (match-let (((op left right)  eq))
     1919                  (pp indent+ ,(sprintf "if (!((~A) ~A (~A))) { throw BadProperty (~S); }; "
     1920                                        (expr->string/C++ (canonicalize-expr/C++ (rhsexpr/C++ left))) op
     1921                                        (expr->string/C++ (canonicalize-expr/C++ (rhsexpr/C++ right)))
     1922                                        (sprintf "Constraint ~A is not satisfied." eq)
     1923                                        ))
     1924                  ))
     1925     c-eqs)
    19111926
    19121927    (let ((vi (lookup-def 'v state-index-map))
     
    22952310             (synapse-info         (nemo:post-synaptic-conductance-query sys))
    22962311
     2312
    22972313             (pscs           (lookup-def 'post-synaptic-conductances synapse-info))
    22982314
     
    23112327             (i-eqs          (lookup-def 'i-eqs i-defs))
    23122328             (i-names        (lookup-def 'i-names i-defs))
     2329
     2330             (constraints    (nemo:constraint-definitions
     2331                              gate-complexes i-gates i-syns pscs marea
     2332                              (lambda (x) (state-power sys x))
     2333                              (lambda (x) ((dis 'component-exports) sys x))
     2334                              (lambda (x) ((dis 'component-subcomps) sys x))
     2335                              nest-name))
    23132336
    23142337             (external-eq-defs   (sys->external-eq-defs sys nest-name rhsexpr/C++ canonicalize-expr/C++
     
    24722495              (output-init sysname state-index-map steady-state-index-map
    24732496                              imports-sans-v external-eq-defs const-defs asgn-eq-defs init-eq-defs rate-eq-defs
    2474                               reaction-eq-defs i-eqs pool-ions perm-ions defaults indent indent+)
     2497                              reaction-eq-defs i-eqs pool-ions perm-ions defaults constraints indent indent+)
    24752498              (pp indent ,nl)
    24762499              ))
  • release/4/nemo/trunk/nemo.meta

    r29116 r29119  
    66
    77 (files "nemo.meta" "extensions" "expr.grm" "nemo.setup"
    8         "nemo-core.scm" "nemo-gate-complex.scm" "nemo-currents.scm" "nemo-synapse.scm" "nemo-utils.scm" "nemo-macros.scm" "nemo.scm"
     8        "nemo-core.scm" "nemo-gate-complex.scm" "nemo-currents.scm" "nemo-synapse.scm" "nemo-constraints.scm" "nemo-utils.scm" "nemo-macros.scm" "nemo.scm"
    99        "stx-engine.scm" "SXML.scm" "SXML-to-XML.scm" "expr-parser.scm"
    1010        "nemo-nmodl.scm" "nemo-matlab.scm" "nemo-nest.scm" "nemo-pyparams.scm" "examples" )
  • release/4/nemo/trunk/nemo.setup

    r29116 r29119  
    9595  )
    9696
    97 
    98 
    9997(install-extension
    10098
     
    120118  )
    121119
    122 
    123 
    124120(install-extension
    125121
     
    129125  ; Files to install for your extension:
    130126  `(,(dynld-name "nemo-currents") ,(dynld-name "nemo-currents.import") )
     127
     128  ; Assoc list with properties for your extension:
     129  `((version ,nemo-version)))
     130
     131
     132(make (
     133       ((dynld-name "nemo-constraints") ("nemo-constraints.scm")
     134        (compile -O -d2 -S -s nemo-constraints.scm -j nemo-constraints))
     135
     136       ((dynld-name "nemo-constraints.import") ("nemo-constraints.import.scm")
     137        (compile -O2 -s nemo-constraints.import.scm))
     138       )
     139  (list (dynld-name "nemo-constraints")
     140        (dynld-name "nemo-constraints.import"))
     141  )
     142
     143(install-extension
     144
     145  ; Name of your extension:
     146  'nemo-constraints
     147
     148  ; Files to install for your extension:
     149  `(,(dynld-name "nemo-constraints") ,(dynld-name "nemo-constraints.import") )
    131150
    132151  ; Assoc list with properties for your extension:
Note: See TracChangeset for help on using the changeset viewer.