## 1 Introduction  
The paradigm of pervasive systems permits to connect devices that may have some intelligence capacity. These devices can send information about data of the physical world in real time: temperature, state of illumination, levels of CO\({}_{2}\), etc. In the health sector, pervasive systems can monitor patients' vital signs in real time, or pervasive systems can establish control of important assets in a certain hospital, where they are and how they are used, and so on. In smart cities, the use of these technologies helps the control of pollution, street lighting, traffic management, etc. [1]. The possibility of implementing Internet of Things (IoT) applications with the deployment of large numbers wireless sensor and actuator networks (WSANs), where it could include scenarios with mobility, motivates preliminary analyses in which simulation can play a relevant role. The simulation of systems with heterogeneous and large-scale scenarios is a complex task. The evaluation of the parameters that involve this type of system needs tools that support the interaction between different scenarios. Ptolemy II is an open-source software framework supporting experimentation with actor-oriented design [2]. A model is a hierarchical interconnection of actors, which execute concurrently and communicate through messages sent via interconnected ports. Each level of the hierarchy in a model can have its own director, and distinct directors can be composed hierarchically. System modeling through the design hierarchy provided by Ptolemy II helps extend the model to simulate the growth and expansion of WSANs over large areas such as a set of city parks. Internet of Things (IoT) enables the connection of identifiable physical world objects with cyberspace through Internet communications. IoT uses radiofrequency identification (RFID), quick response (QR) codes, sensor, or wireless technology to enable intercommunication between devices. Additionally, the IoT ecosystem can consist of a set of components such as smart objects, intelligent devices, smartphones, and tablets [3]. In general, the IoT paradigm can help to design innovative services that involve the use of WSANs or smartphones as sensor technologies. These technologies can use the MQTT (message queue telemetry transport) protocol for the transfer of sensed data because it consumes very little bandwidth. The systems development process for IoT applications in a smart city requires preliminary research on the components and the interaction between them to achieve the proofs of concept and obtain verified prototypes [4]. This process involves a series of components such as IoT sensors, communications elements, software services, and data repositories. Thus, building prototypes of an IoT system with some real sensor nodes for a smart city that meets certain needs could be impractical during experimental tests. Modeling and simulation are alternative techniques that facilitate the analysis, design, and experimental testing of IoT applications. We find these techniques relevant to the construction of the sensor network model. Some advantages of using the simulation are the acceleration of the tests, the saving of costs, the minimization of risks, and the preliminary analysis of characteristics such as the performance of the system. In this way, it is possible to do a scalability analysis, define the variables handled, or know the types of sensors. Despite these advances, simulators for IoT applications that consider the functionality of end-to-end services are an open line of research [4]. Although we have followed some simulation methods and principles described in the literature [5; 6], the complete validation of the simulation models is beyond the scope of this paper. However, we performed several simulation experiments to verify the models and achieve the research objectives.