ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
Go to the documentation of this file.
36 #include <argos3/core/config.h>
37 #include <argos3/core/utility/math/rng.h>
38 #include <argos3/core/utility/configuration/argos_configuration.h>
39 #include <argos3/core/utility/datatypes/datatypes.h>
40 #include <argos3/core/simulator/physics_engine/physics_engine.h>
41 #include <argos3/core/simulator/medium/medium.h>
120 return m_vecPhysicsEngines;
128 template <
typename T>
130 CMedium::TMap::const_iterator it = m_mapMedia.find(str_id);
131 if(it != m_mapMedia.end()) {
132 T* pcMedium =
dynamic_cast<T*
>(it->second);
133 if(pcMedium != NULL) {
158 ARGOS_ASSERT(m_pcVisualization != NULL,
"No visualization specified in the XML file.");
159 return *m_pcVisualization;
167 return m_tConfigurationRoot;
175 return *m_pcProfiler;
183 return m_pcProfiler != NULL;
192 return m_unRandomSeed;
201 m_unRandomSeed = un_random_seed;
202 m_bWasRandomSeedSet =
true;
220 return m_strExperimentConfigFileName;
229 m_strExperimentConfigFileName = str_file_name;
237 return *m_pcLoopFunctions;
245 m_pcLoopFunctions = &c_loop_functions;
253 return m_unMaxSimulationClock;
269 return m_bRealTimeClock;
277 m_bRealTimeClock = b_real_time;
284 m_bTerminated =
true;
293 return ARGOS_INSTALL_PREFIX;
379 typedef std::map<std::string, TConfigurationNode*> TControllerConfigurationMap;
386 TControllerConfigurationMap m_mapControllerConfig;
426 std::string m_strExperimentConfigFileName;
431 UInt32 m_unMaxSimulationClock;
448 bool m_bWasRandomSeedSet;
453 ticpp::Document m_tConfiguration;
473 bool m_bHumanReadableProfile;
478 bool m_bRealTimeClock;
static CSimulator & GetInstance()
Returns the instance to the CSimulator class.
void Terminate()
Puts an end to the simulation.
The namespace containing all the ARGoS related code.
CVisualization & GetVisualization()
Returns a reference to the visualization.
void Init()
Initializes the experiment.
void SetExperimentFileName(const std::string &str_file_name)
Sets the name of the XML configuration file parsed by Load().
bool IsRealTimeClock() const
Returns true if the clock tick follows the real time.
std::string GetInstallationDirectory() const
Returns the base directory in which the ARGoS core was installed.
UInt32 GetRandomSeed() const
Returns the random seed of the "argos" category of the random seed.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
void Reset(UInt32 un_new_random_seed)
Resets the experiment.
TConfigurationNode & GetConfigForController(const std::string &str_id)
Returns the XML portion relative to the controller with the given ID.
void LoadExperiment()
Loads the XML configuration file.
CSpace & GetSpace() const
Returns a reference to the simulated space.
std::map< std::string, CMedium * > TMap
void SetRandomSeed(UInt32 un_random_seed)
Sets the random seed of the "argos" category of the random seed.
CProfiler & GetProfiler()
Returns a reference to the profiler.
std::vector< CMedium * > TVector
TConfigurationNode & GetConfigurationRoot()
Returns a reference to the root node of the parsed XML configuration file.
#define THROW_ARGOSEXCEPTION(message)
This macro throws an ARGoS exception with the passed message.
CMedium::TVector & GetMedia()
Returns the list of currently existing media.
void SetLoopFunctions(CLoopFunctions &c_loop_functions)
Asociates loop functions to the current experiment.
CPhysicsEngine::TVector & GetPhysicsEngines()
Returns the list of currently existing physics engines.
~CSimulator()
Class destructor.
CRandom::CRNG * GetRNG()
Returns the random generator of the "argos" category.
CLoopFunctions & GetLoopFunctions()
Returns a reference to the loop functions associated to the current experiment.
bool IsProfiling() const
Returns true if ARGoS is being profiled.
#define ARGOS_ASSERT(condition, message)
When code is compiled in debug, this macro throws an ARGoS exception with the passed message if the s...
unsigned int UInt32
32-bit unsigned integer.
bool IsExperimentFinished() const
Returns true if the experiment has finished.
void UpdateSpace()
Performs an update step of the space.
void SetRealTimeClock(bool b_real_time)
When passed true, the clock tick follows the real time.
const std::string & GetExperimentFileName() const
Returns the name of the XML configuration file parsed by Load().
std::vector< CPhysicsEngine * > TVector
void Reset()
Resets the experiment.
void Execute()
Executes the simulation loop.
A set of hook functions to customize an experimental run.
CPhysicsEngine & GetPhysicsEngine(const std::string &str_id) const
Returns a reference to a physics engine.
void Destroy()
Undoes whatever was done by Init().
UInt32 GetMaxSimulationClock() const
Returns the time limit on this experiment.
T & GetMedium(const std::string &str_id)
Returns a reference to a medium.
UInt32 GetNumThreads() const
Returns the number of threads used during the experiment.
std::map< std::string, CPhysicsEngine *, std::less< std::string > > TMap