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