Optimization of resource allocation and leveling using genetic algorithms