|
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. | |
| TPGGraph (const TPGGraph &model)=delete | |
| delete copy constructor | |
| TPGGraph (TPGGraph &&model) noexcept | |
| TPGGraph move assignment operator. | |
| TPGGraph & | operator= (TPGGraph model) |
| assignement operator for class TPGGraph | |
| virtual | ~TPGGraph () |
| Destructor for the TPGGraph. | |
| void | clear () |
| Empty the TPGGraph of all its content. | |
| const Environment & | getEnvironment () const |
| Accessor to the Environment of the TPGGraph. | |
| const TPGFactory & | getFactory () const |
| Get a reference to the TPGFactory of the TPGGraph. | |
| const TPGTeam & | addNewTeam () |
| Create a new TPGTeam and add it to the vertices of the TPGGraph. | |
| const TPGAction & | addNewAction (uint64_t actionID) |
| Create a new TPGAction and add it to the vertices of the TPGGraph. | |
| size_t | getNbVertices () const |
| Get the number of TPGVertex contained in the TPGGraph. | |
| const std::vector< const TPGVertex * > | getVertices () const |
| Get vector of const pointer to the vertices of the TPGGraph. | |
| uint64_t | getNbRootVertices () const |
| Get the number of rootVertices of the TPGGraph. | |
| const std::vector< const TPGAction * > | getRootActions () const |
| Get vector of const pointer to the root actions of the TPGGraph. | |
| const std::vector< const TPGTeam * > | getRootTeams () const |
| Get vector of const pointer to the root teams of the TPGGraph. | |
| const std::vector< const TPGVertex * > | getRootVertices () const |
| Get vector of const pointer to the root vertices of the TPGGraph. | |
| bool | hasVertex (const TPG::TPGVertex &vertex) const |
| Check whether a given vertex exists in the TPGGraph. | |
| void | removeVertex (const TPGVertex &vertex) |
| Remove a TPGVertex from the TPGGraph and destroy it. | |
| const TPGVertex & | cloneVertex (const TPGVertex &vertex) |
| Clone a TPGVertex of the graph and all its outgoing TPGEdge. | |
| const TPGEdge & | addNewEdge (const TPGVertex &src, const TPGVertex &dest, const std::shared_ptr< Program::Program > prog) |
| Add a new TPGEdge to the TPGGraph. | |
| const TPGEdge & | addNewActionEdge (const TPGVertex &src, const std::shared_ptr< Program::Program > prog, uint64_t actionClass) |
| Add a new TPGActionEdge to the TPGGraph. | |
| const std::set< std::unique_ptr< TPG::TPGEdge >, UniqueLess< TPG::TPGEdge > > & | getEdges () const |
| Get a const reference to the edges of the TPGGraph. | |
| void | removeEdge (const TPGEdge &edge) |
| Remove a TPGEdge from the TPGGraph. | |
| void | removeActionEdge (const TPGEdge &edge) |
| Remove a TPGActionEdge from the TPGGraph. | |
| const TPGEdge & | cloneEdge (const TPGEdge &edge) |
| bool | setEdgeDestination (const TPGEdge &edge, const TPGVertex &newDest) |
| Change the destination of the Edge to the given target. | |
| bool | setEdgeSource (const TPGEdge &edge, const TPGVertex &newSrc) |
| Change the source of the TPGEdge to the given vertex. | |
| void | clearProgramIntrons () |
| Clear all intron instructions in the Program of the TPGGraph. | |
| void | setActionClassEdge (const TPGEdge *edge, uint64_t newActionClass) |
| set a new action class to a TPGActionEdge | |
| void | updateAssessedActions (const TPG::TPGVertex *vertex) |
| void | updateAllAssessedActions () |
| void | orderActionEdges (const TPG::TPGAction *action) |
| void | setNewVertexID (const TPG::TPGVertex &vertex, uint64_t newID) |
| Set a new ID to a vertex. | |
| void | setNewEdgeID (const TPG::TPGEdge &edge, uint64_t newID) |
| Set a new ID to an edge. | |
Protected Attributes | |
| const Environment & | env |
| Environment of the TPGGraph. | |
| const std::unique_ptr< TPGFactory > | factory |
| TPGFactory of the TPGGraph. | |
| std::set< std::unique_ptr< TPGEdge >, UniqueLess< TPGEdge > > | edges |
| Set of all edges currently used in the graph. | |
| std::set< std::unique_ptr< TPGVertex >, UniqueLess< TPGVertex > > | vertices |
| Set of all vertices currently used in the graph. | |
Friends | |
| void | swap (TPGGraph &a, TPGGraph &b) |
| Helper function for move constructor. | |
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 - 2025) :
Karol Desnos kdesn.nosp@m.os@i.nosp@m.nsa-r.nosp@m.enne.nosp@m.s.fr (2019 - 2023) Nicolas Sourbier nsour.nosp@m.bie@.nosp@m.insa-.nosp@m.renn.nosp@m.es.fr (2019 - 2020) Quentin Vacher qvach.nosp@m.er@i.nosp@m.nsa-r.nosp@m.enne.nosp@m.s.fr (2024 - 2025)
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::addNewActionEdge | ( | const TPGVertex & | src, |
| const std::shared_ptr< Program::Program > | prog, | ||
| uint64_t | actionClass ) |
Add a new TPGActionEdge to the TPGGraph.
Add a new TPGActionEdge to the TPGGraph, between the give vertex is associated the given Program. The newly created TPGEdge is inserted in the outgoing edges list of the connected TPGVertex. The TPGActionEdge is created using the TPGFactory of the TPGGraph.
| [in] | src | the source TPGVertex of the newly created TPGEdge. |
| [in] | prog | shared pointer to the Program associated to the newly created TPGEdge. |
| [in] | actionClass | of the actionEdge |
| 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 | ) |
| const std::set< std::unique_ptr< TPG::TPGEdge >, UniqueLess< 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::TPGAction * > TPG::TPGGraph::getRootActions | ( | ) | const |
| const std::vector< const TPG::TPGTeam * > TPG::TPGGraph::getRootTeams | ( | ) | 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::orderActionEdges | ( | const TPG::TPGAction * | action | ) |
Order the ActionEdge of the given action
| [in] | action | TPGAction to order |
| void TPG::TPGGraph::removeActionEdge | ( | const TPGEdge & | edge | ) |
Remove a TPGActionEdge from the TPGGraph.
If the edge is connected to TPGVertex within the graph, they are updated.
| [in] | edge | a const reference to the TPGActionEdge to remove. |
| std::runtime_error | In case one of the TPGEdges does not exist in the TPGGraph. |
| void TPG::TPGGraph::removeEdge | ( | const TPGEdge & | edge | ) |
| void TPG::TPGGraph::removeVertex | ( | const TPGVertex & | vertex | ) |
| void TPG::TPGGraph::setActionClassEdge | ( | const TPGEdge * | edge, |
| uint64_t | newActionClass ) |
set a new action class to a TPGActionEdge
| [in] | edge | TPGActionEdge changed |
| [in] | newActionClass | new action class |
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. |
| void TPG::TPGGraph::setNewEdgeID | ( | const TPG::TPGEdge & | edge, |
| uint64_t | newID ) |
Set a new ID to an edge.
An error is thrown if the edge does not belong to the graph An error is thrown if the newID is already used
| [in] | edge | the edge to change ID |
| [in] | newID | the new ID to set |
| void TPG::TPGGraph::setNewVertexID | ( | const TPG::TPGVertex & | vertex, |
| uint64_t | newID ) |
Set a new ID to a vertex.
An error is thrown if the vertex does not belong to the graph An error is thrown if the newID is already used
| [in] | vertex | the vertex to change ID |
| [in] | newID | the new ID to set |
| void TPG::TPGGraph::updateAllAssessedActions | ( | ) |
Update the assessed actions of the all graph.
This is to be use only at the initialisation, the complexity could be really high after
This method basically execute "updateAssessedActions" for all the TPGActions in the graph
| void TPG::TPGGraph::updateAssessedActions | ( | const TPG::TPGVertex * | vertex | ) |
Helper function for move constructor.
Swaps the TPGGraphs objects.