We consider the problem of optimizing the evacuation of a workplace environment by deciding the best arrangement of emergency exits. To this end, we consider a simulation-based approach that relies on the use of cellular automata to model the collective behavior of the crowd. In order to obtain problem instances more akin to realistic workplace environments, a problem instance generator based on L-attributed grammars is devised and described in detail. Subsequently, we consider the use of evolutionary algorithms, an iterated greedy heuristic, and Nelder-Mead method to solve the problem. In-depth experimentation is reported. It is shown that the evolutionary algorithm is superior during training and that Nelder-Mead method is also competitive during test, raising interesting prospects for future hybrid strategies.