![]() |
hivemind 1.0.0
|
The Scenario class represents a scenario with keyframes and routes. More...
#include <scenario.h>
Public Types | |
using | RouteMap = std::map< int, std::vector< std::vector< Core::CartesianCoordinate > > > |
Public Member Functions | |
Scenario (std::string name, Core::GeographicalCoordinate origin, int size) | |
Constructs a new Scenario object with the given name, origin, and size. | |
RouteMap & | Compile () |
Compiles the scenario into a map of routes. | |
void | save (std::string filename) |
Saves the scenario to a file with the given filename. | |
void | load (std::string filename) |
Loads a scenario from a file with the given filename. | |
std::pair< RouteMap::iterator, RouteMap::iterator > | GetRoutes () |
std::pair< std::vector< Core::Agent >::iterator, std::vector< Core::Agent >::iterator > | GetAgents () |
void | AddAgent (Core::Agent newAgent) |
void | SetOrigin (Core::GeographicalCoordinate GeoCoord, int size) |
Sets the origin of the scenario to the given geographical coordinates and size. | |
Private Member Functions | |
JSONSTART | JSONSTRING (m_Name) |
JSONSTART | JSONMEMBER (Core::GeographicalCoordinate, m_Origin) |
JSONSTART | JSONINT (m_Size) |
JSONSTART | JSONMEMBERVECTOR (Core::Agent, m_Agents) |
Private Attributes | |
KeyframeManagement::KeyframeManager & | m_KeyframeManager |
std::vector< Core::Agent > | m_Agents |
RouteMap | m_Routes |
std::unique_ptr< Routemaker::Routemaker > | m_Routemaker |
std::string | m_Name |
Core::GeographicalCoordinate | m_Origin |
int | m_Size |
The Scenario class represents a scenario with keyframes and routes.
The Scenario class provides functionality for creating a scenario with keyframes and routes, as well as saving and loading the scenario to and from file.
Definition at line 21 of file scenario.h.
using CompileScenario::Scenario::RouteMap = std::map<int, std::vector<std::vector<Core::CartesianCoordinate> >> |
Definition at line 24 of file scenario.h.
CompileScenario::Scenario::Scenario | ( | std::string | name, |
Core::GeographicalCoordinate | origin, | ||
int | size | ||
) |
Constructs a new Scenario object with the given name, origin, and size.
name | The name of the scenario. |
origin | The geographical coordinates of the origin. |
size | The size of the scenario. |
Definition at line 11 of file scenario.cpp.
References CoordinateConverter::CoordConv::GeographicToUTM(), MapManagement::MapManager::GetMap(), m_Routemaker, and CoordinateConverter::CoordConv::ResetOrigin().
void CompileScenario::Scenario::AddAgent | ( | Core::Agent | newAgent | ) |
Definition at line 84 of file scenario.cpp.
Scenario::RouteMap & CompileScenario::Scenario::Compile | ( | ) |
Compiles the scenario into a map of routes.
Definition at line 39 of file scenario.cpp.
References KeyframeManagement::KeyframeManager::GetKeyframes(), m_KeyframeManager, m_Routes, and Core::Keyframe::TimeStamp.
|
inline |
Definition at line 57 of file scenario.h.
References m_Agents.
|
inline |
Definition at line 49 of file scenario.h.
References m_Routes.
|
private |
|
private |
void CompileScenario::Scenario::load | ( | std::string | filename | ) |
Loads a scenario from a file with the given filename.
filename | The name of the file to load from. |
Definition at line 96 of file scenario.cpp.
References Json::deserialize().
void CompileScenario::Scenario::save | ( | std::string | filename | ) |
Saves the scenario to a file with the given filename.
filename | The name of the file to save to. |
Definition at line 90 of file scenario.cpp.
References Json::serialize().
void CompileScenario::Scenario::SetOrigin | ( | Core::GeographicalCoordinate | GeoCoord, |
int | size | ||
) |
Sets the origin of the scenario to the given geographical coordinates and size.
GeoCoord | The geographical coordinates of the origin. |
size | The size of the scenario. |
Definition at line 27 of file scenario.cpp.
References CoordinateConverter::CoordConv::GeographicToUTM(), MapManagement::MapManager::GetMap(), m_Origin, m_Routemaker, m_Size, and CoordinateConverter::CoordConv::ResetOrigin().
|
private |
Definition at line 74 of file scenario.h.
Referenced by GetAgents().
|
private |
Definition at line 73 of file scenario.h.
Referenced by Compile().
|
private |
Definition at line 77 of file scenario.h.
|
private |
Definition at line 78 of file scenario.h.
Referenced by SetOrigin().
|
private |
Definition at line 76 of file scenario.h.
Referenced by Scenario(), and SetOrigin().
|
private |
Definition at line 75 of file scenario.h.
Referenced by Compile(), and GetRoutes().
|
private |
Definition at line 79 of file scenario.h.
Referenced by SetOrigin().