1 /* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMGRID_S4U_ENGINE_HPP
7 #define SIMGRID_S4U_ENGINE_HPP
13 /** @brief Simulation engine
15 * This class is an interface to the simulation engine.
17 XBT_PUBLIC_CLASS Engine {
19 /** Constructor, taking the command line parameters of your main function */
20 Engine(int *argc, char **argv);
22 /** @brief Load a platform file describing the environment
24 * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
25 * Some examples can be found in the directory examples/platforms.
27 void loadPlatform(const char *platf);
29 /** Registers the main function of an actor that will be launched from the deployment file */
30 void register_function(const char*name, int (*code)(int,char**));
32 /** Registers a function as the default main function of actors
34 * It will be used as fallback when the function requested from the deployment file was not registered.
35 * It is used for trace-based simulations (see examples/msg/actions).
37 void register_default(int (*code)(int,char**));
39 /** @brief Load a deployment file and launch the actors that it contains */
40 void loadDeployment(const char *deploy);
42 /** @brief Run the simulation */
45 /** @brief Retrieve the simulation time */
46 static double getClock();
49 }} // namespace simgrid::sgo
51 #endif /* SIMGRID_S4U_ENGINE_HPP */