Learning to Prosper in a Factory Town