Competitive Market

No preview image

This model is seeking new collaborators — would you please help?

1 collaborator

Default-person Steven Kimbrough (Author)

Tags

bounded rationality9 

Tagged by Steven Kimbrough over 9 years ago

competition 

Tagged by Steven Kimbrough over 9 years ago

markets 

Tagged by Steven Kimbrough over 9 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.5 • Viewed 969 times • Downloaded 91 times • Run 0 times
Download the 'Competitive Market' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This section could give a general understanding of what the model is trying to show or explain.

HOW IT WORKS

This section could explain what rules the agents use to create the overall behavior of the model.

HOW TO USE IT

This section could explain how to use the model, including a description of each of the items in the interface tab.

THINGS TO NOTICE

This section could give some ideas of things for the user to notice while running the model.

THINGS TO TRY

This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.

EXTENDING THE MODEL

This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc.

NETLOGO FEATURES

This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.

RELATED MODELS

This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.

CREDITS AND REFERENCES

This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [PriceEquilibrium QuantityEquilibrium QuantityIntercept
  Prices
  RandomMeanQuantity RandomMeanPrice]

to Setup
  ;; (for this model to work with NetLogo's new plotting features,
  ;; __clear-all-and-reset-ticks should be replaced with clear-all at
  ;; the beginning of your setup procedure and reset-ticks at the end
  ;; of the procedure.)
  __clear-all-and-reset-ticks
  set QuantityIntercept  DemandPriceIntercept / abs DemandSlope
  PlotSupplyAndDemandCurves
  
  set QuantityEquilibrium  DemandPriceIntercept / (SupplySlope - DemandSlope)
  set PriceEquilibrium SupplySlope * QuantityEquilibrium
  
  PlotSupplyAndDemandResolutions
  
  set Prices []
end 

to PlotSupplyAndDemandCurves
  set-current-plot "Supply and Demand Curves"
  set-current-plot-pen "Demand"   
  ;print (word "QuantityIntercept = " QuantityIntercept)
  plot-pen-up
  plotxy 0 DemandPriceIntercept
  plot-pen-down
  plotxy QuantityIntercept 0
  set-current-plot-pen "Supply"
  plot-pen-up
  plotxy 0 0
  plot-pen-down
  plotxy QuantityIntercept SupplySlope * QuantityIntercept 
end 

to PlotSupplyAndDemandResolutions
  set-current-plot "Supply and Demand Resolutions"
  set-current-plot-pen "Demand"
  print (word "QuantityIntercept = " QuantityIntercept)
  plot-pen-up
  plotxy 0 DemandPriceIntercept
  plot-pen-down
  plotxy QuantityIntercept 0
  set-current-plot-pen "Supply"
  plot-pen-up
  plotxy 0 0
  plot-pen-down
  plotxy QuantityIntercept SupplySlope * QuantityIntercept 
  set-current-plot-pen "Average"
  plot-pen-up
  plotxy 0 DemandPriceIntercept / 2.0
  plot-pen-down
  plotxy QuantityIntercept ((DemandPriceIntercept + (DemandSlope + SupplySlope) * QuantityIntercept)) / 2.0
  set-current-plot-pen "Random Mean"
  plot-pen-up
  set RandomMeanQuantity (QuantityEquilibrium / 2)
  plotxy  RandomMeanQuantity 0
  let RandomMeanSupply SupplySlope * RandomMeanQuantity
  let RandomMeanDemand DemandPriceIntercept + DemandSlope * RandomMeanQuantity
  set RandomMeanPrice (RandomMeanSupply + RandomMeanDemand) / 2.0
  plot-pen-down
  plotxy (QuantityEquilibrium / 2) DemandPriceIntercept
end 

to Go
  tick
  let SupplyGuy random-float QuantityTradeMax ; QuantityEquilibrium
  let SupplyReservation SupplyGuy * SupplySlope
  let DemandGuy random-float QuantityTradeMax ; QuantityEquilibrium
  let DemandReservation DemandPriceIntercept + DemandSlope * DemandGuy
  set-current-plot "Prices"
  set-plot-x-range 0 round ( DemandPriceIntercept  - PriceEquilibrium + 5)
  set-plot-y-range 0 100 ;( DemandPriceIntercept  - PriceEquilibrium)
  set-histogram-num-bars 100
  if (SupplyReservation <= DemandReservation)
    [let DaPrice (SupplyReservation + DemandReservation) / 2
     set Prices lput DaPrice Prices        
        set-current-plot-pen "Price"
        set-plot-pen-mode 1
        plot-pen-down
        histogram Prices
      ]
;    [print (word "This should not happen! Quitting.")
;     let bob 0
;     let carol 3 / bob
;    ]
end 

There is only one version of this model, created over 9 years ago by Steven Kimbrough.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.