Aiming to optimise the performance of the computing layers of Internet of Things (IoT) systems, one of the most widespread techniques is the well-known task scheduling. Not only to develop but also to put task scheduling techniques in production, they have to be tested. Nevertheless, IoT systems are complex scenarios with high technological heterogeneity. Thus, testing task scheduling methods in the IoT context involves an investment of money, time and effort in acquiring devices, their configuration, deployment, etc. To avoid this, the system can be simulated and tests can be conducted through these simulations. Moreover, the underlying technical complexity of IoT systems can be reduced by increasing the abstraction level from which these systems are designed. Simulators based on model-driven development can help both to test and tackle the technological complexity of IoT systems. In this paper, a Domain-Specific Language based on SimulateIoT is proposed for the design, code generation and simulation of IoT systems for the assessment of task scheduling methods. Simulations include the generation and offloading of workflow-based tasks, the components required to handle these tasks, as well as the required resources to integrate the users' task scheduling methods in the simulations. All this, while providing an infrastructure based on the cloud-to-thing continuum paradigm on which to deploy and test these task scheduling environments, i.e., simulations can include the mist, edge, fog and cloud layers and the federation between them. In addition, a case study focused on an Industrial IoT (IIoT) system is illustrated to show the applicability of the proposed simulator.