In recent years, with the high-paced development of technology, diversity seeking of the customers, and the rise of global rivalry, the traditional systems are not sufficient anymore to respond to the demands of the customers. In order to supply the requests of the customers, overtaking the rivals, and a longer survival in the area of production, companies need new production systems so that while the quality of their products, the costs of production as well as the prices of the products be decreased. A new production system is called mixed model assembly line (MMAL). Mixed-model assembly lines are a type of production line wherein a variety of product models with common base characteristics are assembled on it. In this paper we intend to study these kinds of lines with the goal of minimizing the total utility work cost and total idle cost in conditions in which operation time is considered as a stochastic parameter. For having a stochastic modeling, the chance constraint approach has been applied. First, we use the GAMS software to check the feasibility of the model, then because of NP-hardness nature of the problem, the improved harmony search (IHS) algorithm is proposed to solve it. Finally, having an attention to the results, it can be deduced in comparison with the exact answer from the Gams software that the results which were gotten from IHS algorithm have trivial calculation mistakes and present acceptable responses that signify the efficiency of the algorithm.