The article highlights the problem of modelling the flexible production system which is used to manufacture orders in accordance with the proposed control algorithms. The tools replacement is carried out under the control of the replacement heuristic. The equations of state of the production system and the stand are given as well as the order vector resulting from general assumptions. Furthermore, the changeable structure of the whole system is emphasized.