Because of the dissemination of impulse buying behavior in consumers its academic studies have increased over the last decade. Because in large stores, sales have to be increased, the behavior of consumers in impulse buying to be taken into account by the researchers and managers of the stores. The purpose of this paper is to model agent-based the impulse buying behavior of consumers (customers), with regards to the factors of discount and swarm in the purchase. In terms of executive purpose and with agent-based modeling approach, the present paper examines the existing reality of consumer impulse buying behavior. This paper develops consumption models, examines and analyzes consumer behavior under the NetLogo software environment. In comparing the optimal points of discounts and sales volume in both discount and swarm-discount functions that lead the stores to maximize profits and sales volume simultaneously, it can be debated that with running this model (swarm-discount) stores would be gaining more sales by less discounts. Results could describe customer behavior by implementing discount and swarm factors. Understanding the Customer behavior prepared the comparing possibility of customer behavior in store in each introduced mathematical model. The contributions could be considered in two points of view. On the applicable view, this research can provide the managers and decision makers with significant information, includes possibility of forecasting sales volume and incomes of any policies in stores, so the comparing of policies and strategies analysis would be possible. This method is rather less expensive, because of virtual environment nature. Users of this model can study other sections by changing the research assumptions.