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
11 /** @brief Simulation engine
13 * This class is an interface to the simulation engine.
17 /** Constructor, taking the command line parameters of your main function */
18 Engine(int *argc, char **argv);
20 /** @brief Load a platform file describing the environment
22 * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
23 * Some examples can be found in the directory examples/platforms.
25 void loadPlatform(const char *platf);
27 /** Registers the main function of an actor that will be launched from the deployment file */
28 void register_function(const char*name, int (*code)(int,char**));
30 /** Registers a function as the default main function of actors
32 * It will be used as fallback when the function requested from the deployment file was not registered.
33 * It is used for trace-based simulations (see examples/msg/actions).
35 void register_default(int (*code)(int,char**));
37 /** @brief Load a deployment file and launch the actors that it contains */
38 void loadDeployment(const char *deploy);
40 /** @brief Run the simulation */
43 /** @brief Retrieve the simulation time */
44 static double getClock();
47 }} // namespace simgrid::sgo
49 #endif /* SIMGRID_S4U_ENGINE_HPP */