+
+ routing::NetZoneImpl* get_netzone_root() const { return netzone_root_; }
+
+ void add_daemon(actor::ActorImpl* d) { daemons_.insert(d); }
+ void remove_daemon(actor::ActorImpl* d);
+ void add_actor_to_run_list(actor::ActorImpl* actor);
+ void add_actor_to_run_list_no_check(actor::ActorImpl* actor);
+ void add_actor_to_destroy_list(actor::ActorImpl& actor) { actors_to_destroy_.push_back(actor); }
+
+ bool has_actors_to_run() const { return not actors_to_run_.empty(); }
+ const actor::ActorImpl* get_first_actor_to_run() const { return actors_to_run_.front(); }
+ const actor::ActorImpl* get_actor_to_run_at(unsigned long int i) const { return actors_to_run_[i]; }
+ unsigned long int get_actor_to_run_count() const { return actors_to_run_.size(); }
+ size_t get_actor_count() const { return actor_list_.size(); }
+ actor::ActorImpl* get_actor_by_pid(aid_t pid);
+ void add_actor(aid_t pid, actor::ActorImpl* actor) { actor_list_[pid] = actor; }
+ void remove_actor(aid_t pid) { actor_list_.erase(pid); }
+
+ const std::map<aid_t, actor::ActorImpl*>& get_actor_list() const { return actor_list_; }
+ const std::vector<actor::ActorImpl*>& get_actors_to_run() const { return actors_to_run_; }
+ const std::vector<actor::ActorImpl*>& get_actors_that_ran() const { return actors_that_ran_; }
+
+ void handle_ended_actions() const;
+ /**
+ * Garbage collection
+ *
+ * Should be called some time to time to free the memory allocated for actors that have finished (or killed).
+ */
+ void empty_trash();
+ void display_all_actor_status() const;
+ void run_all_actors();
+
+ /* @brief Finish simulation initialization
+ * This function must be called before the first call to solve()
+ */
+ void presolve() const;
+ /** @brief Performs a part of the simulation
+ * @param max_date Maximum date to update the simulation to, or -1
+ * @return the elapsed time, or -1.0 if no event could be executed
+ *
+ * This function execute all possible events, update the action states and returns the time elapsed.
+ * When you call execute or communicate on a model, the corresponding actions are not executed immediately but only
+ * when you call solve().
+ * Note that the returned elapsed time can be zero.
+ */
+ double solve(double max_date) const;
+
+ /** @brief Run the main simulation loop until the specified date (or infinitly if max_date is negative). */
+ void run(double max_date);
+
+ /** @brief Return the current time in milliseconds. */
+ static double get_clock();