Atoms Crowd  7.0.0
AgentsSimulations.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <Atoms/Globals.h>
11 #include <Atoms/AgentsSimulation.h>
12 #include <map>
13 #include <vector>
14 
15 namespace Atoms
16 {
18  class ATOMS_EXPORT AgentsSimulations
19  {
20  public:
21 
22  typedef std::map<std::string, AtomsPtr<AgentsSimulation>> AgentsSimulationMap;
23 
26 
28 
32  AtomsPtr<AgentsSimulation> agentsSimulation(const std::string& simName);
33 
35 
39  void addAgentsSimulation(const std::string& name, AtomsPtr<AgentsSimulation>& agentSim, bool replace = true);
40 
42 
45  void removeAgentsSimulation(const std::string& name);
46 
48 
51  std::vector<std::string> agentsSimulationNames();
52 
54 
58  bool agentsSimulationExists(const std::string& name);
59 
61  unsigned int numAgentsSimulation();
62 
64  void clear();
65 
66  AgentsSimulationMap::iterator begin();
67 
68  AgentsSimulationMap::iterator end();
69 
70  AgentsSimulationMap::const_iterator cbegin() const;
71 
72  AgentsSimulationMap::const_iterator cend() const;
73 
74  private:
75 
78 
81 
84 
86  AgentsSimulations& operator=(const AgentsSimulations&);
87 
88 
89 
91 
94  AgentsSimulationMap m_agentsSimulationsMap;
95  };
96 }
Container for all AgentSimulation instances.
Definition: AgentsSimulations.h:19
void clear()
Removes all agent simulations.
std::vector< std::string > agentsSimulationNames()
Gets all agent simulation names.
AtomsPtr< AgentsSimulation > agentsSimulation(const std::string &simName)
Gets an agent simulation by name.
bool agentsSimulationExists(const std::string &name)
Checks if an agent simulation with the given name exists.
void removeAgentsSimulation(const std::string &name)
Removes the agent simulation with the given name.
unsigned int numAgentsSimulation()
Gets the number of agent simulations.
static AgentsSimulations & instance()
Singleton access.
void addAgentsSimulation(const std::string &name, AtomsPtr< AgentsSimulation > &agentSim, bool replace=true)
Adds an agent simulation.
Atoms namespace.
Definition: Agent.h:29