A method of optimizing the use of resources in treatment planning involving more than one radiation set delivered to one or more patients, the radiation sets requiring different resources, respectively, wherein the optimization is performed using an optimization problem comprising an optimization function related to the first and second sets of resources. The method may be used for optimizing one plan for one patient, or a number of plans for different patients, in such a way that the available resources are used in the best possible way.