Blob Forager is an agent that eats green food while avoiding red poison. It has mass, thrust, and drag, and loses mass over time unless it eats.
The default policy net is a standard MLP, same as in previous demos. However, this demo also includes an alternative policy function driven by a logic gate circuit. The circuit policy is trained as a differentiable logic gate network and compiled into boolean operations that run without floating-point arithmetic. You can inspect the compiled circuit at circuit.js.
The MLP-based agent grows larger than the circuit-based agent by about 10% on average, but circuit inference runs roughly 10x faster than the MLP in JavaScript. Running natively on a CPU, a compiled circuit can potentially run many times faster on an FPGA or embedded device that lacks an FPU.
Demo below.