# Modeling and Simulation Tools for Fog Computing--A Comprehensive Survey from a Cost Perspective
## 5 Simulation Tools
In a predefined cloud/fog system, authors consider how to reduce costs for each incoming task by combining of all available computational resources and bringing all involved computing resources closer to users. The tool focuses on task scheduling algorithms. The work in Reference [68] proposes Yet Another Fog Simulator (YAFS) that enables Cloud/fog simulations. Python was used for the development of YAFS is Python while is also supports the JSON format for input files that describe customized scenarios. The YAFS architecture consists of the following components: application, selection, placement, population, topology, and core. During simulation the selection, placement, and population processes have the responsibility of resource management and their interactions are dynamic. Topologies use graph-based representations and are imported from JSON files which can be generated from other tools (such as CAIDA and BRITE). Applications remain the same as in iFogSim, and consist of a set of modules, which provide services and exchange messages. Following a distributed data flow model, authors use a directed acyclic graph to represent them, where nodes are modules that act and edges are the exchanged data among modules. FogDirMine [69] is a Python-based simulation tool that aims to model the beahavoir of the CISCO FogDirector, which is a tool for managing IoT applications on fog systems. Although FogDirMine refers to the availability of resources and QoS, there is no reference to costs. FogDirSim [70] is deployed to support also the CISCO FogDirector. It is built in Python and composed of independent REST services. The objective of FogDirSim is to compare different management policies for applications and infrastructure, considering energy consumption, uptime, and resource usage. FogBus [71] is a framework for building fog environments. It is developed using RESTful technologies and a combination of scripting and programming languages. FogBus supports a wide range of infrastructure devices, application execution and interactions among nodes. It provides authentication and encryption facilities implementing blockchain. The FogBus framework includeshardware components (fog nodes, IoT devices, fog gateway nodes, cloud data centers) software components (grouped in broker, repository, and computing services) and network components (topology, security, scalability, and fault tolerance). This simulator combines a large number of elements and services and evaluates their performance in terms of energy, latency, network and CPU usage. ModFogSim [5] is an extension of iFogSim which requires significant effort to model user mobility and migration strategies. ModFogSim adds mobility and migration features as well as wireless connections to iFogSim. These additional features are implemented with the help of a Coordinate class (which maps devices to a Cartesian plane), an AppDevice class (acting as an access point, handling connections and disconnections), a number of Mobile classes (for devices, sensors and actuators) a number of Mirgation classes to support migration in the simulation. The authors used a lab-based testbed to evaluate their simulator. They conclude that the results demonstrate the usability of their tool. In terms of cost, it inherits the iFogSim metrics, improvements on the latency metric. FogWorkFlowSim [72] presents a different approach to fog computing simulation. It is written in Java and provides a user-friendly GUI to evaluate resource and task management strategies. The simulation process is done in simple steps: (a) setup of the fog computing environment, where the user defines and parametrizes devices for each of the three layers, (b) setting a workflow application, where the user chooses from available workflows or creates her own, (c) configuration, which defines the computational strategies, the scheduling algorithms, and the performance metrics and (d) results, where simulation outcomes can be visualizes and exported.