Autoshaping and automaintenance: a neural-network approach.