PCB Environment 2

Loading...
Searching...
No Matches
StateRepresentation.hpp
1
2#ifndef GYM_PCB_RL_STATEREPRESENTATION_H
3#define GYM_PCB_RL_STATEREPRESENTATION_H
4
5#include "Py.hpp"
6
7 class Action;
8 class PCBoard;
9 class Connection;
10
13
15
16 class StateRepresentation
17{
18 public:
20 static StateRepresentation *create(PyObject *);
21 public:
22 virtual PyObject *getPy(PyObject *args) { return py::None(); }
23
24 virtual void init(PCBoard &PCB) { mPCB = &PCB; }
25 virtual ~StateRepresentation() { }
26 virtual void reset() { }
27 virtual const char *name() const { return ""; }
28
31 void setFocus(const Connection *);
32
33 virtual void setFocus(const std::vector<Connection *> *) { }
34
35 virtual void updateView(const Bbox_2 * = 0) { }
36
37 void setLockedView(bool v) { mLockedView = v; }
38
40 virtual void logAction(const Action *) { }
41 protected:
42 PCBoard *mPCB{0};
43 const Connection *mFocus{0};
44 bool mLockedView{false};
45};
46
47 inline void StateRepresentation::setFocus(const Connection *X)
48{
49 mFocus = X;
50}
51
52#endif // GYM_PCB_RL_STATEREPRESENTATION_H
Action
NOTE: Actions always set the Agent's least recently used connction (getConnectionLRU()) which is some...
Definition Action.hpp:14
Connection
Definition Connection.hpp:17
PCBoard
Definition PCBoard.hpp:36
StateRepresentation
The subclass create(PyObject *) functions check if the PyObject matches and return a new instace if i...
Definition StateRepresentation.hpp:17
StateRepresentation::logAction
virtual void logAction(const Action *)
logAction() is used for state representations like an action sequence as used e.g....
Definition StateRepresentation.hpp:40
StateRepresentation::create
static StateRepresentation * create(PyObject *)
Create a new intance of a subclas as specified by the PyObject.
StateRepresentation::setFocus
void setFocus(const Connection *)
Definition StateRepresentation.hpp:47