GEGELATI
|
Class used to export a TPGGraph into a text file with the dot format. More...
#include <tpgGraphDotExporter.h>
Public Member Functions | |
TPGGraphDotExporter (const char *filePath, const TPG::TPGGraph &graph) | |
Constructor for the exporter. More... | |
TPGGraphDotExporter (const TPGGraphDotExporter &other)=delete | |
TPGGraphDotExporter & | operator= (const TPGGraphDotExporter &other)=delete |
~TPGGraphDotExporter () | |
void | setNewFilePath (const char *newFilePath) |
Set a new file for the exporter. More... | |
void | print () |
Print the TPGGraph given when constructing the TPGGraphDotExporter into a dot file. | |
Protected Member Functions | |
void | printTPGTeam (const TPG::TPGTeam &team) |
Print the dot content for the given TPGTeam. More... | |
uint64_t | printTPGAction (const TPG::TPGAction &action) |
Print the dot content for the given TPGAction. More... | |
void | printTPGEdge (const TPG::TPGEdge &edge) |
Prints the dot content for the given TPGEdge. Prints the program index followed by its contants if the constants are used. More... | |
void | printProgram (const Program::Program &program) |
Prints the dot content for the given Program. More... | |
void | printTPGGraphHeader () |
Prints header content in the dot file. More... | |
void | printTPGGraphFooter () |
Prints footer content in the dot file. More... | |
Protected Attributes | |
FILE * | pFile |
File in which the dot content is written during export. | |
std::string | offset |
Character chain used to control the indentation of the exported file. | |
Class used to export a TPGGraph into a text file with the dot format.
|
inline |
Constructor for the exporter.
[in] | filePath | initial path to the file where the dot content will be written. |
[in] | graph | const reference to the graph whose content will be exported in dot. |
std::runtime_error | in case no file could be opened at the given filePath. |
|
delete |
Disable copy construction.
Until we see the need for it, there si no reason to enable copy-construction of TPGGraphDotExporter.
|
inline |
Destructor for the exporter.
Closes the file.
|
delete |
Disable TPGGraphDotExporter default assignment operator.
Until we see the need for it, there si no reason to enable assignment operator of TPGGraphDotExporter.
|
protected |
Prints the dot content for the given Program.
[in] | program | the Program to be printed |
a program is stored in the .dot file with the format : line_1\nline2\nline3\n...\nline_N\n
a line is stored in the .dot file with the following format inst_idx|dest_idx&op1_param1|op1_param2#...#
inst_idx = instruction index dest_idx = destination index op = operand
|
protected |
Print the dot content for the given TPGAction.
Content is printed directly into the file opened by the class constructor, or by a call to setNewFilePath. This method returns the identifier associated to the printed action so that the print TPGEdge method can target this TPGAction. Indeed, contrary to TPGTeam which have a unique ID, each action is printed on the fly, with a unique ID, when a TPGEdge is targetting this action.
[in] | action | the TPGTeam being printed. |
|
protected |
Prints the dot content for the given TPGEdge. Prints the program index followed by its contants if the constants are used.
the program is printed under the format : Pindex [fillcolor=#cccccc shape = point] //constant1|...|constant_n
[in] | edge | the TPGEdge being printed. |
|
protected |
Prints footer content in the dot file.
This method prints finalization content that must be printed into the dot file after all vertices and edges.
|
protected |
Prints header content in the dot file.
This method prints preliminary content that must be printed into the dot file before any vertex or edge.
|
protected |
Print the dot content for the given TPGTeam.
Content is printed directly into the file opened by the class constructor, or by a call to setNewFilePath.
[in] | team | the TPGTeam being printed. |
Copyright or © or Copr. IETR/INSA - Rennes (2019 - 2021) :
Karol Desnos kdesn.nosp@m.os@i.nosp@m.nsa-r.nosp@m.enne.nosp@m.s.fr (2019 - 2020) Nicolas Sourbier nsour.nosp@m.bie@.nosp@m.insa-.nosp@m.renn.nosp@m.es.fr (2019 - 2020) Thomas Bourgoin tbour.nosp@m.goi@.nosp@m.insa-.nosp@m.renn.nosp@m.es.fr (2021)
GEGELATI is an open-source reinforcement learning framework for training artificial intelligence based on Tangled Program Graphs (TPGs).
This software is governed by the CeCILL-C license under French law and abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms.
|
inline |
Set a new file for the exporter.
[in] | newFilePath | new path to the file where the dot content will be written. |
std::runtime_error | in case no file could be opened at the given newFilePath. |