Robotic milking affects factors that determine the barn layout, such as cow behaviour, farm routine, feeding procedure and management practices. As there is hardly any experience with robotic barns, and each farmer has his own management attitude, depending on his personality and local conditions; the optimal layout, therefore, is specific to each case. A new integrated design approach is needed, in order to overcome lack of experience and to be able to design the optimal layout for the robotic milking barn suitable for any farmer or site. A behaviour-based simulation model, which enables a designer to optimize facility allocation in a barn, has been developed as a design tool. The proposed approach overcomes difficulties of characterizing robotic milking barn design. Simulation experiments allow equipment and layouts to be evaluated jointly, an initial design can be fine-tuned to produce a balanced system (an 'optimal layout'), specific to the farm in question, within a reasonable time. Executing the suggested methodology, step by step, an optimal robotic milking barn has been designed, meeting both economic and animal welfare needs. If a simulation study had not been performed and if a bottleneck in the cow-traffic had been discovered after installation, the cost of fitting retrospectively extra capacity could have been significant. On the basis of simulation results for the farm presented as a case study, significant design conclusions were reached.