001: #!/usr/bin/perl -w
002: #!/usr/bin/perl -d:ptkdb -w
003: #
004: 
005: use strict;
006: 
007: 
008: $| = 1;
009: 
010: 
011: BEGIN
012: {
013:     #! make check
014: 
015:     push @INC, '../perl';
016: 
017:     #! make distcheck
018: 
019:     push @INC, '../../perl';
020: 
021:     #! normal run
022: 
023:     push @INC, './perl';
024: 
025:     #! after install
026: 
027:     push @INC, '/usr/local/glue/swig/perl';
028: }
029: 
030: 
031: use SwiggableHeccer;
032: 
033: use SSP;
034: 
035: 
036: $SIG{__DIE__}
037:     = sub {
038:         use Carp;
039: 
040:         confess @_;
041:     };
042: 
043: $ENV{NEUROSPACES_NMC_MODELS} = '/usr/local/neurospaces/models/library';
044: 
045: 
046: sub main
047: {
048:     # model specification array
049: 
050:     my $modelname = $0;
051: 
052:     $modelname =~ s/.*\///;
053: 
054:     $modelname =~ s/-/_/g;
055: 
056:     my $args = [ "$0", "-P", "tests/cells/$modelname.ndf" ];
057: 
058:     # instantiate a scheduler
059: 
060:     my $scheduler
061:         = SSP->new(
062:                    {
063:                     apply => {
064:                               simulation => [
065:                                              {
066:                                               arguments => [ 1, { verbose => 2, }, ],
067:                                               method => 'steps',
068:                                              },
069:                                              {
070:                                               arguments => [ 0.1, ],
071:                                               method => 'advance',
072:                                              },
073:                                             ],
074:                              },
075:                     models => [
076:                                {
077:                                 modelname => "/$modelname",
078:                                 solverclass => "heccer",
079:                                },
080:                               ],
081:                     name => $modelname,
082:                     services => {
083:                                  model_container => {
084:                                                  initializers => [
085:                                                                   {
086:                                                                    arguments => [ $args, ],
087:                                                                    method => 'read',
088:                                                                   },
089:                                                                  ],
090:                                                  module_name => 'Neurospaces',
091:                                                 },
092:                                 },
093:                     solverclasses => {
094:                                       heccer => {
095:                                                  constructor_settings => {
096:                                                                           configuration => {
097:                                                                                             reporting => {
098:                                                                                                           tested_things => ($SwiggableHeccer::HECCER_DUMP_TABLE_GATE_TABLES
099:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_TABLE_GATE_SUMMARY
100:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_VM_MECHANISM_DATA
101:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_INTERMEDIARY_SUMMARY
102:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_INTERMEDIARY_STRUCTURE
103:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_INTERMEDIARY_COMPARTMENTS_PARAMETERS
104:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_INDEXERS_SUMMARY
105:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_INDEXERS_STRUCTURE
106:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_VM_MECHANISM_OPERATIONS
107:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_VM_COMPARTMENT_MATRIX_DIAGONALS
108:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_VM_COMPARTMENT_MATRIX
109:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_VM_AGGREGATORS
110:                                                                                                                             | $SwiggableHeccer::HECCER_DUMP_VM_COMPARTMENT_OPERATIONS),
111:                                                                                                          },
112:                                                                                            },
113:                                                                           options => {
114:                                                                                       dIntervalEnd => 0.05,
115:                                                                                       dIntervalStart => -0.1,
116:                                                                                       iIntervalEntries => 50,
117:                                                                                      },
118:                                                                          },
119:                                                  module_name => 'Heccer',
120:                                                  service_name => 'model_container',
121:                                                 },
122:                                      },
123:                    },
124:                   );
125: 
126:     use YAML;
127: 
128:     my $scheduler_yaml;
129: 
130:     {
131:         local $/;
132: 
133:         if (-e "./yaml/$modelname.yml")
134:         {
135:             $scheduler_yaml = Load(`cat ./yaml/$modelname.yml`);
136:         }
137:     }
138: 
139:     # run the schedule
140: 
141:     $scheduler->run();
142: }
143: 
144: 
145: main();
146: 
147: 
148: exit 0;
149: 
150: 
151: