; CREATE AGENTS breed [producers producer] breed [consumers consumer] breed [Bproducers Bproducer] breed [Bconsumers Bconsumer] breed [importers importer] breed [fdistributors fdistributor] undirected-link-breed [relations relation] undirected-link-breed [supports support] globals[ markup s Tcost mean-productivity eilist] relations-own[ delta time tot tau international? localtrade? tradeint tradeloc expected_gain pricenow showed? alphab num genim gain_markup] importers-own[ price productivity q-int quant-int mean-delta-international quantile totrelations beilist explored? broken-link? general? ] fdistributors-own [mean-delta country productivity dead broken-link? explored? general? totrelations mean-delta-international quant-int q-int price owner ] producers-own[ country price productivity dead q quant q-int quant-int explored? want-produce? want-produce-inernational? mean-delta mean-delta-international broken-link? quantile totrelations general? foreigndistributor? exporter? texporting] consumers-own[ country utility money priceindex havebeenthere? alpha n wiviulinks wiviulinksint schodaxi? lc cost generalI gilist offer] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SETUP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to setup clear-all set eilist [] set s 4 set Tcost tradecost repeat anzprod [make-producers1] repeat anzprod [make-producers2] make-consumers setup-plots end to make-producers1 create-producers 1 [ setxy -10 random-ycor fd 5 set country 1 producersetting] end to make-producers2 create-producers 1 [ setxy 10 random-ycor fd 5 set country 2 producersetting] end to make-consumers create-consumers anzcons [ setxy -10 random-ycor set country 1 consumersetting ] create-consumers anzcons [ setxy 10 random-ycor set country 2 consumersetting ] end to producersetting set color white set dead 0 set productivity random-normal .5 .15 set mean-delta 1 - 1 / D-shock if productivity <= 0 [die] if productivity >= 1 [set productivity 0.99 + random-normal 0.0001 0.000001] set quant-int 0 set q-int 0 set want-produce? true set want-produce-inernational? true set price (1 / productivity) set explored? false set general? false set foreigndistributor? false set exporter? false set texporting 0 end to consumersetting set color blue set priceindex 0 set n 0 set wiviulinks 3 set wiviulinksint 0 set schodaxi? false set lc random-normal D-linkcost 0.1 if lc <= 0 [set lc 0.01] set generalI 0 set gilist [] set money Demand end to loc-relation-setting set time 0 set delta [mean-delta] of myself set international? false set localtrade? true set tau 1 set tradeint 0 set showed? false end to int-relation-setting set time 0 set delta [mean-delta-international] of myself set international? true set localtrade? false set tau Tcost set tradeint 0 set showed? false end to import-relation-setting set time 0 set delta 1 set international? true set localtrade? true set tau Tcost set tradeint 0 set showed? false set genim 1 end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to go come-in if GI = true [generlaimporting] if FDC = true [foreigndistributioncenter] make-relation consume update-production do-plots tick end to come-in if ticks >= 10 [ let o anzprod - count producers with [country = 1] repeat o [make-producers1] let b anzprod - count producers with [country = 2] repeat b [make-producers2]] end ;GI to generlaimporting ask consumers [set eilist [] ifelse length [count my-relations] of support-neighbors with [is-importer? self] = 0 [if count my-relations with [tot != 1 and international?] > 2 and count my-relations with [tot = 1] != 0 [let gf one-of consumers with [country = [country] of myself and not schodaxi? and wiviulinks >= 1] if gf != nobody [ set eilist fput gf eilist ifelse [alpha] of gf < alpha [ set offer [1] findmostproductive ][stop]]] make-new-exporter] [set offer [] kick-purchaser more-link-purchaser let gf one-of consumers with [country = [country] of myself and not schodaxi? and wiviulinks >= 1] if gf != nobody [ if [alpha] of gf < alpha [ set offer fput gf offer]] link-old-customers if length offer > 0 [ set eilist [] set eilist fput item 0 offer eilist findmostproductive make-new-exporter]]] ask importers [ set q-int 0 set quant-int 0] end to kick-purchaser let w [] ask support-neighbors with [is-consumer? self][ if alpha >= [alpha] of myself [set w fput self w]] if length w > 0[ ask support-neighbors with [is-importer? self][ foreach w [if relation-neighbor? ? = true [ask relation-with ? [set tot 1 set delta 0 set color red set tradeint 0]]]]] end to make-new-exporter if length eilist >= 2 [ ;eiListe [GI P D] set eilist fput self eilist create-support-with item 2 eilist set generalI 1 hatch-importers 1 [ setxy [xcor] of item 0 eilist [ycor] of item 0 eilist set general? false set price [price] of item 1 eilist set productivity [productivity] of item 1 eilist set color red let i 2 while [i < length eilist] [create-relation-with item i eilist ask relation-with item i eilist[import-relation-setting] create-support-with item 1 eilist create-support-with item 0 eilist set beilist eilist set i i + 1]]] end to link-old-customers ask support-neighbors with [is-importer? self] [set explored? false] loop [let nase one-of support-neighbors with [is-importer? self and not explored?] if nase = nobody [stop] ask nase [ set explored? true let gf [] let i 0 set gf fput [self] of relation-neighbors gf let km [offer] of myself while [i < length gf] [set km remove item i item 0 gf km set i i + 1] if km != [][ let bock one-of km set [offer] of myself remove bock [offer] of myself create-relation-with bock ask relation-with bock [import-relation-setting] ]]] end to more-link-purchaser ask support-neighbors with [is-consumer? self] [set havebeenthere? false] loop [let backe one-of support-neighbors with [is-consumer? self and not havebeenthere?] if backe = nobody [ stop] ask backe [set havebeenthere? true if alpha < [alpha] of myself [ if wiviulinks >= 1 [ set schodaxi? true set [offer] of myself fput self [offer] of myself]]]] end to findmostproductive let po count my-relations with [tot != 1 and international?] / 2 set gilist [productivity] of relation-neighbors with [is-producer? self and country != [country] of myself and not general?] let i 1 let ko length eilist while [i <= po and length eilist = ko] [ set i i + 1 if gilist != [] [ let gi-value max gilist set gilist remove gi-value gilist let dc relation-neighbors with [is-producer? self and country != [country] of myself and productivity = [gi-value] of myself ] ask dc [if count my-relations with [tot = 1 and international?] = 0 and count my-relations with [international? and tot != 1] > 0[ let alph mean [alphab] of my-relations with [tot != 1 and international?] let nr mean [num] of my-relations with [tot != 1 and international?] let anz count my-relations with [tot != 1 and international?] let km mean-delta-international * Tcost if km > 1 [set km 0.999] ifelse ((1 - alph) * ( nr / ( s *(nr - 1) - nr + 1)) * q-int / anz - P-linkcost * Tcost ) / (1 - (1 - 1 / P-shock) * ( 1 - (1 - mean-delta-international) ^ anz )) > ((1 - [alpha] of myself) * ( [n] of myself / ((s - 1) * ([n] of myself - 1))) * q-int / anz - P-linkcost ) / (1 - (1 - 1 / P-shock) * ( 1 - (1 - km) ^ ( length [offer] of myself + 1))) [] [set eilist fput self eilist set general? true ask relation-with myself [set color green set thickness 0.5 ] ask my-relations with [international? and color = 5] [set tot 1 set delta 0 set color red set tradeint 0] stop ]]]]] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FDC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to foreigndistributioncenter ask producers with [not general?] [ifelse foreigndistributor? = false [if count my-relations with [international? and tot != 1] > 0[ let anz count my-relations with [international? and tot != 1] if mean-delta-international = 1 and P-shock * P-linkcost * Tcost > P-shock * P-linkcost + fixcost [set foreigndistributor? true let meinelinks [] set meinelinks fput [other-end] of my-relations with [international? and tot != 1] meinelinks hatch-fdistributors 1 [ set country 3 - [country] of myself fd 5 set dead 0 set color brown set general? false set explored? false set productivity [productivity] of myself set mean-delta-international [mean-delta-international] of myself set quant-int 0 set q-int 0 set price (1 / productivity) set owner myself ifelse country = 1 [setxy -7 [ycor] of owner][setxy 7 [ycor] of owner ] create-support-with myself foreach item 0 meinelinks [create-relation-with ? ask relation-with ? [ int-relation-setting let poi 0 ask myself[set poi [time] of my-relations with [other-end = ?]] set time item 0 poi set localtrade? true]]] ask my-relations with [international? and tot != 1][set tot 1 set delta 0 set color red set tradeint 0] ]]] [ask fdistributors with [country = [country] of myself] [ let jemand one-of consumers with [country = [country] of myself and not schodaxi? and wiviulinks >= 1] if jemand != nobody [set [schodaxi?] of jemand true create-relation-with jemand ask relation-with jemand[int-relation-setting set localtrade? true]]]]] ask fdistributors [set q-int 0 set quant-int 0] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRODUCER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to make-relation ask consumers with [wiviulinks > 1] [set schodaxi? false] ask producers [ ifelse count my-relations > 0 [ ifelse count my-relations with [tot != 1] > 0 [ set mean-delta mean [delta] of my-relations with [not international?] ifelse (mean-delta * ( q / count my-relations with [tot != 1]) - (1 / productivity) * quant / count my-relations with [tot != 1] - searchcost - P-linkcost - fixcost / (count my-relations with [tot != 1] + 1)) > 0 [make-the-relation set dead dead + 1] [set dead dead + 1]] [ask importers with [item 1 beilist = myself] [die] ask fdistributors with [owner = myself][die] die]] [make-the-relation set color white] ifelse q-int > 0 [set texporting texporting + 1][set texporting 0] set q 0 set quant 0 set q-int 0 set quant-int 0 if general? = false and foreigndistributor? = false [ifelse count my-relations with [international? and tot != 1] > 0 [set exporter? true][set exporter? false]] ] end to make-the-relation ifelse Export = true and ticks >= 20 [ifelse mean-delta = 1 and want-produce-inernational? = true and general? = false and foreigndistributor? = false and count my-relations > 3[ go-international][relate-loc]] [relate-loc] end to relate-loc set color white let jemand one-of consumers with [country = [country] of myself and not schodaxi? and wiviulinks >= 1] if jemand != nobody [set [schodaxi?] of jemand true create-relation-with jemand ask relation-with jemand [loc-relation-setting]] end to go-international ;first time if count my-relations with [international?] = 0 [ set mean-delta-international mean-delta / Tcost if ((mean-delta-international) * (q / count my-relations with [tot != 1] )/ Tcost) - (1 / productivity) * quant / count my-relations with [tot != 1] - searchcost * Tcost - P-linkcost * Tcost - fixcost / (count my-links with [tot != 1]+ 1) >= 0[ set want-produce-inernational? true ]] ;thereafter if mean-delta-international > 0 and count my-relations with [international? ] > 0 [ifelse mean-delta-international > 0 and count my-relations with [international? and tot != 1] > 0 [set mean-delta-international mean [delta] of my-relations with [international?] ifelse ((mean-delta-international * (q-int / count my-relations with [international? and tot != 1])) - (1 / productivity) * (quant-int / count my-relations with [international? and tot != 1]) * Tcost - searchcost * Tcost - P-linkcost * Tcost - fixcost / (count my-relations with [tot != 1] + 1) ) >= 0 [set want-produce-inernational? true ] [set want-produce-inernational? false set color white]] [set want-produce-inernational? false]] ifelse want-produce-inernational? = true[ let jemand one-of consumers with [country != [country] of myself and not schodaxi? and wiviulinks >= 1] if jemand != nobody [set [schodaxi?] of jemand true create-relation-with jemand ask relation-with jemand[int-relation-setting]]] [make-the-relation] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CONSUMERS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to consume ask consumers[ set money Demand maxprofit set schodaxi? false make-priceindex handeln] end to maxprofit if count my-relations > 0 [set alpha (1 - ((count my-relations) ^ -.5))] set n count my-relations with [tot != 1] ifelse n > 1[ ifelse random D-shock = 1 [brake-link] [set cost lc * count my-relations with [tot != 1 and localtrade?] + lc * Tcost * count my-relations with [tot != 1 and not localtrade?] let p (1 - n ^(-0.5)) * (n / (s *(n - 1) - n + 1)) * money - cost let k n + 1 let w (1 - k ^(-0.5)) * (k / (s *(k - 1) - k + 1)) * money - (cost + lc) ifelse w > p [set wiviulinks 1 set k n + 2 if (1 - k ^(-0.5)) * (k / (s *(k - 1) - k + 1)) * money - (cost + lc) > w [set wiviulinks 2] set k n + 1 set w (1 - k ^(-0.5)) * (k / (s *(k - 1) - k + 1)) * money - (cost + lc * Tcost) if w > p [set wiviulinksint 1] set k n + 2 if (1 - k ^(-0.5)) * (k / (s *(k - 1) - k + 1)) * money - (cost + lc * Tcost) > w [set wiviulinksint 2]] [brake-link set wiviulinks 0 set wiviulinksint 0]]] [set wiviulinks 3 set wiviulinksint 3] end to brake-link let pok [] let poklist [] ask relation-neighbors [ set explored? false] loop [let someone one-of relation-neighbors with [not explored?] if someone = nobody [if pok = [] [stop] let pot-value min pok let pot-index position pot-value pok let derda item pot-index poklist ask relation-with derda [ set tot 1 set delta 0 set color red set tradeint 0] stop] let someone-link relation-with someone set [explored?] of someone true if [tot] of someone-link != 1 and [time] of someone-link > 0[ let w 0 ifelse [localtrade?] of someone-link = false or [general?] of someone = false [set w [gain_markup] of someone-link * alpha - lc * Tcost][set w [gain_markup] of someone-link * alpha - lc] set pok fput w pok set poklist fput someone poklist]] end to make-priceindex ask relation-neighbors [set explored? false set broken-link? false] loop [let tilt one-of relation-neighbors with [not explored?] if tilt = nobody [ ifelse n > 1[ ask relation-neighbors [ set explored? false] set priceindex 0 loop [let start one-of relation-neighbors with [not explored? and not broken-link?] if start = nobody [set priceindex (priceindex ^ (1 / (1 - s))) stop ] let start-link relation-with start set [explored?] of start true let adw [tau] of start-link * ((s *( 1 - n ) - 1) / (s *(1 - n) + n - 1))*([price] of start / [delta] of start-link) set [pricenow] of start-link adw set priceindex priceindex + ( adw )^(1 - s) ]] [let derda one-of relation-neighbors with [not broken-link?] ; if there are less than 2 producers linked if derda = nobody [stop] let derda-link relation-with derda set [pricenow] of derda-link [tau] of derda-link * (s / (s - 1))*([price] of derda / [delta] of derda-link) set priceindex [pricenow] of derda-link stop]] if [tot] of relation-with tilt = 1 [set [broken-link?] of tilt true] set [explored?] of tilt true] end to handeln if count my-relations with [tot != 1] > 0 [ set utility 0 ask relation-neighbors [ set explored? false set broken-link? false] loop [let tilt one-of relation-neighbors with [not explored?] if tilt = nobody [ ask relation-neighbors [ set explored? false] loop [let start one-of relation-neighbors with [not explored? and not broken-link?] if start = nobody [set utility (utility ^ (s / (s - 1))) stop] let start-link relation-with start set [explored?] of start true let trade money * (priceindex ^ (s - 1)) * ([pricenow] of start-link)^ ( - s) ifelse [international?] of relation-with start = true [set [quant-int] of start [quant-int] of start + trade set [q-int] of start [q-int] of start + trade * [pricenow] of start-link ask relation-with start [set tradeint trade]] [set [quant] of start [quant] of start + trade set [q] of start [q] of start + trade * [pricenow] of start-link ask relation-with start [set tradeloc trade]] set utility utility + ((trade) ^ ((s - 1 ) / s)) ask relation-with start [set time time + 1 set delta delta + gamma *( time + [alpha] of myself ) if delta > 1 [set delta 1] set alphab [alpha] of myself set num [n] of myself] ]] if [tot] of relation-with tilt = 1 [set [broken-link?] of tilt true] set [explored?] of tilt true]] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; UPDATE-PRODUCTION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to update-production ask producers[ set totrelations count my-relations with [tot != 1] if general? = true [general-export] if foreigndistributor? = true [distribute-in-foreign] sort-links-out if ticks >= 10[ if random P-shock = 1 [ask importers with [item 1 beilist = myself] [die] ask fdistributors with [owner = myself][die] die]]] end to sort-links-out ask relation-neighbors [set havebeenthere? false] loop [let derda one-of relation-neighbors with [not havebeenthere?] if derda = nobody [stop] let derda-relation relation-with derda set [havebeenthere?] of derda true if [tot] of derda-relation != 1[ ask derda-relation [ifelse [n] of derda > 1 [set expected_gain ( delta * tradeint * pricenow + delta * tradeloc * pricenow - [price] of myself * tradeloc - [price] of myself * tradeint - P-linkcost * tau - fixcost / [totrelations] of myself) set gain_markup ([n] of derda / ([n] of derda *(s - 1) - s + 1)) * tradeint + ([n] of derda / ([n] of derda *(s - 1) - s + 1)) * tradeloc set expected_gain expected_gain - (1 - [n] of derda ^ (-0.5))* gain_markup ] [set expected_gain ( delta * tradeint * pricenow + delta * tradeloc * pricenow - [price] of myself * tradeloc - [price] of myself * tradeint - P-linkcost * tau - fixcost / [totrelations] of myself) set gain_markup ( [n] of derda * 1 / (s - 1)) * tradeint + ( 1 / (s - 1)) * tradeloc] if expected_gain < 0 [set tot 1 set delta 0 set color red set tradeint 0 set tradeloc 0 ]]]] end to general-export ask importers with [item 1 beilist = myself][ set [totrelations] of item 1 beilist [totrelations] of item 1 beilist + count my-relations with [tot != 1] set totrelations [totrelations] of item 1 beilist set [q-int] of item 1 beilist [q-int] of item 1 beilist + q-int set [quant-int] of item 1 beilist [quant-int] of item 1 beilist + quant-int ask relation-neighbors [set havebeenthere? false] loop [let derda one-of relation-neighbors with [not havebeenthere?] if derda = nobody [stop] let derda-relation relation-with derda set [havebeenthere?] of derda true let phalpha [alpha] of item 0 beilist if [tot] of derda-relation != 1[ ask derda-relation [if [n] of derda > 1 [set expected_gain ( delta * tradeint * pricenow - [price] of myself * tradeint - P-linkcost * tau - fixcost / [totrelations] of myself) set gain_markup ([n] of derda / ([n] of derda *(s - 1) - s + 1)) * tradeint set expected_gain expected_gain - phalpha * gain_markup if expected_gain < 0 [set tot 1 set delta 0 set color red set tradeint 0 set tradeloc 0]]]]]] end to distribute-in-foreign ask fdistributors with [owner = myself][set [totrelations] of myself [totrelations] of myself + count my-relations with [tot != 1] set totrelations [totrelations] of myself set [q-int] of owner [q-int] of owner + q-int set [quant-int] of owner [quant-int] of owner + quant-int sort-links-out] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PLOTTING ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to setup-plots set-current-plot "Productivity and Competition" set-current-plot "Trade Relations" set-current-plot "Trade per Productivity" set-current-plot "Trade per Relation" set-current-plot "Trade Modes" set-current-plot "Firms involved in International Trade" set-current-plot "Trade per Firm" end to do-plots set-current-plot "Firms involved in International Trade" set-current-plot-pen "Total" plot count producers with [exporter? or general? or foreigndistributor?] set-current-plot-pen "Exporters" plot count producers with [exporter? and not general? and not foreigndistributor?] set-current-plot-pen "GIS" plot count producers with [general?] set-current-plot-pen "FDCs" plot count producers with [foreigndistributor?] set-current-plot "Productivity and Competition" set-current-plot-pen "mean Productivity" plot mean [productivity] of producers set-current-plot-pen "Competition" plot 1 / (mean [priceindex] of consumers) set-current-plot "Trade Relations" set-current-plot-pen "Local" plot count relations with [tot != 1 and not international?] set-current-plot-pen "International" plot count relations with [tot != 1 and international?] set-current-plot-pen "Broken" plot count relations with [tot = 1] set-current-plot-pen "Total" plot count relations with [tot != 1] set-current-plot "Trade per Productivity" set-plot-x-range 0 3 plot-pen-reset plotxy 0 sum [quant-int] of producers with [ productivity > 0.75 ] plotxy 1 sum [quant-int] of producers with [ productivity < 0.75 and productivity > 0.5] plotxy 2 sum [quant-int] of producers with [ productivity < 0.5 and productivity > 0.25 ] plotxy 3 sum [quant-int] of producers with [ productivity < 0.25] if count relations with [tot != 1 and international?] > 0 [set-current-plot "Trade per Relation" set-plot-x-range 0 15 plot-pen-reset foreach [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] [if count relations with [tot != 1 and time = ? and international?] > 0 [ plotxy ? (mean [tradeint] of relations with [international? and time = ? and tot != 1])]] if count relations with [tot != 1 and time >= 16 and international?] > 0 [ plotxy 16 (mean [tradeint] of relations with [international? and time >= 16 and tot != 1])]] if count producers with [texporting > 0] > 0 [set-current-plot "Trade per Firm" set-plot-x-range 0 15 plot-pen-reset foreach [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] [if count producers with [texporting = ?] > 0 [ plotxy ? (mean [q-int] of producers with [texporting = ?])]] if count producers with [texporting >= 16] > 0 [ plotxy 16 (mean [q-int] of producers with [texporting >= 16])]] set-current-plot "Trade Modes" set-current-plot-pen "Exporter" plot sum [q-int] of producers with [not general? and not foreigndistributor?] set-current-plot-pen "GI" plot sum [q-int] of importers set-current-plot-pen "FDC" plot sum [q-int] of fdistributors set-current-plot-pen "Total" plot sum [q-int] of producers end ;This model was built by Pascal Bürki. For more information you can contact me on pascal.buerki@hotmail.com @#$#@#$#@ GRAPHICS-WINDOW 234 13 673 421 16 14 13.0 0 10 1 1 1 0 0 1 1 -16 16 -14 14 1 1 1 ticks CC-WINDOW 5 593 1070 688 Command Center 0 BUTTON 28 13 92 46 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL BUTTON 104 13 167 46 NIL go T 1 T OBSERVER NIL NIL NIL NIL SLIDER 5 432 97 465 D-linkcost D-linkcost 0 1 0.35 0.01 1 NIL HORIZONTAL SLIDER 113 232 205 265 tradecost tradecost 1 3 1.3 .01 1 NIL HORIZONTAL SLIDER 10 145 182 178 anzprod anzprod 0 100 50 1 1 NIL HORIZONTAL SLIDER 10 187 182 220 anzcons anzcons 0 100 50 1 1 NIL HORIZONTAL SLIDER 112 293 209 326 fixcost fixcost 0 10 3 0.1 1 NIL HORIZONTAL SWITCH 9 52 99 85 GI GI 0 1 -1000 SLIDER 5 331 97 364 P-linkcost P-linkcost 0 2 0.35 0.01 1 NIL HORIZONTAL SLIDER 111 331 208 364 searchcost searchcost 0 2 0.3 .01 1 NIL HORIZONTAL SLIDER 5 292 97 325 P-shock P-shock 0 80 40 1 1 NIL HORIZONTAL SWITCH 99 52 189 85 FDC FDC 0 1 -1000 SLIDER 6 232 98 265 gamma gamma 0 0.1 0.02 .001 1 NIL HORIZONTAL SLIDER 5 394 97 427 D-shock D-shock 0 100 40 1 1 NIL HORIZONTAL SLIDER 110 395 202 428 Demand Demand 0 200 150 1 1 NIL HORIZONTAL SWITCH 52 88 155 121 Export Export 0 1 -1000 TEXTBOX 11 269 161 287 Producers\n 11 0.0 1 TEXTBOX 9 374 159 392 Distributors\n 11 0.0 1 TEXTBOX 9 467 205 579 White Square - Producer\nBlue Square - Distributor\nRed Square - Genera Importer\nBrown Square - Foreign Distribution\n Center\nWhite Line - Trade Relation\nRed Line - Broken Trade Relation\nThick Line - Relaiton with a GI 11 0.0 1 PLOT 201 427 485 577 Productivity and Competition Time NIL 0.0 10.0 0.0 1.0 true true PENS "mean Productivity" 1.0 0 -16777216 true "Competition" 1.0 0 -13345367 true PLOT 693 14 1008 149 Firms involved in International Trade Time Firms 0.0 10.0 0.0 10.0 true true PENS "Total" 1.0 0 -16777216 true "Exporters" 1.0 0 -1184463 true "GIs" 1.0 0 -2674135 true "FDCs" 1.0 0 -6459832 true PLOT 485 426 669 576 Trade per Productivity + Productivity - Trade 0.0 4.0 0.0 10.0 true false PENS "default" 1.0 1 -16777216 true PLOT 870 426 1061 578 Trade per Relation Relation existing t periods Quantity traded 0.0 10.0 0.0 10.0 true false PENS "default" 1.0 1 -16777216 true PLOT 693 281 1011 426 Trade Relations Time Relations 0.0 10.0 0.0 10.0 true true PENS "Local" 1.0 0 -955883 true "International" 1.0 0 -1184463 true "Broken" 1.0 0 -2674135 true "Total" 1.0 0 -16777216 true PLOT 693 149 1010 285 Trade Modes Time Trade 0.0 10.0 0.0 10.0 true true PENS "Total" 1.0 0 -16777216 true "FDC" 1.0 0 -6459832 true "GI" 1.0 0 -2674135 true "Exporter" 1.0 0 -1184463 true PLOT 669 426 869 576 Trade per Firm Firm exporting t Periods Quantity traded 0.0 10.0 0.0 10.0 true false PENS "default" 1.0 1 -16777216 true TEXTBOX 6 125 239 153 The economies are opened after 20 time steps 11 0.0 1 @#$#@#$#@ WHAT IS IT? ----------- This is a model of international Trade. It explains how incertitude, trade relations and different modes of export interact with each other. Exporters face incertitude, have to pay a sunk search cost and a fixed link-cost to maintain the relationship. Exporters will then endogenously choose different export modes. The different possibilities of export in the model are direct trade, trade through a general importer or installing a foreign distribution center. Trade evolves through consumers' love of variety. HOW IT WORKS ------------ The economy consists of two countries, left and right. Producers are different in productivity and have to search costly for a distributor to set up a trade relationship. Both, producers and distributors pay a link cost in order to maintain the trade relationship. Trade emerges because the consumers’ utility increases, when they can consume more different products (love for variety). Producers and distributors are hit by negative shocks (1/(P or D)-shock). Following which, the producer has to give up business totally while the distributor has to break one of his trade relations. The distributor will choose the least competitive producer to break the relation with him. In each time step, as many producers as had to give up business will enter the market. Because producers do not know their relative productivity, they have to make experience and overcome uncertainty about their competitiveness. If they are certain to be competitive, they will try to make business in the foreign country, while they have to pay a trade cost. But also the search cost and the cost to maintain a relationship increase for the foreign country. When producers are certain to be competitive in the foreign country, they will install a foreign distributor center (FDC). Distributors will make offers to foreign producers to supply them as a general importer (GI). This means, that the distributor, as a GI, imports goods and resells them to other local distributors. For more detailed information about the model please contact me. THINGS TO NOTICE ---------------- The model is able to replicate several facts which were discovered in recent empiric analysis on international trade: More productive exporters trade a big part of the overall trade (see graph "Trade per Productivity"). Trade relations are extremely short lasting and volatile, but if they survive the first periods, they increase the traded quantity (see graphs "Trade per Relation", "Trade per Firm"). Exporter use different trade modes. While a small part of firms use FDCs, they trade a big share of the overall trade. About 30% to 50% of traders use a GI while their share in total export is about the share of firms trading through a GI (hence also 30% to 50%). Finally, a big part of traders exports directly, while their traded quantity is very small (see the two graphs on the top). The model explains several more facts which need statistical analysis. HOW TO USE IT ------------- - anzcons, anzprod is the number of consumers and producers in each country. - gamma is a constant which influences the adaptation process of certainty. - 1/(P or D) -shock) is the probability for producers or distributors to be hurt by a negative shock. - fixcost is the producers fixed cost and also the cost to install a FDC. - searchcost is a sunk cost which the producer pays for every new link. - P/D-linkcost is the cost producers or distributors has to pay for every period and trade relations in order to maintain the partnership. - Demand is the demand of the part of the economy one distributor supplyies, which is always equal. - tradecost indicates how much of the traded quantity is lost during trade. Hence it is a variable trade cost. Further this parameter also increases search costs and link costs THINGS TO TRY ------------- By increasing the fix cost of a firm, fewer firms are able to stay on the market. This decreases competition and has also an influence on the mean productivity and the decomposition of the trade modes. Another thing to try is to increase or decrease the trade cost and study the decomposition of the trade modes. While GIs are very performing for low trade costs, there is a point from which on it becomes interesting to invest in a FDC. For very high trade costs the competitiveness of foreign supplier is very low and they will not invest in a FDC nor trade through a GI. CREDITS AND REFERENCES ---------------------- This model was built by Pascal Bürki. For more information you can contact me on pascal.buerki@hotmail.com @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 4.0.4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setup go sum reportGI1 sum reportGI2 sum reportGI3 sum reportGI4 sum reportFDC1 sum reportFDC2 sum reportFDC3 sum reportFDC4 sum reportexp1 sum reportexp2 sum reportexp3 sum reportexp4 sum reportUtility sum reportPriceindex sum mortality setup go sum reportGI1 sum reportGI2 sum reportGI3 sum reportGI4 sum reportFDC1 sum reportFDC2 sum reportFDC3 sum reportFDC4 sum reportexp1 sum reportexp2 sum reportexp3 sum reportexp4 sum reportUtility sum reportPriceindex sum mortality setup go count turtles setup go sum reportGI1 sum reportGI2 sum reportGI3 sum reportGI4 sum reportFDC1 sum reportFDC2 sum reportFDC3 sum reportFDC4 sum reportexp1 sum reportexp2 sum reportexp3 sum reportexp4 sum reportUtility sum reportPriceindex sum mortality setup go sum reportGI1 sum reportGI2 sum reportGI3 sum reportGI4 sum reportFDC1 sum reportFDC2 sum reportFDC3 sum reportFDC4 sum reportexp1 sum reportexp2 sum reportexp3 sum reportexp4 sum reportUtility sum reportPriceindex sum mortality setup go sum reportGI1 sum reportGI2 sum reportGI3 sum reportGI4 sum reportFDC1 sum reportFDC2 sum reportFDC3 sum reportFDC4 sum reportexp1 sum reportexp2 sum reportexp3 sum reportexp4 sum reportUtility sum reportPriceindex sum mortality setup go sum reportGI1 sum reportGI2 sum reportGI3 sum reportGI4 sum reportFDC1 sum reportFDC2 sum reportFDC3 sum reportFDC4 sum reportexp1 sum reportexp2 sum reportexp3 sum reportexp4 sum reportUtility sum reportPriceindex sum mortality setup go sum reportGI1 sum reportGI2 sum reportGI3 sum reportGI4 sum reportFDC1 sum reportFDC2 sum reportFDC3 sum reportFDC4 sum reportexp1 sum reportexp2 sum reportexp3 sum reportexp4 sum reportUtility sum reportPriceindex sum mortality @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@