hivemind 1.0.0
Loading...
Searching...
No Matches
CompileScenario::Scenario Class Reference

The Scenario class represents a scenario with keyframes and routes. More...

#include <scenario.h>

Inheritance diagram for CompileScenario::Scenario:
Inheritance graph
Collaboration diagram for CompileScenario::Scenario:
Collaboration graph

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.
 
RouteMapCompile ()
 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::KeyframeManagerm_KeyframeManager
 
std::vector< Core::Agentm_Agents
 
RouteMap m_Routes
 
std::unique_ptr< Routemaker::Routemakerm_Routemaker
 
std::string m_Name
 
Core::GeographicalCoordinate m_Origin
 
int m_Size
 

Detailed Description

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.

Member Typedef Documentation

◆ RouteMap

using CompileScenario::Scenario::RouteMap = std::map<int, std::vector<std::vector<Core::CartesianCoordinate> >>

Definition at line 24 of file scenario.h.

Constructor & Destructor Documentation

◆ Scenario()

CompileScenario::Scenario::Scenario ( std::string  name,
Core::GeographicalCoordinate  origin,
int  size 
)

Constructs a new Scenario object with the given name, origin, and size.

Parameters
nameThe name of the scenario.
originThe geographical coordinates of the origin.
sizeThe 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().

Here is the call graph for this function:

Member Function Documentation

◆ AddAgent()

void CompileScenario::Scenario::AddAgent ( Core::Agent  newAgent)

Definition at line 84 of file scenario.cpp.

◆ Compile()

Scenario::RouteMap & CompileScenario::Scenario::Compile ( )

Compiles the scenario into a map of routes.

Returns
A map of routes.

Definition at line 39 of file scenario.cpp.

References KeyframeManagement::KeyframeManager::GetKeyframes(), m_KeyframeManager, m_Routes, and Core::Keyframe::TimeStamp.

Here is the call graph for this function:

◆ GetAgents()

std::pair< std::vector< Core::Agent >::iterator, std::vector< Core::Agent >::iterator > CompileScenario::Scenario::GetAgents ( )
inline

Definition at line 57 of file scenario.h.

References m_Agents.

◆ GetRoutes()

std::pair< RouteMap::iterator, RouteMap::iterator > CompileScenario::Scenario::GetRoutes ( )
inline

Definition at line 49 of file scenario.h.

References m_Routes.

◆ JSONINT()

JSONSTART CompileScenario::Scenario::JSONINT ( m_Size  )
private

◆ JSONMEMBER()

JSONSTART CompileScenario::Scenario::JSONMEMBER ( Core::GeographicalCoordinate  ,
m_Origin   
)
private

◆ JSONMEMBERVECTOR()

JSONSTART CompileScenario::Scenario::JSONMEMBERVECTOR ( Core::Agent  ,
m_Agents   
)
private

◆ JSONSTRING()

JSONSTART CompileScenario::Scenario::JSONSTRING ( m_Name  )
private

◆ load()

void CompileScenario::Scenario::load ( std::string  filename)

Loads a scenario from a file with the given filename.

Parameters
filenameThe name of the file to load from.

Definition at line 96 of file scenario.cpp.

References Json::deserialize().

Here is the call graph for this function:

◆ save()

void CompileScenario::Scenario::save ( std::string  filename)

Saves the scenario to a file with the given filename.

Parameters
filenameThe name of the file to save to.

Definition at line 90 of file scenario.cpp.

References Json::serialize().

Here is the call graph for this function:

◆ SetOrigin()

void CompileScenario::Scenario::SetOrigin ( Core::GeographicalCoordinate  GeoCoord,
int  size 
)

Sets the origin of the scenario to the given geographical coordinates and size.

Parameters
GeoCoordThe geographical coordinates of the origin.
sizeThe 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().

Here is the call graph for this function:

Member Data Documentation

◆ m_Agents

std::vector<Core::Agent> CompileScenario::Scenario::m_Agents
private

Definition at line 74 of file scenario.h.

Referenced by GetAgents().

◆ m_KeyframeManager

KeyframeManagement::KeyframeManager& CompileScenario::Scenario::m_KeyframeManager
private

Definition at line 73 of file scenario.h.

Referenced by Compile().

◆ m_Name

std::string CompileScenario::Scenario::m_Name
private

Definition at line 77 of file scenario.h.

◆ m_Origin

Core::GeographicalCoordinate CompileScenario::Scenario::m_Origin
private

Definition at line 78 of file scenario.h.

Referenced by SetOrigin().

◆ m_Routemaker

std::unique_ptr<Routemaker::Routemaker> CompileScenario::Scenario::m_Routemaker
private

Definition at line 76 of file scenario.h.

Referenced by Scenario(), and SetOrigin().

◆ m_Routes

RouteMap CompileScenario::Scenario::m_Routes
private

Definition at line 75 of file scenario.h.

Referenced by Compile(), and GetRoutes().

◆ m_Size

int CompileScenario::Scenario::m_Size
private

Definition at line 79 of file scenario.h.

Referenced by SetOrigin().


The documentation for this class was generated from the following files: