Supply and Demand - price setting WIP
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
Globals [price last_price producer-surplus consumer-surplus total-surplus] Breed [Buyers Buyer] Breed [Sellers Seller] Buyers-own [Maximum_asking_price willingtopay consumersurplus B_stock Demand able_buy B_price last_B_Price calorie] Sellers-own [Minimum_selling_price willingtosell producersurplus S_stock Inventory_space able_sell S_price last_S_price revenue] turtles-own [partner] to setup clear-all create-Buyers NoBuyers[ setxy random-xcor random-ycor ] create-Sellers NoSellers[ setxy random-xcor random-ycor ] ask Buyers [ set color yellow set Maximum_asking_price Maximum_ask - random var_ask set B_stock 0 set last_B_price Maximum_asking_price set B_price last_B_price set calorie 100 ] ask Sellers [ set color blue set Minimum_selling_price Minimum_sell + random var_sell set S_stock 0 set last_S_price Minimum_selling_price set S_price last_S_price set revenue 100 ] reset-ticks end to go update-plots produce_good_and_income set_price seek_seller ask Sellers with [color = red][ set color blue] ask Sellers [ if revenue <= 0 [die]] ask Buyers [ if calorie <= 0 [die] ] tick end to produce_good_and_income ask Sellers [ set Inventory_space Invent_space if S_stock < Inventory_space [ set S_stock S_stock + No_good_produced if S_stock >= Inventory_space [ set S_stock Inventory_space ]]] ask Buyers [ set Demand Demand + Daily_demand ] end to set_price ask Sellers [ ifelse able_sell = 0 [ set revenue revenue - revenue_reducer set S_price last_S_price - random-float adjustment if S_price < Minimum_selling_price[ set S_price Minimum_selling_price]] [let prob random 6 if prob = 1 [ set S_price last_S_price + random adjustment]] set able_sell 0 ] ask Buyers [ ifelse able_buy = 0 ; variable, when able to buy, + 1, will be wiped away [ set calorie calorie - calorie_reducer set B_price last_B_price + random-float adjustment if B_price > Maximum_asking_price [ set B_price Maximum_asking_price ]] [let prob random 6 if prob = 1 [ set B_price last_B_price - random adjustment]] set able_buy 0 ] ; reset the values end to seek_seller ask buyers [ let available_sellers Sellers with [color = blue] let whom one-of available_sellers if whom = nobody [stop] ask whom [set color red] let seller_price [S_price] of whom if (B_price - seller_price >= 0) [ let common_price (B_price + [S_price] of whom) / 2 set consumersurplus (Maximum_asking_price - common_price) set last_B_price common_price set calorie calorie + 1 set able_buy able_buy + 1 ask whom [ set last_S_price common_price set able_sell able_sell + 1 set revenue revenue + 1 set producersurplus (common_price - Minimum_selling_price) ] ] ] end
There is only one version of this model, created almost 4 years ago by Per Hung Yap .
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Supply and Demand - price setting WIP.png | preview | Preview for 'Supply and Demand - price setting WIP' | almost 4 years ago, by Per Hung Yap | Download |
This model does not have any ancestors.
This model does not have any descendants.