Class DataCollection::AgentReceiver
ClassList > DataCollection > AgentReceiver
Data receiver class specialized for storing AgentData objects.More...
#include <AgentReciever.hpp>
Inherits the following classes: DataCollection::DataReceiver
Public Functions
Type | Name |
---|---|
void | AddAgent (const std::string & name) Stores agent data into the storage and writes to a json file. |
std::shared_ptr< AgentData > | GetAgent (const std::string & name) |
AgentData | GetAgentData (const std::string & name) |
void | StoreData (std::string name, cse491::GridPosition pos, int last_action) Stores a grid position and last action ID associated with an agent. |
void | WriteToPositionFile (std::string path) Writes the stored AgentData Positions to a JSON file. |
Public Functions inherited from DataCollection::DataReceiver
See DataCollection::DataReceiver
Type | Name |
---|---|
DataReceiver () = default Default constructor for DataReceiver class. |
|
bool | IsEmpty () Checks if the storage is empty. |
void | StoreIntoStorage (T obj) Store a data object into the storage. |
std::vector< T > & | getStorage () Retrieves the stored data objects. |
virtual | ~DataReceiver () = default Virtual destructor for DataReceiver class. |
Protected Attributes inherited from DataCollection::DataReceiver
See DataCollection::DataReceiver
Type | Name |
---|---|
std::vector< T > | storage Vector to store shared_ptr data objects of type T. |
Detailed Description
This class extends DataReceiver class and provides specific functionality for storing AgentData objects along with grid positions and last action IDs.
Public Functions Documentation
function AddAgent
Stores agent data into the storage and writes to a json file.
inline void DataCollection::AgentReceiver::AddAgent (
const std::string & name
)
Parameters:
name
the name of the agent
function GetAgent
inline std::shared_ptr< AgentData > DataCollection::AgentReceiver::GetAgent (
const std::string & name
)
function GetAgentData
inline AgentData DataCollection::AgentReceiver::GetAgentData (
const std::string & name
)
function StoreData
Stores a grid position and last action ID associated with an agent.
inline void DataCollection::AgentReceiver::StoreData (
std::string name,
cse491::GridPosition pos,
int last_action
)
Parameters:
pos
The grid position to be stored.last_action
The last action ID associated with the agent.
function WriteToPositionFile
Writes the stored AgentData Positions to a JSON file.
inline void DataCollection::AgentReceiver::WriteToPositionFile (
std::string path
)
Parameters:
agent
The AgentData Position to be stored.
The documentation for this class was generated from the following file source/DataCollection/AgentReciever.hpp