# Moving towards Smart Cities: A Selection of Middleware for Fog-to-Cloud Services +
## Appendix B Similarity of Fuzzy Positive Ideal Solution Using MATLAB  
```
functionSimilarity=fuzzySimilarity(A,B,n) %n:number of criteria %A:Weighted normalized fuzzy decision matrix %B:fuzzy positive ideal solution fori=1:n PA=sqrt((A(1)-A(2))^2+A(5)^2)+sqrt((A(3)-A(4))^2+A(5)^2)+(A(3)-A(2))+(A(4)-A(1)); PB=sqrt((B(1)-B(2))^2+B(5)^2)+sqrt((B(3)-B(4))^2+B(5)^2)+(B(3)-B(2))+(B(4)-B(1)); AA=1/2*(A(5)*(A(3)-A(2)+A(4)-A(1))); AB=1/2*(B(5)*(B(3)-B(2)+B(4)-B(1))); temp=(min(PA,PB)/max(PA,PB))*(min(AA,AB) + min(A(5),B(5)))/(max(aA,AB) + max(A(5),B(5))); Similarity(i)=(1-(sum(abs(A(1:4)-B(1:4))))/4)*temp;

## Appendix C Similarity of Fuzzy Positive Ideal Solution Using MATLAB
```
functionSimilarity=fuzzySimilarity(A,B,n) % n: number of criteria %A: Weighted normalized fuzzy decision matrix %B: fuzzy positive ideal solution fori=1:n ifA(I)==A(4) Ya=A(5)/2; else Ya=A(5)*((A(3)-A(2))/(A(4)-A(1))+2); end ifB(1)==B(4) Yb=B(5)/2; else Yb=B(5)*((B(3)-B(2))/(B(4)-B(1))+2); end Xa=(Ya*(A(3)+A(2))+(A(4)+A(1))*(A(5)-Ya))/2*A(5); Xb=(Yb*(B(3)+B(2))+(B(4)+B(1))*(B(5)-Yb))/2*B(5); Sa=A(4)-A(1); Sb=B(4)-B(1); if(Sa+Sb)/2==0 sasb=0; else sasb=1; end temp=(1-abs(Xa-Xb))*(sasb)*min(Ya,Yb)/max(Ya,Ybb); S1=1-sum(abs(A(1:4)-B(1:4)))/4; Simil4=S1*temp; Similarity(i)=S1*temp; end
```

## References

* _[PERSON] et al. (2017)_[PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON] A review of smart cities based on the internet of things concept. _Energies_**2017**, _10_, 421. [CrossRef]
* _[PERSON] et al. (2018)_[PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] [PERSON] LSCSH: Lattice-Based Secure Cryptosystem for Smart Healthcare in Smart Cities Environment. _IEEE Commun. Mag._**2018**, _56_, 24-32. [CrossRef]
* _[PERSON] et al. (2018)_[PERSON]; [PERSON]; [PERSON] The Role of Internet of Things and Smart Grid for the Development of a Smart City. In _Intelligent Communication and Computational Technologies_; Springer: Singapore, 2018; pp. 23-33. _[PERSON] et al. (2017)_[PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON]; [PERSON] [PERSON] UAV-enabled intelligent transportation systems for the smart city: Applications and challenges. _IEEE Commun. Mag._**2017**, _55_, 22-28. [CrossRef]
* _[PERSON] et al. (2018)_[PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON] Profiling Energy Efficiency of Mobile Crowdsensing Data Collection Frameworks for Smart City Applications. In Proceedings of the 6 th IEEE International Conference on Mobile Cloud Computing, Services, and Engineering (IEEE Mobile Cloud 2018), Bamberg, Germany, 26-29 March 2018. * _[PERSON] and [PERSON] (2018)_[PERSON]; [PERSON] IoT-driven automated object detection algorithm for urban surveillance systems in Smart Cities. _IEEE Internet Things J._**2018**, \(5\), 747-754. [CrossRef]
* _[PERSON] et al. (2018)_[PERSON]; [PERSON]; [PERSON]; [PERSON] Building a Big data provenance with its applications for Smart cities. _Int. Res. J. Eng. Technol._**2018**, \(5\), 451-457. * _[PERSON] et al. (2017)_[PERSON]; [PERSON]; [PERSON]; [PERSON] IoT-based big data storage systems in cloud computing: Perspectives and challenges. _IEEE Internet Things J._**2017**, \(4\), 75-87. [CrossRef]* [PERSON] et al. (2017) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Processing IoT Data with Cloud Computing for Smart Cities. _Int. J. Web Appl. IJWA_**2017**, \(9\), 88-95. * [PERSON] et al. (2018) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] FogFlow: Easy Programming of IoT Services Over Cloud and Edges for Smart Cities. _IEEE Internet Things J._**2018**, \(5\), 696-707. [CrossRef]
* [PERSON] et al. (2017) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Multi-Criteria Decision Analysis Methods in the Mobile Cloud Offloading Paradigm. _J. Sens. Actuator Netw._**2017**, \(6\), 25. [CrossRef]
* [PERSON] et al. (2014) [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Cloud service selection using multicriteria decision analysis. _Sci.