GEGELATI
|
Class for storing a Tangled-Program-Graph. More...
#include <tpgGraph.h>
Public Member Functions | |
TPGGraph (const Environment &e, std::unique_ptr< TPGFactory > f=std::make_unique< TPGFactory >()) | |
Main TPGGraph constructor. More... | |
TPGGraph (const TPGGraph &model)=delete | |
delete copy constructor | |
TPGGraph (TPGGraph &&model) noexcept | |
TPGGraph move assignment operator. More... | |
TPGGraph & | operator= (TPGGraph model) |
assignement operator for class TPGGraph | |
virtual | ~TPGGraph () |
Destructor for the TPGGraph. More... | |
void | clear () |
Empty the TPGGraph of all its content. | |
const Environment & | getEnvironment () const |
Accessor to the Environment of the TPGGraph. More... | |
const TPGFactory & | getFactory () const |
Get a reference to the TPGFactory of the TPGGraph. More... | |
const TPGTeam & | addNewTeam () |
Create a new TPGTeam and add it to the vertices of the TPGGraph. More... | |
const TPGAction & | addNewAction (uint64_t actionID) |
Create a new TPGAction and add it to the vertices of the TPGGraph. More... | |
size_t | getNbVertices () const |
Get the number of TPGVertex contained in the TPGGraph. More... | |
const std::vector< const TPGVertex * > | getVertices () const |
Get vector of const pointer to the vertices of the TPGGraph. More... | |
uint64_t | getNbRootVertices () const |
Get the number of rootVertices of the TPGGraph. More... | |
const std::vector< const TPGVertex * > | getRootVertices () const |
Get vector of const pointer to the root vertices of the TPGGraph. More... | |
bool | hasVertex (const TPG::TPGVertex &vertex) const |
Check whether a given vertex exists in the TPGGraph. More... | |
void | removeVertex (const TPGVertex &vertex) |
Remove a TPGVertex from the TPGGraph and destroy it. More... | |
const TPGVertex & | cloneVertex (const TPGVertex &vertex) |
Clone a TPGVertex of the graph and all its outgoing TPGEdge. More... | |
const TPGEdge & | addNewEdge (const TPGVertex &src, const TPGVertex &dest, const std::shared_ptr< Program::Program > prog) |
Add a new TPGEdge to the TPGGraph. More... | |
const std::list< std::unique_ptr< TPGEdge > > & | getEdges () const |
Get a const reference to the edges of the TPGGraph. More... | |
void | removeEdge (const TPGEdge &edge) |
Remove a TPGEdge from the TPGGraph. More... | |
const TPGEdge & | cloneEdge (const TPGEdge &edge) |
bool | setEdgeDestination (const TPGEdge &edge, const TPGVertex &newDest) |
Change the destination of the Edge to the given target. More... | |
bool | setEdgeSource (const TPGEdge &edge, const TPGVertex &newSrc) |
Change the source of the TPGEdge to the given vertex. More... | |
void | clearProgramIntrons () |
Clear all intron instructions in the Program of the TPGGraph. More... | |
Protected Member Functions | |
std::list< TPGVertex * >::iterator | findVertex (const TPGVertex *vertex) |
Find the non-const iterator to a vertex of the graph from its const pointer. More... | |
std::list< std::unique_ptr< TPGEdge > >::iterator | findEdge (const TPGEdge *edge) |
Find the non-const iterator to an edge of the graph from its const pointer. More... | |
Protected Attributes | |
const Environment & | env |
Environment of the TPGGraph. | |
const std::unique_ptr< TPGFactory > | factory |
TPGFactory of the TPGGraph. | |
std::list< TPGVertex * > | vertices |
Set of TPGVertex composing the TPGGraph. | |
std::list< std::unique_ptr< TPGEdge > > | edges |
Set of TPGEdge composing the TPGGraph. | |
Friends | |
void | swap (TPGGraph &a, TPGGraph &b) |
Helper function for move constructor. More... | |
Class for storing a Tangled-Program-Graph.
|
inline |
Main TPGGraph constructor.
[in] | e | the Environment for the TPGGraph. |
[in] | f | the TPGFactory used to create the graph elements. |
|
inlinenoexcept |
|
virtual |
Destructor for the TPGGraph.
Free the memory allocated for TPGVertices.
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 - 2021) Nicolas Sourbier nsour.nosp@m.bie@.nosp@m.insa-.nosp@m.renn.nosp@m.es.fr (2019 - 2020)
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.
const TPG::TPGAction & TPG::TPGGraph::addNewAction | ( | uint64_t | actionID | ) |
Create a new TPGAction and add it to the vertices of the TPGGraph.
The new TPGAction is added to the back of the vertices list. The TPGAction is created using the TPGFactory of the TPGGraph.
[in] | actionID | the identifier to associate to the TPGAction. |
const TPG::TPGEdge & TPG::TPGGraph::addNewEdge | ( | const TPGVertex & | src, |
const TPGVertex & | dest, | ||
const std::shared_ptr< Program::Program > | prog | ||
) |
Add a new TPGEdge to the TPGGraph.
Add a new TPGEdge to the TPGGraph, between the two given TPGVertex and associated with the given Program. The newly created TPGEdge is inserted in the incoming and outgoing edges lists of the connected TPGVertex. The TPGEdge is created using the TPGFactory of the TPGGraph.
[in] | src | the source TPGVertex of the newly created TPGEdge. |
[in] | dest | the destination TPGVertex of the newly created TPGEdge. |
[in] | prog | shared pointer to the Program associated to the newly created TPGEdge. |
const TPG::TPGTeam & TPG::TPGGraph::addNewTeam | ( | ) |
void TPG::TPGGraph::clearProgramIntrons | ( | ) |
const TPG::TPGEdge & TPG::TPGGraph::cloneEdge | ( | const TPGEdge & | edge | ) |
const TPG::TPGVertex & TPG::TPGGraph::cloneVertex | ( | const TPGVertex & | vertex | ) |
|
protected |
Find the non-const iterator to an edge of the graph from its const pointer.
[in] | edge | the const pointer to the TPGEdge. |
|
protected |
Find the non-const iterator to a vertex of the graph from its const pointer.
[in] | vertex | the const pointer to the TPGVertex. |
const std::list< std::unique_ptr< TPG::TPGEdge > > & TPG::TPGGraph::getEdges | ( | ) | const |
Get a const reference to the edges of the TPGGraph.
const Environment & TPG::TPGGraph::getEnvironment | ( | ) | const |
Accessor to the Environment of the TPGGraph.
const TPG::TPGFactory & TPG::TPGGraph::getFactory | ( | ) | const |
Get a reference to the TPGFactory of the TPGGraph.
uint64_t TPG::TPGGraph::getNbRootVertices | ( | ) | const |
size_t TPG::TPGGraph::getNbVertices | ( | ) | const |
const std::vector< const TPG::TPGVertex * > TPG::TPGGraph::getRootVertices | ( | ) | const |
const std::vector< const TPG::TPGVertex * > TPG::TPGGraph::getVertices | ( | ) | const |
bool TPG::TPGGraph::hasVertex | ( | const TPG::TPGVertex & | vertex | ) | const |
Check whether a given vertex exists in the TPGGraph.
[in] | vertex | the TPG::TPGVertex whose presence in the TPGGraph is checked. |
void TPG::TPGGraph::removeEdge | ( | const TPGEdge & | edge | ) |
void TPG::TPGGraph::removeVertex | ( | const TPGVertex & | vertex | ) |
Change the destination of the Edge to the given target.
Change the destination TPGVertex of a TPGEdge to a given TPGVertex. This function updates the TPGEdge attributes as well as those of all impacted TPGVertex.
[in] | edge | a const reference to the modified TPGEdge. |
[in] | newDest | a const reference to the destination TPGVertex. |
Change the source of the TPGEdge to the given vertex.
Change the source TPGVertex of a TPGEdge to a given TPGVertex. This function updates the TPGEdge attributes as well as those of all impacted TPGVertex.
[in] | edge | a const reference to the modified TPGEdge. |
[in] | newSrc | a const reference to the new source TPGVertex. |
Helper function for move constructor.
Swaps the TPGGraphs objects.