Fix names

This commit is contained in:
Anton Vakhrushev 2018-06-05 13:58:34 +03:00
parent 86dc009231
commit 7ddfae5e90

View File

@ -12,42 +12,34 @@ test('Daemon 1-1', function() {
const m = new History();
const d = new Daemon(1, 1);
const step_slice = s => {
return [].concat(
s.slice(-1).slice.map(i => i.robot),
s.slice(-1).slice.map(i => i.human)
);
};
const steps = [
{
robot: 0,
prediction: 0,
human: 1,
},
{
robot: 0,
prediction: 0,
human: 1,
},
{
robot: 1,
prediction: 1,
human: 1,
},
{
robot: 0,
prediction: 0,
human: 1,
},
{
robot: 1,
prediction: 1,
human: 1,
},
];
steps.forEach((step, index) => {
const robot = d.predict(m);
// expect(d._getStepSlice(m)).toEqual(step_slice(steps));
expect(robot).toEqual(step.robot);
const prediction = d.predict(m);
expect(prediction).toEqual(step.prediction);
d.adjust(m, step.human, index + 1);
m.makeMove(step.human, step.robot);
m.makeMove(step.human, step.prediction);
console.log('Step', index + 1, d);
});
});