Federica Gatto, Giuseppe Raso

Computer Science and Simulation for Economics

Project work on

"Perfect 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: perfect_competition.nlogo


The simulation tries to explain the economic model of perfect competition.


In this world the red pathces represent firms. All firms produce the same amount of goods and sell at the same price.
On the other hand turtles represent customers. Customers' movement is random because goods are homogeneous and the price is the same for all. Customers buy according to their price of reserve.


The observer chooses the numbers of customers and the firms using the slider on the interface.
Click to SETUP botton to set up the turtles and the patches.
Click MOVE to start the simulation. If customer buyes turtle will become green, otherwise turtle will remain white.
The "Mean Price" monitor shows the change in mean price over time.
The "Variance" monitor shows the volatility of mean price over time.
The "Mean Quantity" monitor shows the quantity of goods exchanged over time.
The "Price of Reserve" monitor shows the trend of the mean price of reserve over time.
The "Rend" monitor shows the mean gain of customer.


It is important to observe the movement of firms' price and price of reserve: if the price of reserve is higher than the firm's price then the customer buys, or else the customer doesn't buy. If the customer doesn't buy more than 5 times increase his price of reserve, conversely he reduces the price of reserve.
Firms will increase the price, if they sell goods, in alternative they decrease their price.


With this model is interesting to compare four case:
case A: few customers and few firms;
case B: many customers and many firms;
case C: few customers and many firms;
case D: many customers and few firms.


This simulation was created for the course of “Informatica e Simulazioni per l'Economia” (2007-2008) by Professor Pietro Terna, Faculty of Economics, University of Turin.