/[ascend]/trunk/models/test/defaultall/test3.a4c
ViewVC logotype

Annotation of /trunk/models/test/defaultall/test3.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2244 - (hide annotations) (download) (as text)
Mon Aug 2 01:05:11 2010 UTC (13 years, 11 months ago) by jpye
File MIME type: text/x-ascend
File size: 687 byte(s)
Fix bug with 'RUN default', need to use Initialize(GetSimulationRoot(sim),...) for running methods!
1 jpye 2244 (* test file for 'default_all' automatic recursive model initialisation trick *)
2    
3     REQUIRE "system.a4l";
4    
5     (* this time, we check that the defaultself_visit_childatoms routine is
6     doing its job. *)
7    
8     ATOM var_default_to_three REFINES solver_var
9     DIMENSIONLESS
10     DEFAULT 3.0;
11     nominal := 1.0;
12     lower_bound := 0.0;
13     upper_bound := 10.0;
14     END var_default_to_three;
15    
16    
17     MODEL sub1;
18     v IS_A var_default_to_three
19     a IS_A solver_var;
20     b IS_A solver_var;
21     v = 5;
22     METHODS
23     METHOD default_self;
24     a := 4;
25     b := 8;
26     END default_self;
27     END sub1;
28    
29     MODEL sub2;
30     s1a IS_A sub1;
31     s1b IS_A sub1;
32     v IS_A var_default_to_3;
33     END sub2;
34    
35     MODEL test2;
36     s2 IS_A sub2;
37     v IS_A var_default_to_3;
38     END test2;
39    

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22