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
7class Action;
8class PCBoard;
9class Connection;
10
13
15
17{
18public:
20 static StateRepresentation *create(PyObject *);
21public:
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 *) { }
41protected:
42 PCBoard *mPCB{0};
43 const Connection *mFocus{0};
44 bool mLockedView{false};
45};
46
48{
49 mFocus = X;
50}
51
52#endif // GYM_PCB_RL_STATEREPRESENTATION_H
NOTE: Actions always set the Agent's least recently used connction (getConnectionLRU()) which is some...
Definition Action.hpp:14
Definition Connection.hpp:17
Definition PCBoard.hpp:36
The subclass create(PyObject *) functions check if the PyObject matches and return a new instace if i...
Definition StateRepresentation.hpp:17
virtual void logAction(const Action *)
logAction() is used for state representations like an action sequence as used e.g....
Definition StateRepresentation.hpp:40
static StateRepresentation * create(PyObject *)
Create a new intance of a subclas as specified by the PyObject.
void setFocus(const Connection *)
Definition StateRepresentation.hpp:47