Skip to main content
. 2019 Jul 19;19(14):3190. doi: 10.3390/s19143190
Algorithm 7 Creating simulated temperature data
Require:g,uppertemp,lowertemp
Ensure:t[g]={t1,t2,,tg}
  initialize min=0,max=10,temp=20,i=1,up=true
  whileigdo
    while (tempuppertemp)AND(upistrue) do
      temp=temp+Random(min,max)
      if (uppertemp<temp) then
        up=false
        temp=uppertemp
      end if
      t[i]=temp
      i=i+1
    end while
    while (lowertemptemp)AND(upisfalse) do
      temp=tempRandom(min,max)
      if (temp<lowertemp) then
        up=true
        temp=lowertemp
      end if
      t[i]=temp
      i=i+1
    end while
  end while