Fix names
This commit is contained in:
parent
86dc009231
commit
7ddfae5e90
@ -12,42 +12,34 @@ test('Daemon 1-1', function() {
|
|||||||
const m = new History();
|
const m = new History();
|
||||||
const d = new Daemon(1, 1);
|
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 = [
|
const steps = [
|
||||||
{
|
{
|
||||||
robot: 0,
|
prediction: 0,
|
||||||
human: 1,
|
human: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
robot: 0,
|
prediction: 0,
|
||||||
human: 1,
|
human: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
robot: 1,
|
prediction: 1,
|
||||||
human: 1,
|
human: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
robot: 0,
|
prediction: 0,
|
||||||
human: 1,
|
human: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
robot: 1,
|
prediction: 1,
|
||||||
human: 1,
|
human: 1,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
steps.forEach((step, index) => {
|
steps.forEach((step, index) => {
|
||||||
const robot = d.predict(m);
|
const prediction = d.predict(m);
|
||||||
// expect(d._getStepSlice(m)).toEqual(step_slice(steps));
|
expect(prediction).toEqual(step.prediction);
|
||||||
expect(robot).toEqual(step.robot);
|
|
||||||
d.adjust(m, step.human, index + 1);
|
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);
|
console.log('Step', index + 1, d);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user