'use strict'; /* sense structure: * { * size: number * read: function(lattice, agent) -> number[size] * } */ export function sense_read(world, agent, sense) { const result = sense.read(world, agent); if (result.length !== sense.size) { throw new Error(`Expected result of size ${sense.size}, but got ${result.length} instead.`); } return result; }