\doxysection{Action\+Space.\+hpp}
\hypertarget{ActionSpace_8hpp_source}{}\label{ActionSpace_8hpp_source}\index{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/RL/ActionSpace.hpp@{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/RL/ActionSpace.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#ifndef\ GYM\_PCB\_RL\_ACTIONSPACE\_H}}
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#define\ GYM\_PCB\_RL\_ACTIONSPACE\_H}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}Py.hpp"{}}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}Action.hpp"{}}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <map>}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <set>}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classActionSpace}{ActionSpace}}}
\DoxyCodeLine{00013\ \{}
\DoxyCodeLine{00014\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00015\ \ \ \ \ \textcolor{keyword}{virtual}\ \mbox{\hyperlink{classActionSpace}{\string~ActionSpace}}()\ \{\ clear(mOwnsActions);\ \}}
\DoxyCodeLine{00016\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ clear(\textcolor{keywordtype}{bool}\ deleteActions);}
\DoxyCodeLine{00017\ \ \ \ \ uint\ size()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mActions.size();\ \}}
\DoxyCodeLine{00018\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<Action\ *>\&\ actions()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mActions;\ \}}
\DoxyCodeLine{00019\ \ \ \ \ \mbox{\hyperlink{classAction}{Action}}\ *getAction(Action::Index\ a)\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mActions.at(a);\ \}}
\DoxyCodeLine{00020\ \ \ \ \ \mbox{\hyperlink{classAction}{Action}}\ *getAction(\textcolor{keyword}{const}\ std::string\ \&name)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00021\ \ \ \ \ \mbox{\hyperlink{classAction}{Action}}\ *getAction(PyObject\ *)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00022\ \ \ \ \ \textcolor{keywordtype}{void}\ addAction(\mbox{\hyperlink{classAction}{Action}}\ *);}
\DoxyCodeLine{00023\ \ \ \ \ \textcolor{keywordtype}{void}\ setOwnsActions(\textcolor{keywordtype}{bool}\ own)\ \{\ mOwnsActions\ =\ own;\ \}}
\DoxyCodeLine{00024\ \ \ \ \ \textcolor{keywordtype}{bool}\ ownsActions()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mOwnsActions;\ \}}
\DoxyCodeLine{00025\ \ \ \ \ \textcolor{keyword}{const}\ std::set<Action::Index>\&\ getIllegal()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mIllegal;\ \}}
\DoxyCodeLine{00026\ \ \ \ \ \textcolor{keywordtype}{void}\ setLegal(\mbox{\hyperlink{classAction}{Action}}\ *,\ \textcolor{keywordtype}{bool});}
\DoxyCodeLine{00027\ \ \ \ \ PyObject\ *getPy()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00028\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00029\ \ \ \ \ std::vector<Action\ *>\ mActions;}
\DoxyCodeLine{00030\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00031\ \ \ \ \ std::set<Action::Index>\ mIllegal;}
\DoxyCodeLine{00032\ \ \ \ \ std::map<std::string,\ Action\ *>\ mActionMap;}
\DoxyCodeLine{00033\ \ \ \ \ \textcolor{keywordtype}{bool}\ mOwnsActions\{\textcolor{keyword}{false}\};}
\DoxyCodeLine{00034\ \};}
\DoxyCodeLine{00035\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classAction}{Action}}\ *ActionSpace::getAction(\textcolor{keyword}{const}\ std::string\ \&name)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00036\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00037\ \ \ \ \ \textcolor{keyword}{auto}\ I\ =\ mActionMap.find(name);}
\DoxyCodeLine{00038\ \ \ \ \ \textcolor{keywordflow}{if}\ (I\ !=\ mActionMap.end())}
\DoxyCodeLine{00039\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ I-\/>second;}
\DoxyCodeLine{00040\ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{00041\ \}}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classActionSet}{ActionSet}}}
\DoxyCodeLine{00044\ \{}
\DoxyCodeLine{00045\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keywordtype}{void}\ init(\mbox{\hyperlink{classActionSpace}{ActionSpace}}\&,\ Action::Index\ first,\ Action::Index\ last);}
\DoxyCodeLine{00047\ \ \ \ \ \textcolor{keywordtype}{void}\ init(\mbox{\hyperlink{classActionSpace}{ActionSpace}}\&,\ \textcolor{keyword}{const}\ std::set<Action::Index>\ *\ =\ 0);}
\DoxyCodeLine{00048\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<Action::Index>\ actions()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mActions;\ \}}
\DoxyCodeLine{00049\ \ \ \ \ uint\ size()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mActions.size();\ \}}
\DoxyCodeLine{00050\ \ \ \ \ \textcolor{keywordtype}{void}\ clear()\ \{\ mActions.clear();\ \}}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keywordtype}{void}\ insert(Action::Index);}
\DoxyCodeLine{00052\ \ \ \ \ \textcolor{keywordtype}{void}\ remove(Action::Index);}
\DoxyCodeLine{00053\ \ \ \ \ \mbox{\hyperlink{classActionSpace}{ActionSpace}}\ *space()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mAS;\ \}}
\DoxyCodeLine{00054\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00055\ \ \ \ \ \mbox{\hyperlink{classActionSpace}{ActionSpace}}\ *mAS\{0\};}
\DoxyCodeLine{00056\ \ \ \ \ std::vector<Action::Index>\ mActions;}
\DoxyCodeLine{00057\ \};}
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00059\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ GYM\_PCB\_RL\_ACTIONSPACE\_H}}

\end{DoxyCode}
