Scheduler
rlTestActions.cpp
Go to the documentation of this file.
1 
10 #include "rlTestActions.h"
11 
12 
13 std::string GoUp::getName()
14 {
15  return "Go Up";
16 }
17 
18 
19 std::string GoDown::getName()
20 {
21  return "Go Down";
22 }
23 std::string GoLeft::getName()
24 {
25  return "Go Left";
26 }
27 std::string GoRight::getName()
28 {
29  return "Go Right";
30 }
31 
32 
33 
34 
35 
37 {
38  std::shared_ptr<RlTestDomainModel> model = getModel<RlTestDomainModel>();
39  if (model->xpos > 0 && model->xpos < 11 && model->ypos == 0)
40  {
41  model->xpos = model->ypos = 0;
42  return;
43  }
44  if (model->ypos < 3)
45  model->ypos++;
46 }
47 
48 
49 
50 
52 {
53  std::shared_ptr<RlTestDomainModel> model = getModel<RlTestDomainModel>();
54  if (model->xpos > 0 && model->xpos < 11 && model->ypos == 0)
55  {
56  model->xpos = model->ypos = 0;
57  return;
58  }
59  if (model->ypos > 0)
60  model->ypos--;
61 }
62 
63 
65 {
66  std::shared_ptr<RlTestDomainModel> model = getModel<RlTestDomainModel>();
67  if (model->xpos > 0 && model->xpos < 11 && model->ypos == 0)
68  {
69  model->xpos = model->ypos = 0;
70  return;
71  }
72  if (model->xpos > 0)
73  model->xpos--;
74 }
75 
76 
78 {
79  std::shared_ptr<RlTestDomainModel> model = getModel<RlTestDomainModel>();
80  if (model->xpos > 0 && model->xpos < 11 && model->ypos == 0)
81  {
82  model->xpos = model->ypos = 0;
83  return;
84  }
85  if (model->xpos < 11)
86  model->xpos++;
87 }
88 
89 
90 
91 
void performAction() override
void performAction() override
std::string getName() override
void performAction() override
std::string getName() override
std::string getName() override
std::string getName() override
void performAction() override