In a container terminal, many operations occur within the storage area: containers import, containers export and containers shifting. All these operations require the respect of many rules and even laws in order to guarantee the port safety and to prevent risks, especially when hazardous material is concerned. In this paper, we propose a hybrid architecture, using a Cellular Automaton and a Multi-Agent System to handle the dangerous container storage problem. It is an optimization problem since the aim is to improve the container terminal configuration, that is, the way hazardous containers are dispatched through the terminal to improve its security. In our model, we consider containers as agents, in order to use a Multi-Agent System for the decision aid software, and a Cellular Automaton for modelling the terminal itself. To validate our approach many tests have been performed and the results show the relevance of our model.