Aspects of optimization and adaptation