Sonia Bressi, Roberta Cupitò, Giorgio Medin

Computer Science and Simulation for Economics

Project work on

"Monopolistic competition."


The applet requires Java 1.4.1 or higher. It will not run on Windows 95 or Mac OS 8 or 9. Mac users must have OS X 10.2.6 or higher and use a browser that supports Java 1.4. (Safari works, IE does not. Mac OS X comes with Safari. Open Safari and set it as your default web browser under Safari/Preferences/General.) On other operating systems, you may obtain the latest Java plugin from Sun's Java site.

created with NetLogo

view/download model file: monopolistic_competition.nlogo


This model tries to explain the theoretical model of “monopolistic competition“ with a simple and easy understanding simulation model.
The world is divided into four firms and a non-consumption area surrounding them; consumers move around according to specific rules linked to their level of happiness and decide whether to buy products or not.


Consumers move across the world onto the four firms according to their happiness. Consumers'happiness is determined according to how much they are able to buy: if a consumer can buy everything he planned to, he will be happy, if he can not buy anything he will be unhappy. In the intermediate cases, the rule of happiness is defined by the proportion of the level of happiness.
They will move a lot if they are unhappy, and stay if they are happy. In the intermediate cases they will move inversely proportional to their level of happiness.
Every agent on a patch with the representative colour of the firm is buying the firm's product. If a consumer cannot buy anything from that firm, will move to another one and will try to buy again. This happens in every cycle. If a consumer reaches the non-consumption area, he will stop for a second and then start running again.


The observer chooses the number of consumers using the slider on the interface. In the same way, the observer is asked to set quantity, firms’ prices and the maximum price the consumers are willing and able to pay for the products.
To set the world for the simulation the observer has to click on the button “setup”. The world is generated, the patches take the four colours of the firms and the white colour for the non-consumption area and the consumers stand in a circle in the middle of the world.
The simulation starts when the “go” button is clicked.
During the simulation the observer can give prices a shock by clicking the “shock offer” button.
On the interface observer can check the quantities sold by each firm and the number of cycles that has elapsed.
The “demand curve” graph shows how the demand curves change over time, the “sold quantities” one shows the sold quantities dynamic over the whole simulation period.


When the shock button is clicked, no consumers will buy anymore unless the reserve price is still higher than those of the firms.
The firms with higher prices then price_ma will lose consumers and will stop selling products.
It could also get empty.
Looking at the “sold quantities” graph observer can notice that once he gives prices the shock, curves could get flat.


It could be interesting to try varying the level of the sliders on the interface and notice what happens.


The model can be extended by introducing other firms and other variables that can affect consumers behaviours.
Another improvements can be to consider returns and marginal costs in making the model more sophisticated and accurate.


This simulation has been inspired by the "Monopoly" model, by Pietro Terna.


This model has been created after attending the course “Informatica e simulazione per l’economia”, held by Professor Pietro Terna, at the Faculty of Economics, University of Turin.