Public Member Functions | Static Public Member Functions | List of all members
XMLLogger Class Reference

XMLLogger class implements interface for system state logging to XML-file. More...

#include <XMLLogger.h>

Inheritance diagram for XMLLogger:
Inheritance graph
[legend]

Public Member Functions

XMLLoggerClone () const override
 Method for cloning objects. Implementations of this method creates copy of object in memmory and return pointer to copy. More...
 
bool GenerateLog () override
 Method for creating final log in XML-file. More...
 
void SetResults (const std::unordered_map< int, std::vector< Point >> &stepsLog, const std::unordered_map< int, std::vector< Point >> &goalsLog, const std::unordered_map< int, std::pair< bool, int >> &resultsLog) override
 Sets full information about execution, including states on each step, curren goals on each step, success of each agent. More...
 
void SetSummary (const Summary &res) override
 Sets brief information about execution results. More...
 
 XMLLogger ()
 XMLLogger default constructor. More...
 
 XMLLogger (std::string fileName, std::string inpFileName)
 XMLLogger constructor. More...
 
 XMLLogger (const XMLLogger &obj)
 XMLLogger copy constructor. More...
 
 ~XMLLogger () override
 XMLLogger destructor. More...
 
- Public Member Functions inherited from Logger
virtual ~Logger ()
 Logger virtual destructor. More...
 

Static Public Member Functions

static std::string GenerateLogFileName (std::string inpFileName, int agentsNum)
 Creates a string of form "inpFileName_agentsNum_log.xml". More...
 

Detailed Description

XMLLogger class implements interface for system state logging to XML-file.

Log contains the full information about the execution of task. It includes same tags as input file, summary and information about each step of each agent. Summary contains the main information about the execution of tasks. Summary includes following tags:

Summary example:

1 <summary successrate="100" runtime="1.061" makespan="170.90001" flowtime="477.60001" collisions="0" collisionsobst="0"/>

Agent's path example:

1 <agent number="0">
2  <path pathfound="true" steps="4">
3  <step number="0" x="33.18066" y="9.1728058"/>
4  <step number="1" x="33.36132" y="9.3456116"/>
5  <step number="2" x="33.541981" y="9.5184174"/>
6  <step number="3" x="33.722641" y="9.6912231"/>
7  </path>
8 </agent>

Definition at line 56 of file XMLLogger.h.

Constructor & Destructor Documentation

XMLLogger::XMLLogger ( )

XMLLogger default constructor.

Definition at line 143 of file XMLLogger.cpp.

XMLLogger::XMLLogger ( std::string  fileName,
std::string  inpFileName 
)

XMLLogger constructor.

Parameters
fileNamePath to output log file.
inpFileNamePath to input file to copy to output.

Definition at line 9 of file XMLLogger.cpp.

XMLLogger::XMLLogger ( const XMLLogger obj)

XMLLogger copy constructor.

Parameters
objObject to copy.

Definition at line 21 of file XMLLogger.cpp.

XMLLogger::~XMLLogger ( )
override

XMLLogger destructor.

Definition at line 31 of file XMLLogger.cpp.

Member Function Documentation

XMLLogger * XMLLogger::Clone ( ) const
overridevirtual

Method for cloning objects. Implementations of this method creates copy of object in memmory and return pointer to copy.

Returns
Pointer to copy of object

Implements Logger.

Definition at line 152 of file XMLLogger.cpp.

bool XMLLogger::GenerateLog ( )
overridevirtual

Method for creating final log in XML-file.

Returns
Succsess of log creating.

Implements Logger.

Definition at line 39 of file XMLLogger.cpp.

std::string XMLLogger::GenerateLogFileName ( std::string  inpFileName,
int  agentsNum 
)
static

Creates a string of form "inpFileName_agentsNum_log.xml".

Parameters
inpFileNamePath to input XML-file to insert into result string.
agentsNumNumber of agents to insert into result string.
Returns
String of form "inpFileName_agentsNum_log.xml"

Definition at line 106 of file XMLLogger.cpp.

void XMLLogger::SetResults ( const std::unordered_map< int, std::vector< Point >> &  stepsLog,
const std::unordered_map< int, std::vector< Point >> &  goalsLog,
const std::unordered_map< int, std::pair< bool, int >> &  resultsLog 
)
overridevirtual

Sets full information about execution, including states on each step, curren goals on each step, success of each agent.

Parameters
stepsLogAgent states on each step.
goalsLogAgent curren goals on each step.
resultsLogSuccess of each agent and number of steps of each agent.

Implements Logger.

Definition at line 66 of file XMLLogger.cpp.

void XMLLogger::SetSummary ( const Summary res)
overridevirtual

Sets brief information about execution results.

Parameters
resExecution results in brief form.

Implements Logger.

Definition at line 50 of file XMLLogger.cpp.


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


ORCAStar
Author(s): Stepan Drgachev
autogenerated on Wed Jul 15 2020 16:13:14