Reinforcement Learning for Agents with Many Sensors and Actuators Acting in Categorizable Environments