Ticket #1979: SimpleIntegerTest.mo

File SimpleIntegerTest.mo, 535 bytes (added by bruno, 12 years ago)
Line 
1model SimpleIntegerTest
2parameter Integer n=3;
3Integer selected(start=1,fixed=true);
4Integer chooseInt[n](start=zeros(3),fixed=true);
5Integer modtime;
6Real te;
7equation
8  te=time;
9modtime=rem(integer(te),n);
10if
11  (modtime==0) then
12chooseInt[1]=1;
13chooseInt[2]=0;
14chooseInt[3]=0;
15elseif
16      (modtime==1) then
17chooseInt[1]=0;
18chooseInt[2]=1;
19chooseInt[3]=0;
20else
21chooseInt[1]=0;
22chooseInt[2]=0;
23chooseInt[3]=1;
24end if;
25selected=chooseInt*(1:n);
26  annotation (experiment(StopTime=10));
27end SimpleIntegerTest;