# Internationalization of SMEs of a Country

No preview image

Model was written in NetLogo 5.0
•
Viewed 359 times
•
Downloaded 20 times
•
Run 0 times

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

## Comments and Questions

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

Click to Run Model

globals [hist eh cho history d ptc ptc1 r manufr xx xx2 po y z w g maxlife ind vg vg1 vg2 vg3 vg4 vg5 vg6 vg7 vg8 vg9 vg10 vg11 vg12 vg13 vg14 vg15 mhtime totord ss pm d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 winner win jack mcor maxbusy maxact maxsuc din damage fk maxloan typeo glob twork eh2 typ1 typ2 typ3 typ4] breed [knowag knw] ;; knowledge agent breed [manuf ma] ;; manufacturer breed [distr dist] ;; distributer breed [techag tch] ;; technology agent breed [rmatag rmat] ;; raw material agent breed [comag cag] ;; communication agent breed [crvty crvt];; creativity agent breed [competitors cmp]; breed [dcen dcend] directed-link-breed [streets street] directed-link-breed [streets1 street1] directed-link-breed [swats swat] directed-link-breed [channel chan] distr-own [demand cdem kdem timefor twill will past wages cdeml qulr fest ecost mak oppertunity perils setcost runcost] manuf-own [truck expenditure chul kul certified loan ex arc perception wealth nom nmatt mreq active sklr crvreq capacity pos lev rating temperament life ambition ordfl ftime manage status setst info1 info2 info3 info4 info5 info6 budtech glo anarchy bor orig cost suc pay dbos cont matflag assets style qul vision curios experience rgn1 rgn2 rgn3 rgn4 ofcap rgn5 rgn6 rgn7 rgn8 rgn9 rgn10 proactive when international htime tky standard socialize dums credit ito w2 learn itime] ;; manufacturer's variables techag-own [wealth level tecost hird hasten];; tp satisfaction att];; tech agent's var rmatag-own [wealth matt sdist pickup bsss address reached ondemand yor];; mp pric];; rawmat ag var comag-own [wealth distanc speed ab bc de ef gh boss v1 vt2 comcost];; comp satisfaction inf att] ;; comm ag var knowag-own [wealth kp satisfaction skl kcost];; att];; know ag var crvty-own [wealth ccp fun ccost];; satisfaction vis att] dcen-own [bsno] competitors-own [ver1 ver2 ver3 loser] patches-own [resistance rest units mine] to setup ;; setting it up __clear-all-and-reset-ticks create-knowag 10 create-techag 10 create-rmatag 10 create-comag 10 create-manuf 10 create-distr 10 create-crvty 10 create-competitors comp set history 10 set hist (count manuf) ask patches [ if pycor > 1 [ set rest (abs pycor)] ;; if pycor < 1 ;; [ set rest (-1 * pycor)] set resistance (rest + resistor) set mine random-normal 100 200 set pcolor blue if (pxcor > 7 and pxcor < 10 and pycor = -12) or (pxcor > 8 and pxcor < 11 and pycor = 5) or (pxcor > 10 and pxcor < 13 and pycor = -7) or (pxcor > 15 and pxcor < 18 and pycor = 5) or (pxcor > 13 and pxcor < 16 and pycor = 12) or (pxcor > 13 and pxcor < 16 and pycor = 0) [ set pcolor (random 100)]] ask knowag [set shape "person" set skl random 30 set kcost ((random 8) + skl / 10)] ask manuf [set shape "house" set wealth 1000 set assets random-normal 5000 5000 set socialize random-normal 2 4 set learn random-normal 3 5 set standard abs random-normal 500 1000 set proactive abs random-normal 1000 1500 set temperament random-normal 500 300 set ambition random-normal 5000 1000 set curios random-normal 50 30 set orig random-normal 0 1 set capacity random 300 set ofcap (capacity - random 20) if ofcap < 0 [set ofcap random 50] set when random 10 if when < 0 [ set when random 10 ] set perception random-normal 1000 500 if perception < 0 [set perception random-normal 1000 500] set style random 100 set cost random 5 + suc / 20 if capacity = 0 [set capacity random 50] set sklr random 40 set ordfl -10 set crvreq random 80] ;; manufacturer's have wealth =1000 at the start ask distr [set shape "house" set color green set kdem random 30 set cdem random 80 set wages random 10] ask competitors [set shape "house" set color orange];; ask rmatag [set shape "truck" set color lime set matt random 10] ask techag [ set shape "wheel" set tecost random 30 + level set hasten random 5 if (pxcor > 4 and pxcor < 6 and pycor = -10) or (pxcor > 4 and pxcor < 6 and pycor = -5) or (pxcor > 4 and pxcor < 6 and pycor = 0) or (pxcor > 4 and pxcor < 6 and pycor = 5) or (pxcor > 4 and pxcor < 6 and pycor = 0) or (pxcor > 4 and pxcor < 6 and pycor = 12) [ set level random 10]] ask crvty [set shape "person" set fun random 50 set ccost random 5] ask comag [ set shape "arrow" set color blue + 2 set distanc random 9 set speed random 2 if distanc > 9 [set distanc (distanc / 2)] if speed > 4 [set speed (speed / 2)]] ask comag [let zd (0) ask one-of manuf [ set zd who] set v1 (zd) set boss zd set comcost (random 2)] ask manuf [ set color red set xcor 4 set color green set sklr (random 40) set nmatt (random 10) set bor (random-normal 5000 200000) set pay (random-float 0.5) ;; set vision random-normal 50 60 if pay < 0.2 [set pay (random-float 0.5)] set ycor (random-normal 0 10) if any? manuf in-radius .25 [ask one-of manuf [ set ycor (ycor + .5)] if any? manuf in-radius .5 [ask one-of manuf [ set ycor (ycor + 1)]]]] ask distr [ set oppertunity random-normal 2 3 set perils random 12 set runcost random 2 if runcost < 1 [set runcost random 2] set setcost random-normal 5000 1000 if setcost < 5000 [ set setcost random-normal 20000 10000] set color red set xcor -10 set color yellow set mak random 3 set ycor (random-normal 0 10) if any? distr in-radius .25 [ ask one-of distr [ set ycor (ycor + .5)] if any? distr in-radius 1 [ask one-of distr [ set ycor (ycor + 1)]]]] ask competitors [set ycor 12 set color red set xcor (random-normal 0 10)] end to go tick if ticks > 100000 [stop] ask knowag ;; movement of agents < 55 [ ifelse pcolor > gray or pcolor < gray [ fd 1 if xcor < -10 [set xcor 0 fd 1]] [if color = 0 [ stop]]] ask techag [if color = red [ifelse (pcolor > blue or pcolor < blue) [stop] [ fd 2 if xcor < -10 [ set xcor 0 fd 2]]]] ask rmatag [if color = lime [ifelse pcolor != blue [ if (pcolor != gray) [ stop] ] [ fd 2 if xcor < -10 [set xcor 0 fd 2]]] ] ask comag [fd speed] ask crvty [ifelse pcolor > gray or pcolor < gray [ fd 1 if xcor < -10 [ set xcor 0 fd 1]] [if color = 0 [ stop]]] failuresit setdmd setchar environment exhibition certificate team setstatus bus buspast fanyl intel production histor game materials materialhandling techno comct do-plots growth movmanage minefield reckp social ;; piracy end to failuresit ask manuf [ ifelse color = white [set temperament ( temperament + 100) set bor (bor + (random 30))] [set temperament (temperament - 1.25) ] if temperament < 200 [set color red ;; wait .1 ] if temperament < 0 [die] ask manuf with [orig > 1] [ if any? manuf in-radius 10 with [orig < -2 ] [ set bor (bor + 6000)]] if bor < 100 [set color black] if bor = 6000 [set color pink] ;; if bor = 60000 ;; [die] ;; if bor = -5000 ;; [die] if loan > assets or wealth < -3000 [set fk (fk + 1) die]] if count manuf < 8 [create-manuf zk set history (history + zk) ask manuf [ if who > 70 and life < 100 [set proactive abs random-normal 10000 15000 set xcor 4 set color green set shape "house" set sklr (random 40) set socialize random-normal 2 4 set standard abs random-normal 500 1000 if sklr < 5 [set sklr (random 40)] set curios random-normal 50 30 set nmatt (random 10) if nmatt < 3 [ set nmatt random 10] set bor (random-normal 5000 200000) set assets random-normal 5000 5000 set proactive abs random-normal 1000 1500 set learn random-normal 3 5 set cost (random 15 + suc / 10) set orig random-normal 0 1 set temperament random-normal 500 300 ;; set vision random-normal 50 60 set style random 100 set when random 10 if when < 1 [set when random 10 ] set ambition random-normal 5000 1000 set perception random-normal 1000 500 if perception < 0 [set perception random-normal 1000 500] set capacity random 300 if capacity < 50 [set capacity random 300] set ofcap (capacity - random 20) if ofcap < 0 [set ofcap random 50] set pay random-float 0.5 if pay < 0 [ set pay random-float 0.5] if wealth > 5000 [set pay random-float 1] if pay < 0.2 [set pay random-float 0.5] if pay > .7 [set pay random-float 0.5] if wealth < 1001 [ set wealth 1000] set crvreq random 80 if crvreq < 8 [set crvreq random 80] if manufr = limt [ask manuf [ if (temperament < 500 or ambition > 6000) and status = 0 and suc < 1 [set sklr (random 40) set crvreq (random 50) set bor (bor - random 30) set nmatt (random 10) set lev (random 20)]]] if manufr > limt [ set manufr 0] set ycor (random-normal 0 10) if any? manuf in-radius .25 [ ask one-of manuf [ set ycor (ycor + .5)] if any? manuf in-radius .5 [ ask one-of manuf [ set ycor (ycor + 1)]]]]]] end to setdmd ;; demands for distributers set here. they vary with every day. set d (d + 1) if d = 50 [ask distr [ set oppertunity random-normal 2 3 set perils random 12 set setcost (random-normal 5000 1000 ) if setcost < 5000 [ set setcost random-normal 10000 1000] set runcost abs random 5 + ( count( my-in-links)) if runcost < 1 [set runcost random 5] set qulr random 20 + (qulsld) set demand (random 20 * sld1) ;; slider 1 for demand if demand < 10 [ set demand (random 20 * sld1)] set kdem (random 40) if kdem < 8 [ set kdem random 40] set cdem (random 80) if cdem < 10 [set cdem random 80] set ecost random 100 set cdeml (cdem + random 5) set wages (random 20) if wages < 4 [set wages (random 20)] set timefor (random 20) set twill (random 500) ifelse twill > 250 [set will 1] [set will 0] if timefor = 0 [set timefor (random 10)]]] if d > 50 [set d 0] end to setchar set r (r + 1) set manufr (manufr + 1) if r = 100 [ask knowag [ set skl (random 40) set kcost ((random 8) + skl / 10)] ask crvty [set fun (random 60)] ask rmatag [set matt (random 10)] ask techag [ set level (random 20)] ask comag [ set speed (random 2) set distanc (random 9) if distanc > 9 [set distanc (distanc / 2)] if speed > 2 [set speed (speed / 2)]] ask competitors [set xcor random 6 set ycor random 10]] if r > 100 [set r 0] if manufr = limt [ask manuf [ if proactive < 0 [set proactive random-normal 10000 15000] if cost < 4 [set cost (random 15 + suc / 10)] if (temperament < 500 or ambition > 6000) and status = 0 and suc < 1 [set sklr (random 40) set crvreq (random 50) set bor (bor - random 30) set nmatt (random 10) set lev (random 20)]]] if manufr > limt [ set manufr 0] end to environment let io 0 ask patches [ set io io + 1 if io = 100 [ if (pxcor > 7 and pxcor < 10 and pycor = -12) or (pxcor > 8 and pxcor < 11 and pycor = 5) or (pxcor > 10 and pxcor < 13 and pycor = -7) or (pxcor > 13 and pxcor < 16 and pycor = 5) or (pxcor > 13 and pxcor < 16 and pycor = 12) or (pxcor > 13 and pxcor < 16 and pycor = 0) [ set pcolor (random 100) ] set resistance (rest + resistor) set mine random-normal 100 200 set io 0 ] if pxcor > -17 and pxcor < -13 and pycor = 16 [ if any? turtles in-radius 0.5 [set pcolor blue] if policy > 0 and policy < 5 [ set pcolor red] if policy > 5 and policy < 10 [set pcolor brown] if policy > 10 and policy < 15 [set pcolor pink] if policy > 15 and policy < 20 [set pcolor yellow]]] end to exhibition let riq 0 let ecostt 0 let distbosw 0 set din (din + 1) if din = 300 [ set din 0] if din = 100 [ask distr with [oppertunity > 2.5] [ set fest 1 set distbosw who set ecostt ecost]] ask distr with [fest = 1 ] [ if din > 280 [set fest 0] ask patches in-radius 0.5 [set pcolor pink] ask manuf [if any? manuf with [info6 = 1 and curios > 60 and crvreq > info3 and status = 0 ] [ set eh (eh + 1) ]] ask manuf with [info6 = 1 and curios > 60 and status = 0 and crvreq > info3 ] [ set ex (ex + 1) set eh2 (eh2 + 1) set status 1 set wealth (wealth - info4) set ordfl (capacity) set ftime 1 set color orange set dbos info1 set info6 0 ]] ask distr with [fest = 0] [ask patches in-radius 0.5 [set pcolor blue]] end to certificate ask manuf [if life > 1000 and wealth > 3000 and suc > 15 [ set certified (certified + 1)] if certified > 0 [ set color yellow ]] end to team ask manuf [ ifelse show-sklr? [ set label sklr ] [ set label "" ] ask knowag in-radius 2 [ if skl = [sklr] of myself [ set color black]] ask crvty in-radius 2 [if fun = [crvreq] of myself [set color green]] if any? techag in-radius 0 [ set ito [level] of one-of techag in-radius 0 ] ifelse any? knowag in-radius 2 with [skl = [sklr] of myself] or any? crvty in-radius 2 with [fun = [crvreq] of myself] [set color white ;;wait .1 ask patches in-radius 2 [set pcolor 5] set qul (sklr + ito)] [ set color green ask patches in-radius 2 [set pcolor blue] ask knowag in-radius 2 [set color red fd 1] ask crvty in-radius 2 [set color orange fd 1]] ] ask knowag [ifelse show-skl? ;; wealth display [ set label skl ] [ set label "" ]] ask manuf [ ifelse show-wealth? ;; wealth display [ set label wealth ] [ set label "" ]] end to setstatus ask manuf [if color = green [ set setst 0]] ask manuf with [color = white] [ ask manuf with-max [suc] [ set setst 1]] end to bus let n (0) let n2(0) let kt (0) let mt (0) let wage 0 let yo 0 let gr (0) let gr11 0 let kt11 0 let ax (0) ;; for knowing demand let bx (0) ;; for time in which to deliver let rolx (0) let tolx 0 let distbos 0 let cdeml2 0 let loanq 0 let qq 0 ask manuf [ if color = white [ set kt (sklr) set mt (crvreq)]] ask distr [ set gr (kdem) set cdeml2 cdeml set qq qulr set gr11 (cdem) set rolx demand set tolx timefor set wage wages set loanq ((wages / 5) * demand) set distbos who if tolx = 0 [set tolx 1] ifelse any? manuf with [color = white and (sklr > [kdem] of myself and crvreq > [cdem] of myself) and capacity > [(demand / (timefor + 1))] of myself and cost < [wages] of myself and status = 0 and wealth > 1000 and qul > [qulr] of myself and ordfl < 1 ] and will > 0 [ set color green ;; type "r" set n (1) set ax (demand) set bx (timefor) ;; ifelse count manuf with [color = white and sklr > gr and crvreq > gr11 and crvreq < cdeml2 and capacity > (rolx / tolx) and cost < wage and wealth > loanq and qul > qq] > 1 ;; [ ask manuf with [(color = white and sklr > gr and crvreq > gr11 and capacity > (rolx / tolx) and cost < wage and setst = 1 and wealth > loanq and qul > qq) or certified > 1 ] ;; [ set yo who ;; set status 1 ;; set dbos distbos ;; ask distr with [who = distbos] ;; [set past 1] ]] ask manuf with [color = white and (sklr > [kdem] of myself and crvreq > [cdem] of myself) and capacity > [(demand / (timefor + 1))] of myself and cost < [wages] of myself and status = 0 and wealth > 1000 and qul > [qulr] of myself and ordfl < 1 ] [ set dbos [who] of myself set ordfl [demand] of myself set ftime [timefor] of myself set status 1 ;; set dbos distbos ask distr with [who = [dbos] of myself] [set past 1]] create-streets-to manuf with [color = white and (sklr > [kdem] of myself and crvreq > [cdem] of myself) and capacity > [(demand / (timefor + 1))] of myself and cost < [wages] of myself and status = 0 and wealth > 1000 and qul > [qulr] of myself and ordfl < 1 ] ;;and status = 0] ask streets [set color white] ] [set color yellow set n 0 ] ] ;; ask streets ;; [die]]] ask manuf [if color != white or ordfl < 1 [set status 0] if status = 1 [ set dbos dbos]] set xx (xx + n) end to buspast let nwq (0) let n2(0) let kt (0) let mt (0) let yo 0 let gr (0) let gr11 0 let kt11 0 let ax (0) ;; for knowing demand let bx (0) ;; for time in which to deliver let rolx (0) let tolx 0 let distbos 0 let dpast 0 ask manuf [if color = white [ set kt (sklr) set mt (crvreq) ;; set dpast who ]] ask distr [set gr (kdem) set gr11 (cdem) set rolx demand set tolx timefor set dpast who if tolx = 0 [set tolx 1] ask distr [ ifelse any? manuf with [(color = white and capacity > [(demand / (timefor + 1))] of myself and dbos = [who] of myself and status = 0 and ordfl < 1) or (info6 = 1 and dbos = [who] of myself)] and twill > 150 [set color white type 2 set nwq (1) ask manuf with [(color = white and capacity > [(demand / (timefor + 1))] of myself and dbos = [who] of myself and status = 0 and ordfl < 1) or (info6 = 1 and dbos = [who] of myself)] [ set ordfl [demand] of myself set ftime [timefor] of myself set yo who set status 1 set dbos [who] of myself] create-streets-to manuf with [(color = white and capacity > [(demand / (timefor + 1))] of myself and dbos = [who] of myself and status = 0 and ordfl < 1) or (info6 = 1 and dbos = [who] of myself)];and status = 0] ask streets [set color yellow]] [set nwq 0 set color yellow ask streets [die]]]] ask manuf [ if color != white and ordfl < 1 [set status 0] if status = 1 [ set dbos dbos] ] set xx2 (xx2 + nwq) end to fanyl ask manuf [ if suc < 1 [set credit 2] if suc > 0 and suc < 4 [set credit 1.4] if suc > 4 and suc < 8 [set credit 1 ] if suc > 8 and suc < 16 [set credit .8] if suc > 16 and suc < 32 [set credit .6] if suc > 32 [set credit .4] if wealth < perception [ set loan (loan + (perception - abs wealth)) set wealth (wealth + loan) ] set loan (loan + (loan * interest) + credit) if loan > maxloan [set maxloan loan] if wealth > (5 * perception) and loan > 0 [ set wealth (wealth - loan) set loan 0 ] if style > 10 and style < 25 [set expenditure 1] if style > 25 and style < 50 [set expenditure 3] if style > 50 and style < 70 [ set expenditure 5] if style > 75 [ set expenditure 7] ] end to intel end to production let fv 0 ;; let w2 0 let ccost2 0 let kcost2 0 let comcost2 0 let sdistcost2 0 let gm 0 let mreq2 0 let temp2 0 let pol2 0 let loanc 0 let tcost 0 let mak2 0 let sab 0 ask manuf [ if temperament > 500 and temperament < 300 [ set temp2 2] if temperament > 300 and temperament < 100 [ set temp2 6] set gm (who) if status = 1 [ ask comag with [boss = who] [set comcost2 comcost] ask rmatag in-radius 2 [set sdistcost2 sdist set mreq2 pickup] ask knowag in-radius 2 [set kcost2 kcost] ask techag in-radius 1 [set tcost tecost] ask crvty in-radius 2 [set ccost2 ccost]] set wealth (wealth + w2 - ((kcost2 + ccost2 + comcost2 + sdistcost2 + tcost) * (pay + temp2) + (pol2) + (mreq2 / 10) + expenditure) ) ifelse (ordfl > 0 and mreq > 0 ) or (ordfl > 0 and info6 = 1 and mreq > 0) or (dums = 1 and ordfl > 0) [ set manage (ordfl / (capacity + 1)) set experience (experience + mak2) ;; if ordfl > 0 ;; (manage < ftime or manage = ftime) [ set ordfl (ordfl - (capacity)) ;; type "g" ;;beep set w2 (capacity * cost) if dums = 1 [ set w2 (w2 /( count (manuf with [vision = [vision] of myself])+ 1))] ;; type "ordfl" show ordfl ;; type "status" show status ;; type "ton" show (wealth + w2 + ((kcost2 + ccost2 + comcost2) * pay) ) ;; type "suc" show suc ;; type "cost" show cost ;; type "batch" show capacity ;; type"wealth" show w2 ;; type "dist" show sdistcost2 ;; type "cost2" show ccost2 ;; type "kcost2" show kcost2 ;; type "comcost2" show comcost2 ;; type "pay" show pay ;; type "boss" show dbos ;; type "mwas" show mreq ;; type "tax" show pol2 ;; type"total" show jack ;; type"exh" show info6 set mreq 0] ;; type "mis" show mreq ;; type " " if (ordfl = 0) or (ordfl < 0) [set totord (totord + 1) set pol2 policy set jack jack + 1 set color pink set status 0 set suc (suc + 1) if dbos = 50 [set rgn1 (rgn1 + 1)] if dbos = 51 [set rgn2 (rgn2 + 1)] if dbos = 52 [set rgn3 (rgn3 + 1)] if dbos = 53 [set rgn4 (rgn4 + 1)] if dbos = 54 [set rgn5 (rgn5 + 1)] if dbos = 55 [set rgn6 (rgn6 + 1)] if dbos = 56 [set rgn7 (rgn7 + 1)] if dbos = 57 [set rgn8 (rgn8 + 1)] if dbos = 58 [set rgn9 (rgn9 + 1)] if dbos = 59 [set rgn10 (rgn10 + 1)] set temperament 1000 if suc > maxsuc [ set maxsuc suc] ;; set status (status + 1) ]] [ set color green set w2 0 set status 0 ] ;; show capacity ;;type "___________" ;; show ordfl ;; type "- - - - - - " ] end to game let ev (0) let ev1 (0) let ev2 (0) ask competitors [ if loser = 0 [ ask distr [set twill (twill)]]] set pm (pm + 1) if pm = 24 [ask competitors [set ver1 (random c1) set ver2 (random c2) set ver3 (random c3) set loser losers ifelse any? distr with [(cdem > [ver1] of myself and kdem > [ver2] of myself and demand > [ver3] of myself)] and loser = 0 [ ask streets1 [die] set shape "face sad" set color red] [ set shape "face happy" set color white ask one-of distr [if twill > 200 [ set twill (twill - (random 4)) set color red]] ask one-of manuf [ if color > white or color < white [set color gray set temperament (temperament - 2)]] create-streets1-to manuf with [color = gray] ask streets1 [set color white]]]] if pm > 24 [set pm 0] ask distr [ ask manuf with-min [anarchy] [ if anarchy > 10000 [ ask distr [ set twill 1000]]] ask competitors with-max [ver2] [if ver1 < 10 and ver2 < 10 and ver3 < 10 [ ask distr [ set color blue set twill (twill + 10)]]]] end to histor let p (count manuf with [color = white]) let xy 0 let rv 0 ifelse z > p [ set z (z)] [set z (p)] set w (z) ask manuf [ ifelse status = 1 [set nom (nom + 1) set active (active + 1) if nom > maxbusy [set maxbusy nom] if active > maxact [set maxact active]] [set nom 0 set active (active + 0)] ifelse color = white [ if xy > 1 [set xy 0] set rating (rating + xy) set xy (xy + 1) ] [set xy 0] if htime > mhtime [set mhtime htime] set life (life + 1) if life > maxlife [set ind (who) set maxlife (life)] ;; reward if (wealth - loan) > winner [ set win who set winner (wealth - loan)]] end to materials ask rmatag [ if color = lime [ set pickup units] set pickup pickup + 0] end to materialhandling ask rmatag with [(pcolor != blue) and color = lime] [ if (pcolor != gray) [ set pickup pcolor]] ask rmatag [ if any? manuf with [(nmatt < [matt] of myself) and mreq = 0] and ondemand = 0 and color = lime and pickup > 0 [ set color red set ondemand 1 set color white] if ondemand = 1 and pickup > 0 [ ifelse any? manuf with [nmatt < [matt] of myself and mreq = 0] [ ask one-of manuf with [(nmatt < [matt] of myself) and mreq = 0][set truck [who]of myself ] if xcor < 4 or xcor > 6 [ set xcor (xcor + (1 - 0.05 * resistance)) set sdist (sdist + 1)] if xcor > 4 [ if ycor != [ycor] of one-of manuf with [truck = [who] of myself] [ set ycor ycor + 1] move-to one-of manuf with [truck = [who] of myself and mreq = 0] ask manuf with [(nmatt < [matt] of myself) and mreq = 0 and truck = [who] of myself] [set mreq [pickup] of myself ] set color lime set pickup 0 set ondemand 0 set sdist 0]][set color lime set ondemand 0 set sdist 0 set pickup 0]]] end to techno let zp (0) let matr1 (0) let dumhird (0) let no1 (0) set ptc1 (ptc1 + 1) if ptc1 = 300 [ask patches [ if (pxcor > 4 and pxcor < 6 and pycor = -10) or (pxcor > 4 and pxcor < 6 and pycor = -5) or (pxcor > 4 and pxcor < 6 and pycor = 0) or (pxcor > 4 and pxcor < 6 and pycor = 5) or (pxcor > 4 and pxcor < 6 and pycor = 0) or (pxcor > 4 and pxcor < 6 and pycor = 12) [ set pcolor (random 50) ]]] if ptc1 > 300 [set ptc1 0 ask techag [set tecost random 30 set hasten random 5]] ask techag [ask manuf with [color = white or status = 1] [ set matr1 (nmatt) set no1 (who)] ifelse level > matr1 [ set color yellow ;; wait 1 ;;stat 1 move-to turtle no1 set dumhird 1 set zp (zp + 1) if zp = 1 [ set tecost (tecost + hird)] set hird 1 set xcor (xcor + 1)] [ set color red set zp 0 set hird (hird + dumhird + level / 5) set dumhird 0 ] if hird > 100 [ set hird (0)]] end to comct let ab1 (0) let bc1 (0) let de1 (0) let ef1 (0) let gh1 (0) let ij1 0 let ij 0 let di1 (0) let di2 (0) let di3 (0) let di4 (0) ;; let ss (0) let dum 10 let zd 0 ask comag [ ;; let ze (0) ;; ifelse is-turtle? boss ;; [set boss (v1)] ;; [ ;; ask one-of manuf [ ;; set ze who] ;; set boss ze ;; set v1 (ze)] ;; ask cag 31 ;; [ ;; show boss] ;; type "_______________" set ss (boss) if xcor < -4 and ycor < 4 [ set color orange ;; wait 0.1 ifelse any? distr in-radius distanc [ask one-of distr in-radius distanc [set ab1 who set bc1 kdem set de1 cdem set ef1 ecost set gh1 will set ij1 fest] set ab ab1 set bc bc1 set de de1 set ef ef1 set gh gh1 set ij ij1 ifelse is-turtle? turtle (boss) [ move-to turtle (boss)] [ ask one-of manuf [set zd who ] set boss zd] ;; wait 1 set dum (dum - 1) if dum = 0 [fd speed] set color yellow ;; wait .1 ] [set color blue + 2] set ab ab1 set bc bc1 set de de1 set ef ef1 set gh gh1 set ij ij1 ]] let kpo 0 let kpo2 0 ask manuf with [who = ss] [ ifelse any? comag in-radius 0 [ ifelse kpo > 0 [ set info1 0 set info2 0 set info3 0 set info4 0 set info5 0 set info6 0] [ set info1 ab1 set info2 bc1 set info3 de1 set info4 ef1 set info5 gh1 set info6 ij1] set kpo (kpo + 1)] [ ifelse kpo2 > 0 [ set ab1 0 set bc1 0 set de1 0 set ef1 0 set gh1 0 set ij1 0] [ set info1 (info1) set info2 (info2) set info3 (info3) set info4 (info4) set info5 (info5) set info6 (info6) if (info2 > sklr) and learn > 2 [set sklr (sklr + abs (learn / 10))] ] set kpo2 (kpo2 + 1)] ;; show info1 ;; show info2 ;; show info3 ;; show info4 ;; show info5 ;; type "_______" ] end to minefield let dang 0 ask patches ;; with [pxcor < 0] [if mine > danger [ ;; set pcolor black if any? rmatag in-radius 1 [ ask rmatag in-radius 1 [ set color black set pickup 0 set yor yor + 1 set damage (damage + 1) if yor = 15 [set color lime set yor 0] ] ] set mine (mine - random 50)]] end to growth let rdo 0 let stc1 0 let stc2 0 let stc3 0 let stc4 0 let stc5 0 let stc6 0 let stc7 0 let stc8 0 let stc9 0 let stc10 0 let dmd1 0 let dmd2 0 let dmd3 0 let dmd4 0 let dmd5 0 let dmd6 0 let dmd7 0 let dmd8 0 let dmd9 0 let dmd10 0 let rco1 0 let rco2 0 let rco3 0 let rco4 0 let rco5 0 let rco6 0 let rco7 0 let rco8 0 let rco9 0 let rco10 0 let pdo 100000 let bs 0 ask manuf [ if wealth > proactive and suc > 1 [set tky 1] if rgn1 = when and tky = 1 [ ask dist 50 [set stc1 (setcost + setcost * (count(my-in-links))) set dmd1 oppertunity set rco1 runcost + (count(my-in-links))] set wealth (wealth - rco1) if dmd1 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000 ] if wealth > stc1 [create-channel-to distr with [who = 50] set rgn1 rgn1 + 1 set wealth (wealth - (stc1 * expenditure)) set international (count my-out-links)]] if rgn2 = when and tky = 1 [ask dist 51 [set stc2 (setcost + setcost * (count(my-in-links))) set dmd2 oppertunity set rco2 runcost + (count(my-in-links))] set wealth (wealth - rco2) if dmd2 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc2 [ create-channel-to distr with [who = 51] set rgn2 rgn2 + 1 set wealth (wealth - (stc2 * expenditure)) set international (count my-out-links)]] if rgn3 = when and tky = 1 [ask dist 52 [set stc3 (setcost + setcost * (count(my-in-links) )) set dmd3 oppertunity set rco3 runcost + (count(my-in-links))] set wealth (wealth - rco3) if dmd3 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc3 [create-channel-to distr with [who = 52] set rgn3 rgn3 + 1 set wealth (wealth - (stc3 * expenditure)) set international (count my-out-links)]] if rgn4 = when and tky = 1 [ask dist 53 [ set stc4 (setcost + setcost * (count(my-in-links) )) set dmd4 oppertunity set rco4 runcost + (count(my-in-links))] set wealth (wealth - rco4) if dmd4 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc4 [create-channel-to distr with [who = 53] set rgn4 rgn4 + 1 set wealth (wealth - (stc4 * expenditure)) set international (count my-out-links)]] if rgn5 = when and tky = 1 [ask dist 54 [set stc5 (setcost + setcost * (count(my-in-links))) set dmd5 oppertunity set rco5 runcost + (count(my-in-links)) ] set wealth (wealth - rco5) if dmd5 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc5 [create-channel-to distr with [who = 54] set rgn5 rgn5 + 1 set wealth (wealth - (stc5 * expenditure)) set international (count my-out-links)]] if rgn6 = when and tky = 1 [ask dist 55 [set stc6 (setcost + setcost * (count(my-in-links))) set rco6 runcost + (count(my-in-links)) set dmd6 oppertunity ] set wealth (wealth - (rco6 * expenditure)) if dmd6 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc6 [create-channel-to distr with [who = 55] set rgn6 rgn6 + 1 set wealth (wealth - stc6) set international (count my-out-links)]] if rgn7 = when and tky = 1 [ask dist 56 [set stc7 (setcost + setcost * (count(my-in-links) )) set rco7 runcost + (count(my-in-links)) set dmd7 oppertunity ] set wealth (wealth - (rco7 * expenditure)) if dmd7 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc7 [create-channel-to distr with [who = 56] set rgn7 rgn7 + 1 set wealth (wealth - stc7) set international (count my-out-links)]] if rgn8 = when and tky = 1 [ask dist 57 [set stc8 (setcost + setcost * (count(my-in-links) )) set rco8 runcost + (count(my-in-links)) set dmd8 oppertunity] set wealth (wealth - (rco8 * expenditure)) if dmd8 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc8 [create-channel-to distr with [who = 57] set rgn8 rgn8 + 1 set wealth (wealth - stc8) set international (count my-out-links)]] if rgn9 = when and tky = 1 [ask dist 58 [set stc9 (setcost + setcost * (count(my-in-links) )) set rco9 runcost + (count(my-in-links)) set dmd9 oppertunity ] set wealth (wealth - (rco9 * expenditure)) if dmd9 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc9 [create-channel-to distr with [who = 58] set rgn9 rgn9 + 1 set wealth (wealth - stc9) set international (count my-out-links)]] if rgn10 = when and tky = 1 [ask dist 59 [set stc10 (setcost + setcost * (count(my-in-links) )) set dmd10 oppertunity set rco10 runcost + (count(my-in-links)) ] set wealth (wealth - rco10) if dmd10 > 2 [set wealth (wealth + (cost * ofcap)) set htime (htime + 1) set temperament 1000] if wealth > stc10 [create-channel-to distr with [who = 59] set rgn10 rgn10 + 1 set wealth (wealth - (stc10 * expenditure)) set international (count my-out-links)]] ask channel [set color red] if international > 0 [ set glo (glo + 1) if glo = 1 [set glob glob + 1]] ] end to do-plots ask manuf [if life = 2001 [set vg1 (vg1 + 1)] if life = 4001 [set vg2 (vg2 + 1)] if life < 1000 and temperament < 1 [set vg (vg + 1)] if life = 8001 [set vg3 (vg3 + 1)] if life = 2001 and curios < 60 and socialize < 4 [set vg4 (vg4 + 1)] if life = 2001 and curios > 60 and socialize < 4 [set vg5 (vg5 + 1)] if life = 2001 and curios < 60 and socialize > 4 [set vg6 (vg6 + 1)] if life = 2001 and curios > 60 and socialize > 4 [set vg7 (vg7 + 1)] if life = 4001 and curios < 60 and socialize < 4 [set vg8 (vg8 + 1)] if life = 4001 and curios > 60 and socialize < 4 [set vg9 (vg9 + 1)] if life = 4001 and curios < 60 and socialize > 4 [set vg10 (vg10 + 1)] if life = 4001 and curios > 60 and socialize > 4 [set vg11 (vg11 + 1)] if life = 8001 and curios < 60 and socialize < 4 [set vg12 (vg12 + 1)] if life = 8001 and curios > 60 and socialize < 4 [set vg13 (vg13 + 1)] if life = 8001 and curios < 60 and socialize > 4 [set vg14 (vg14 + 1)] if life = 8001 and curios > 60 and socialize > 4 [set vg15 (vg15 + 1)] if life = 1 and curios < 60 and socialize < 4 [set typ1 (typ1 + 1)] if life = 1 and curios > 60 and socialize < 4 [set typ2 (typ2 + 1)] if life = 1 and curios < 60 and socialize > 4 [set typ3 (typ3 + 1)] if life = 1 and curios > 60 and socialize > 4 [set typ4 (typ4 + 1)] ] set-current-plot "SME" set-current-plot-pen "p1" plot history set-current-plot "sme" set-current-plot-pen "p2" plot vg set-current-plot "sme" set-current-plot-pen "p3" plot vg1 set-current-plot "sme" set-current-plot-pen "p4" plot vg2 set-current-plot "sme" set-current-plot-pen "p5" plot vg3 set-current-plot "t" set-current-plot-pen "p6" plot vg4 set-current-plot "t" set-current-plot-pen "p7" plot vg5 set-current-plot "t" set-current-plot-pen "p8" plot vg6 set-current-plot "t" set-current-plot-pen "p9" plot vg7 set-current-plot "t" set-current-plot-pen "p10" plot vg8 set-current-plot "t" set-current-plot-pen "p11" plot vg9 set-current-plot "t" set-current-plot-pen "p12" plot vg10 set-current-plot "t" set-current-plot-pen "p13" plot vg11 set-current-plot "t" set-current-plot-pen "p14" plot vg12 set-current-plot "t" set-current-plot-pen "p15" plot vg13 set-current-plot "t" set-current-plot-pen "p16" plot vg14 set-current-plot "t" set-current-plot-pen "p17" plot vg15 end to movmanage ask knowag [ if count knowag in-radius 3 > 2 [ask one-of knowag in-radius 2 [fd 4] ]] ask rmatag [ if count rmatag in-radius 2 > 2 [ask one-of rmatag in-radius 2 [fd 4] ]] ask crvty [if count crvty in-radius 3 > 2 [ask one-of crvty in-radius 2 [fd 4] ]] end to reckp let n 0 ask manuf [ if life = 1000 or life = 2000 or life = 4000 or life = 8000 or suc > 300 or (international = 1 and glo = 1) [ type "time" show ticks type "active" show active type "sklr" show sklr type "learn" show learn type "capacity" show capacity type "crvreq" show crvreq type "success" show suc type "X" show xcor type "y" show ycor type "material" show nmatt type "nature" show socialize type "mt" show mreq type "tech" show budtech type "curios" show curios type "when" show when type "old" show life ] if suc > 300 [die] ] end to piracy end to social let cre 0 let mre 0 let lead 0 let group 0 let checker 0 let skill2 0 let crv2 0 let capacity22 0 let d2r 0 let day2r 0 let bs2r 0 let mater2 0 let qull2 0 ask manuf [if (temperament < standard or wealth < standard) and (socialize > 4) and (suc < 100) and (mreq > 0) [ set group random-normal 100 12 set vision group set checker group ;; if any? manuf with [vision = checker] ;; [ ;; set color red ;; ] ask manuf in-radius 4 with [suc < 100] [if socialize > 4 [set color red set vision group] ] type who ] if count (manuf with [(vision = checker) and (vision > 0) and (suc < 100)] ) > 1 [ ask manuf with [(vision = checker) and (status = 0) and (suc < 100)] [ if skill2 < sklr [set skill2 sklr] if sklr < skill2 [if learn > 4 [ set sklr sklr + .5 set wealth (wealth - .100)]] if crv2 < crvreq [set crv2 crvreq] if crvreq < crv2 [if learn > 4 [set crv2 crv2 + .5 set wealth (wealth - .200)]] if capacity22 < capacity [set capacity22 capacity] if capacity < capacity22 ;;and learn > 4 [if learn > 4 [set capacity capacity + 1 set wealth (wealth - .500)]] if mater2 < mreq [set mater2 mreq] if qull2 < qul [set qull2 qul] ifelse any? distr with [kdem < skill2 and demand > capacity22 and twill > 200 and qulr < qull2] [ create-swats-to distr with [kdem < skill2 and demand > capacity22 and twill > 200 and qulr < qull2] ask swats [set color orange] set twork (twork + 1) set twork (twork) ask distr with [kdem < skill2 and demand > capacity22 and twill > 200 and qulr < qull2] [ set d2r demand set day2r timefor set bs2r who] set ftime day2r set dbos bs2r set ordfl d2r set dums 1 set status 1 type"A" type capacity22 type "B" type skill2 type"C" type crv2 ] [set dums 0 set status 0 ask swats[die]]]] ] end

There are 5 versions of this model.

## Attached files

File | Type | Description | Last updated | |
---|---|---|---|---|

model.png | png | image | over 6 years ago, by Muhammad Irfan Azhar | Download |

This model does not have any ancestors.

This model does not have any descendants.