PCB Environment 2

Loading...
Searching...
No Matches
Policy.hpp
1#ifndef GYM_PCB_RL_POLICY_H
2#define GYM_PCB_RL_POLICY_H
3
4#include "Py.hpp"
5#include <vector>
6
7 class Policy
8{
9 public:
10 // @MinProbability: for stochastic policy only, applied before temperature
11 struct CommonParams
12 {
13 std::string_view Class{"constant"};
14 float Epsilon{0.0f};
15 float Temperature{1.0f};
16 float Tolerance{0.0f};
17 float MinProbability{0.0f};
18 static CommonParams from(PyObject *);
19 };
20 public:
21 static Policy *create(const CommonParams&);
22 public:
23 virtual uint decide(const std::vector<float>&) { return 0; }
24
25 virtual ~Policy() { }
26 virtual void setFastActionMask(uint32_t) { }
27 virtual void setEpsilon(float) { }
28 virtual void setTemperature(float) { }
29 virtual float getEpsilon() const { return 1.0f; }
30 virtual float getTemperature() const { return 1.0f; }
31};
32
33#endif // GYM_PCB_RL_POLICY_H
Policy
Definition Policy.hpp:8
Policy::CommonParams
Definition Policy.hpp:12