37 const double C1 = 1.0;
38 const double C2 = 200.0;
39 const double f1 = 5.0;
40 const double f2 = 8.0;
41 const double co = 0.0;
44 const double f3 = 2.0;
45 const double ctr = 0.0;
47 const double pol = 0.5;
48 const double plo = 0.5;
49 const double poh = 0.5;
50 const double pho = 0.5;
51 const double phl = 0.5;
52 const double plh = 0.5;
75 solver.
solve(policy, rewards, constraintList, matrix, horizon);
77 policy->
print(std::cout);
90 std::vector<double> vect(
S, 1.0/
S);
157 matrix->
set(
i, j, k, 0.0);
161 matrix->
set(0, 0, 0, 1.0);
162 matrix->
set(0, 1, 1, 1.0);
163 matrix->
set(0, 4, 2, 1.0);
164 matrix->
set(1, 1, 0,
pol);
165 matrix->
set(1, 3, 0, 1.0-
pol);
166 matrix->
set(1, 1, 1,
pol);
167 matrix->
set(1, 3, 1, 1.0-
pol);
168 matrix->
set(1, 1, 2,
pol);
169 matrix->
set(1, 3, 2, 1.0-
pol);
170 matrix->
set(2, 0, 0, 1.0-
plo);
171 matrix->
set(2, 2, 0,
plo);
172 matrix->
set(2, 0, 1, 1.0-
plo);
173 matrix->
set(2, 2, 1,
plo);
174 matrix->
set(2, 0, 2, 1.0-
plo);
175 matrix->
set(2, 2, 2,
plo);
176 matrix->
set(3, 2, 0, 1.0);
177 matrix->
set(3, 3, 1, 1.0);
178 matrix->
set(3, 8, 2, 1.0);
179 matrix->
set(4, 4, 0,
poh);
180 matrix->
set(4, 6, 0, 1.0-
poh);
181 matrix->
set(4, 4, 1,
poh);
182 matrix->
set(4, 6, 1, 1.0-
poh);
183 matrix->
set(4, 4, 2,
poh);
184 matrix->
set(4, 6, 2, 1.0-
poh);
185 matrix->
set(5, 0, 0, 1.0-
pho);
186 matrix->
set(5, 5, 0,
pho);
187 matrix->
set(5, 0, 1, 1.0-
pho);
188 matrix->
set(5, 5, 1,
pho);
189 matrix->
set(5, 0, 2, 1.0-
pho);
190 matrix->
set(5, 5, 2,
pho);
191 matrix->
set(6, 5, 0, 1.0);
192 matrix->
set(6, 7, 1, 1.0);
193 matrix->
set(6, 6, 2, 1.0);
194 matrix->
set(7, 3, 0, 1.0-
phl);
195 matrix->
set(7, 7, 0,
phl);
196 matrix->
set(7, 3, 1, 1.0-
phl);
197 matrix->
set(7, 7, 1,
phl);
198 matrix->
set(7, 3, 2, 1.0-
phl);
199 matrix->
set(7, 7, 2,
phl);
200 matrix->
set(8, 6, 0, 1.0-
plh);
201 matrix->
set(8, 8, 0,
plh);
202 matrix->
set(8, 6, 1, 1.0-
plh);
203 matrix->
set(8, 8, 1,
plh);
204 matrix->
set(8, 6, 2, 1.0-
plh);
205 matrix->
set(8, 8, 2,
plh);
216 std::vector<Rewards*> v;
227 std::vector<double> v;
237 std::vector<Rewards*> constraint(1);
243 constraint[0]->setReward(
i, j, 0.0);
245 constraint[0]->setReward(
i, j,
f1);
247 constraint[0]->setReward(
i, j,
f2);
255 constraint[0]->setReward(
i, j, -constraint[0]->getReward(
i, j));
268 std::vector<double> value(1,
f3);
269 value[0] = -value[0];
std::vector< Rewards * > equalityConstraints
void set(state_t from, state_t to, action_t action, double proba)
std::vector< double > equalityValues
Horizon * generateHorizon()
std::vector< double > inequalityValues
std::vector< Rewards * > generateInequalityConstraints()
void setReward(state_t state, action_t action, double reward)
std::vector< double > generateEqualityValues()
Rewards * generateRewards()
TransitionMatrix * generateTransitionMatrix()
std::vector< Rewards * > generateEqualityConstraints()
std::vector< double > initialStateDistribution
std::vector< Rewards * > inequalityConstraints
void print(std::ostream &stream)
std::vector< double > generateInequalityValues()
void solve(Policy *policy, Rewards *rewards, ConstraintList *constraintList, TransitionMatrix *matrix, Horizon *horizon)