Optimal control for a class of hereditary systems.