GEGELATI

Loading...
Searching...
No Matches
tpgExecutionEngine.h
1
38#ifndef TPG_EXECUTION_ENGINE_H
39#define TPG_EXECUTION_ENGINE_H
40
41#include <set>
42#include <vector>
43
44#include "archive.h"
45#include "program/programExecutionEngine.h"
46
47#include "tpg/tpgGraph.h"
48
49 namespace TPG {
56 class TPGExecutionEngine
57 {
58 protected:
62 Archive* archive;
63
67 const Environment& env;
68
75 Program::ProgramExecutionEngine progExecutionEngine;
76
77 public:
88 TPGExecutionEngine(const Environment& env, Archive* arch = NULL)
89 : progExecutionEngine(env), env{env}, archive{arch} {};
90
92 virtual ~TPGExecutionEngine() = default;
93
99 void setArchive(Archive* newArchive);
100
106 void applyActivationFunctionOnActions(
107 std::vector<double>& actionsTaken);
108
123 virtual double evaluateEdge(const TPGEdge& edge);
124
140 virtual const TPG::TPGEdge& evaluateTeam(const TPGTeam& team);
141
155 virtual const std::pair<std::vector<const TPG::TPGVertex*>,
156 std::vector<double>>
157 executeFromRoot(const TPGVertex& root,
158 const std::vector<uint64_t>& initActions = {0});
159 };
160}; // namespace TPG
161
162#endif
Archive
Definition archive.h:80
Environment
The Environment class contains all information needed to execute a Program.
Definition environment.h:86
Program::ProgramExecutionEngine
Class in charge of executing a Program within its Environment.
Definition programExecutionEngine.h:53
TPG::TPGEdge
Class representing edges of the Tangled Program Graphs.
Definition tpgEdge.h:54
TPG::TPGExecutionEngine
Definition tpgExecutionEngine.h:57
TPG::TPGExecutionEngine::evaluateTeam
virtual const TPG::TPGEdge & evaluateTeam(const TPGTeam &team)
Evaluate all the Program of the outgoing TPGEdge of the TPGTeam.
Definition tpgExecutionEngine.cpp:108
TPG::TPGExecutionEngine::applyActivationFunctionOnActions
void applyActivationFunctionOnActions(std::vector< double > &actionsTaken)
Apply a sigmoid function on all the actions.
Definition tpgExecutionEngine.cpp:52
TPG::TPGExecutionEngine::~TPGExecutionEngine
virtual ~TPGExecutionEngine()=default
Default virtual destructor.
TPG::TPGExecutionEngine::env
const Environment & env
Environment used.
Definition tpgExecutionEngine.h:67
TPG::TPGExecutionEngine::evaluateEdge
virtual double evaluateEdge(const TPGEdge &edge)
Execute the Program associated to an Edge and returns the obtained double.
Definition tpgExecutionEngine.cpp:84
TPG::TPGExecutionEngine::TPGExecutionEngine
TPGExecutionEngine(const Environment &env, Archive *arch=NULL)
Main constructor of the class.
Definition tpgExecutionEngine.h:88
TPG::TPGExecutionEngine::progExecutionEngine
Program::ProgramExecutionEngine progExecutionEngine
ProgramExecutionEngine for executing Programs of edges.
Definition tpgExecutionEngine.h:75
TPG::TPGExecutionEngine::archive
Archive * archive
Archive for recording Program results.
Definition tpgExecutionEngine.h:62
TPG::TPGExecutionEngine::executeFromRoot
virtual const std::pair< std::vector< const TPG::TPGVertex * >, std::vector< double > > executeFromRoot(const TPGVertex &root, const std::vector< uint64_t > &initActions={0})
Execute the TPGGraph starting from the given TPGVertex.
Definition tpgExecutionEngine.cpp:153
TPG::TPGExecutionEngine::setArchive
void setArchive(Archive *newArchive)
Set a new Archive for storing Program results.
Definition tpgExecutionEngine.cpp:47
TPG::TPGTeam
Definition tpgTeam.h:49
TPG::TPGVertex
Abstract class representing the vertices of a TPGGraph.
Definition tpgVertex.h:55
TPG
Definition executionStats.h:44