; ; SEIN model: knowledge and economy levels ; Nigel Gilbert, Petra Ahrweiler, Andreas Pyka, Ramon Scholz ; ; DO NOT DISTRIBUTE TO OTHERS ; If you would like a copy, email ramon.scholz@uni-bremen.de ; and you'll get the current version! ; ; This code is work in progress and contains bugs and design flaws ; that may be eliminated in the next version ; Copyright Nigel Gilbert, Petra Ahrweiler, Andreas Pyka and Ramon Scholz (C) 2003-6 ; ; version 2.0 25 August 2003 ; version .1 1 September 2003 Bugs caused by extreme parameter values removed. ; Partnerships added ; version .2 17 September 2003 Networks added ; version .3 26 October 2003 Some network bugs removed and plots added ; version .4 1 November 2003 Economy added ; version .5 8 November 2003 Bugs, converted to NetLogo 2.0 ; version .7 12 November 2003 Partners cannot be from networks ; version .9 13 November 2003 (Hamburg) Network bugs removed ; version 3.0 14 November 2003 Tidy up; make environmental inputs and outputs product ranges ; version .2 27 December 2003 Changed incremental research direction setting ; version .3 27 December 2003 Network graphics ; version .6 2 January 2004 Herfindahl index, bug fixes, shorter partner search ; version .7 15 February 2004 Connectivity graph; variable start-ups; random initial capital; ; increased radical research threshold; changed network display ; version .8 24 January 2006 Added degree distribution plot ; version .9 31 May 2006 Added code for Behaviour Space runs ; version 4.0 16 June 2006 Real valued abilities, many bug fixes ; version 4.22 16 August 2006 IH no longer dependent on Abilities ; Networks now cost partners to create ; version 4.23 19 August 2006 Stop crashing in make-networks ; version 4.24 19 August 2006 reward-to-trigger-start-up adjusted to 950 ; version 4.27 5 September 2006 Increase final-price; changed back to map-artefact; using cost-plus pricing; ; incr-step now proportional to capability value ; ; Notes: ; A firm cannot be a member of more than 1 network at any one time ; In the plots, networks are included in the count of firms (but not partnerships) ; model-specific options: ; Random initial capital of firms with !! create-custom-firms nFirms [ set capital (random capital-variance + initial-capital - capital-variance / 2 ] !! ; placing the 'location of origin' of the screen to an corner ; For make-kene: An other while loop for refilling the removed kenes ; adjacency matrix generation stuff deleted NG 7.10.2007 ; globals preceded by ';' below are set by sliders, not by code globals [ step ; time step stopnow ; if true, the simulation stops immediately initial-capital ; the capital that a firm starts with current-max-Firm-ID ; ID-counter for the Firm-IDs ; nFirms ; the number of firms initially ; nProducts ; the number of products that are possible ; nInputs ; the maximum number of inputs that a firm can require ; n-big-firms ; number of firms with 10 times initial capital of rest maxPrice ; maximum initial price of any product maxQuality ; maximum initial quality of any product ; reward-to-trigger-start-up ; a start-up is created when the best reward in the ; round is more than or equal to this max-ih-length ; maximum length of an innovation hypothesis nCapabilities ; global number of capabilities possible ; delta ; the amount by which a product can differ from the value ; of an input and still be useable for that input ; attractiveness-threshold ; how attractive a firm must be before it becomes a ; partner ; partnership-strategy ; whether partners as alike (conservative) or as different ; as possible are sought ; success-threshold ; how successful an innovation must be before it is a ; success low-capital-threshold ; if a firm's capital is below this, it does radical ; research capital-knowledge-ratio ; proportionality between kene length and firm's ; capital incr-research-tax ; tax paid for one step of incremental research radical-research-tax ; tax paid for one step of radical research collaboration-tax ; tax paid for every partnership per step depreciation ; tax paid per step by every firm ; incr-step ; size of step change in ability made in incremental research largest-capital ; updated every round: the capital of the richest form ; open-system ; if true, there are producers of raw materials and consumers of ; end-products, otherwise all inputs must be obtained as ; products from other firms in the system raw-cost ; the cost of a unit of raw material raw-materials ; the inputs that come from the environment are ; numbered 0 up to (but not including) this end-products ; the outputs that are bought by the end-user (final consumers) are ; numbered greater than (nProducts - end-products) final-price ; the selling price of a unit sold to the end-user max-partners ; the maximum number of potential partners a firm searches for activity ; description of the phase of activity of the model total-innovations ; accumulated number of successful innovations since the ; start of the run gamma ; slope of power law of network size distribution herfindahl ; Herfindahl index the-firms ; agentset of firm agents, distinguished from the ; others so that their success can be tracked under various ; conditions. The firms are randomly chosen from those that ; are in existence at step 50. total-age-of-the-firms ; total of the lifespans of the selected firms successes-of-the-firms dead-ages ; a list of the ages at death of all dead firms since the start net-dead-ages ; a list of the ages at death of all dead network firms since the start time ; current time in milliseconds ; exp-condition ; set by Behaviour space to contol experimental conditions median-dead-ages ; median of the ages of all the agents that have ever died during this run ; for the network display: x-max ; the size of the graphic area y-max diam ; the size factor for the displayed icon for a firm friction ; friction coeff. so icons do not move too fast spring-force ; force of spring tending to pull linked icons towards each other spring-length ; springs don't pull when link length is shorter than this mutual-repulsion ; counter-vailing force to springs ] breed [ firms ] breed [ networks ] breed [ edges ] firms-own [ capabilities ; the Firms kene part 1 abilities ; the Firms kene part 2 expertises ; the Firms kene part 3 ih ; the firm's innovation hypothesis ; (the locations of the ih kene triples ) capital ; the amount of capital of the firm product ; the product produced by this firm (a number) quality ; the quality of the product number-of-inputs ; the number of inputs required to produce product inputs ; the products required as inputs to make the product research-direction ; direction of changing an ability ; (for incremental research) ability-to-research ; the ability that is being changed by incremental ; research done-rad-research ; true if the firm has just done radical research last-reward ; the reward received by the firm last time advert ; a list of the capabilities of my innovation ; hypothesis previous-partners ; list of firms with which I have previously ; partnered partners ; list of my current partners suppliers ; list of suppliers customers ; list of customers selling? ; whether I have made any product to sell this round ; (I can make product only if all my inputs are ; available to me) buying? total-cost ; the total of the prices charged by suppliers for my inputs price ; the price I want to sell the product for sales ; the total amount received from selling in this round markup ; %-age difference between cost of my inputs and my selling price nCustomers ; number of customers who bought my product network ; the network I am a member of age ; steps since the firm was started network-firm ; is this a firm representing a network? Firm-ID ; individual Number for every firm in the modell at every time sell-buy-Vector ; Vector of all Firms the Firm ist interacting with this round ] networks-own [ firm ; the firm object that does this network's work members ; the firms that constitute this network ] edges-own [ a b kind ] to setup no-display set current-max-Firm-ID 0 ; resets the counter set activity "Initialising" set step 0 set stopnow false set initial-capital 2000 ; set nProducts 50 ; set with an interface slider ; set nFirms 100 ; set with an interface slider ; set nInputs 4 ; set with an interface slider set maxPrice 1000 ; set success-threshold 800 ; set with an interface slider ; set reward-to-trigger-start-up 950 ; set with an interface slider set max-ih-length 9 set nCapabilities 1000 ; set attractiveness-threshold 0.4 ; set with an interface slider set low-capital-threshold 1000 set capital-knowledge-ratio 50 set depreciation 100 set incr-research-tax 100 set radical-research-tax 100 set collaboration-tax 100 ; set delta 1.0 ; set with an interface slider ; set incr-step 0.011 ; must be a prime number ???? ; set with an interface slider set max-partners 5 set the-firms n-of 0 firms ; empty agentset set dead-ages []; set net-dead-ages []; setup-experiment ; only for Behaviour space ; in an open system, the 1st five products are 'raw materials' always ; available and always sold at a low price (raw-cost) and the last ; 5 products are always purchased by consumers with inexhaustible ; demand at a high price (final-price). set raw-cost 1 set final-price 100000 ifelse open-system [ set raw-materials 5 set end-products 5] [ set raw-materials 0 set end-products 0 ] set total-innovations 0 setup-layout initialise-firms ; create a population of firms ask firms [ setup-firm ] layout-firms display show-plots set activity "Initialised" set time timer end ; set up globals for the network diagram to setup-layout set diam 1.5 set x-max max-pxcor - (diam / 2) + 1 ; set y-max max-pycor - (diam / 2) + 1 set-default-shape firms "factory" set-default-shape edges "line" set friction 0.25 set spring-force 0.11 ; 0.2 set spring-length 10.0 ;2.0 set mutual-repulsion 8 ; 2.5 ask patches [set pcolor white] end ; make firms as empty shells, yet to filled with knowledge to initialise-firms create-custom-firms nFirms [ set capital initial-capital set Firm-ID current-max-Firm-ID ; the firm gets the first, never used, free Firm-ID set current-max-Firm-ID current-max-Firm-ID + 1 ; increment for the current-max-Firm-ID ] ; make some of them large firms, with extra initial capital ask n-of n-big-firms firms [ set capital 10 * capital set Firm-ID current-max-Firm-ID ; the firm gets the first, never used, free Firm-ID set current-max-Firm-ID current-max-Firm-ID + 1 ; increment for the current-max-Firm-ID ] ask firms [ initialise-firm ] end ; initialise all the firm's variables (except capital, previously set) to initialise-firm set ih [] set inputs [] set research-direction "random" set done-rad-research false set partners [] set previous-partners [] set suppliers [] set customers [] set selling? false set buying? true set markup 0 set network [] set network-firm false set age 0 set price (random maxPrice) + 1 ; price of my product is initially random set selling? true ; start by assuming that all suppliers are able to supply set capabilities [] ; create a null kene set abilities [] set expertises [] setxy random-float (x-max) * (2 * (random 2) - 1) ; spreading the firms randomly on the screen for the start random-float (y-max) * (2 * (random 2) - 1) set heading 0 set sell-buy-Vector [] end ; set up a single firm with all its required knowledge to setup-firm make-kene make-innovation-hypothesis make-advert manufacture ; not strictly necessary, but sets the initial product. end ; this is only used when running under the BehaviourSpace controller, to set up the types ; of learning the firms are capable of. when running ordinarily, exp-condition is 0. to setup-experiment if exp-condition = 1 [ ; only adjust expertise set Adj-expertise true set Adj-price false set Incr-research false set Rad-research false set Partnering false set Networking false ] if exp-condition = 2 [ ; adjust expertise and price set Adj-expertise true set Adj-price true set Incr-research false set Rad-research false set Partnering false set Networking false ] if exp-condition = 3 [ ; do incremental research set Adj-expertise true set Adj-price true set Incr-research true set Rad-research false set Partnering false set Networking false ] if exp-condition = 4 [ ; do incremental and radical research set Adj-expertise true set Adj-price true set Incr-research true set Rad-research true set Partnering false set Networking false ] if exp-condition = 5 [ ; do partnering but no individual research set Adj-expertise true set Adj-price true set Incr-research false set Rad-research false set Partnering true set Networking false ] if exp-condition = 6 [ ; incrmental, radical research and partnering set Adj-expertise true set Adj-price true set Incr-research true set Rad-research true set Partnering true set Networking false ] if exp-condition = 7 [ ; everything set Adj-expertise true set Adj-price true set Incr-research true set Rad-research true set Partnering true set Networking true ] if exp-condition > 0 [ type date-and-time +": " type " Adj-expertise=" + Adj-expertise type " Adj-price=" + Adj-price type " Incr-research=" + Incr-research type " Rad-research=" + Rad-research type " Partnering=" + Partnering print " Networking=" + Networking ] end to go if activity = 0 [ setup ] ; if the setup button hasn't been pressed, do it now if count firms = 0 [ stop ] ; stop if all firms have gone bankrupt if activity = "Initialising" [ stop ] ; if setup is still in progress, don't start if stopnow [ stop ] ; stop if the stopnow flag is set set activity "" ask firms [set sell-buy-Vector []] ask firms [ set partners [] set done-rad-research false ] layout-firms set activity "Doing research" if clock [ print "Time for updating plots: " + precision (timer - time) 3 set time timer ] ask firms [ without-interruption [ if partnership-strategy != "no partners" [ collaborate ] do-research manufacture pay-taxes set sales 0 set customers [] ] ] if clock [ print "Time for doing research: " + precision (timer - time) 3 set time timer ] set activity "Finding suppliers" find-suppliers if clock [ print "Time for finding suppliers: " + precision (timer - time) 3 set time timer ] set activity "Buying components" buy sell-to-end-users if clock [ print "Time for buying components: " + precision (timer - time) 3 set time timer ] set activity "Adjusting prices" ask firms [ take-profit adjust-price ] if clock [ print "Time for adjusting prices: " + precision (timer - time) 3 set time timer ] set activity "Creating networks and start-ups" create-start-ups create-networks if clock [ print "Time for creating networks and start-ups: " + precision (timer - time) 3 set time timer ] set activity "Updating plots" show-plots ask networks [ distribute-network-profits ] ask firms [ do-admin ] set step step + 1 end ; a kene is a set of triples of capability, ability and expertise. These are held as ; three arrays (vectors). The length of the kene is proportional ; to the capital of the firm. ;;; KNOWLEDGE LEVEL ;;; ;;; create kene, innovation hypothesis, advert etc. ;;; to make-kene ;; select some capabilities from the set 1..10 and the rest ;; from the remaining 11..1000. The proportion is given by the ;; in-sector-capabilities slider let cap-capacity max (list (ln ((capital / capital-knowledge-ratio) + 1) + 1) 5) while [length capabilities < cap-capacity * in-sector-capabilities / 100] [ set capabilities fput ((random 10) + 1) capabilities ] while [length capabilities < cap-capacity] [ set capabilities fput ((random (nCapabilities - 11)) + 11) capabilities ] set capabilities sort remove-duplicates capabilities while [ length abilities < length capabilities ] [ set abilities fput ((random-float 10.0) + 0.1) abilities set expertises fput ((random 10) + 1) expertises ] end ; an innovation hypothesis is a vector of locations in the kene. So, for example, an IH ; might be [1 3 4 7], meaning the second (counting from 0 as the first), fourth, fifth ; and eighth triple in the kene. The IH cannot be longer than the length of the kene, ; but is of random length. to make-innovation-hypothesis locals [ kene-length ih-length location] set ih [] set kene-length length capabilities set ih-length min (list ((random max-ih-length) + 2) kene-length) while [ ih-length > 0 ] [ set location random kene-length if not member? location ih [ set ih fput location ih set ih-length ih-length - 1 ] ] set ih sort ih ; reorders the elements of the innovation hypothesis in numeric ascending order ; number of inputs required for this IH is between 3 and nInputs, ; but not more than length of IH set number-of-inputs min list length ih max list 3 (random nInputs + 1) ; reset markup to random, since there will be a new product set markup random 100 set research-direction "random" end ; set up the firm's advert, which is the list of capabilities in its innovation ; hypothesis to make-advert set advert map [ item ? capabilities ] ih end ; a firm's product is computed from its innovation hypothesis, using the capabilities and ; abilities to make-product set product map-artefact ih end ; the quality of a firm's product is computed from the abilities and expertise in its ; innovation hypothesis: it is the sum (modulo 10) of the product of the abilities and ; (1 - e to the power of the corresponding expertise level) to make-quality set quality (reduce [?1 + ?2] (map [ (item ? abilities) * (1 - exp (0 - (item ? expertises))) ] ;; Why 0 - ???? ih)) mod 10 end ; the mapping from innovation hypothesis to product number ; the product is the sum (modulo the total number of products) of the product of the ; capabilities and the abilities in the innovation hypothesis ; NO LONGER the product number excludes those used to indicate raw materials or end-user products to-report map-artefact [ locations ] let product-range nProducts report ((reduce [?1 + ?2] (map [ (item ? capabilities) * (item ? abilities) ] locations)) * product-range mod product-range) end to-report map-input [ locations ] let product-range nProducts report ((reduce [?1 + ?2] (map [ (item ? capabilities) ] locations)) mod product-range) end ;to-report map-product [ locations ] ; let product-range nProducts ; report ; ((reduce [?1 + ?2] ; (map [ (item ? capabilities) ] locations)) ; mod product-range) ;end ; calculate what products a firm needs for its inputs. ; This is done by chopping the innovation hypothesis into sections, one for each input, and ; then mapping the section into a product using the standard mapping function to make-inputs locals [ width i finish inputLocations input] set inputs [] set width int (length ih / number-of-inputs) ; the width of each section of the IH set i 0 repeat number-of-inputs [ ; for each input, copy the section of the IH ; into inputLocations set finish i + width set inputLocations [] while [i < finish] [ set inputLocations fput item i ih inputLocations set i i + 1 ] ; and map from section to product number set input map-input inputLocations ;check that this does not duplicate an existing ; input, nor the product let dup? false foreach inputs [ if near-enough input ? [ set dup? true ] ] if near-enough input product [ set dup? true ] if not dup? [ set inputs lput input inputs ] ] set inputs sort inputs if (length inputs = 0) [ ; this could leave the firm producing with ; no inputs which would be a scam, so in this ; case require one 'impossible' input, one ; that is guaranteed that no firm will produce, ; so stopping the firm's production set inputs (list (nProducts + 1)) ] ; stop fims that have only raw-material ; inputs and make an end-user product - ; that's cheating! if product > nProducts - end-products [ let raw-inputs-only true foreach inputs [ if ? > raw-materials [ set raw-inputs-only false ] ] if raw-inputs-only [ set inputs (list (nProducts + 1)) ] ] ; show "Inputs " + inputs + "Product " + product end ; calculate the product that will be made, the inputs that will be required and ; the quality of the product. Adjust my expertise. ; Although these are recalculated each round, the product will not change unless ; the innovation hypothesis has changed. Nor will the inputs required. The ; quality will change if expertises have changed (and normally they will have). to manufacture make-product make-inputs make-quality adjust-expertise end ;;; MARKET LEVEL ;;; ;;; find suppliers for each input, put on market, try to sell product and collect money ;;; ;; a firm doesn't know whether its input can be supplied. Even if it finds a potential supplier, ;; that supplier may not be able to produce because it can't find a supplier for its inputs! ;; Hence, we first mark all firms as possible producers, and then eliminate those that ;; cannot actually produce, because no-one is offering the required inputs and so on ;; recursively, until there is no further change and all firms have been classified as either ;; potentially able to supply or definitely not (selling? is true or false respectively). ; What happens is that first any firm that only uses raw materials as its inputs is marked ; as 'selling'. Then in a second scan, any form that uses only raw materials or the products ; produced by firms that are selling are marked as selling. Then on a third scan, the same ; is done, and so on until no more firms are marked as selling. All remaining firms cannot ; produce because no firm produces one or more of their inputs. to find-suppliers ask firms [set selling? "possible" set nCustomers 0] let changed? true while [ changed? ] [ set changed? false ask firms with [selling? = "possible"] [ identify-suppliers if not (selling? = "possible") [set changed? true] ] ] end ;; check whether any firm is offering my required inputs. If not, I definitely cannot ;; produce and sell. ;; Then check whether there are any firms that are selling each input. If not, I can't sell. ;; then check whether there are firms definitely selling all my inputs. If so, I can sell. ;; Note that raw materials are always available. to identify-suppliers foreach inputs [ if ? >= raw-materials and not any? firms with [near-enough product ?] [ set selling? false stop] ] let ok 0 foreach inputs [ ifelse ? >= raw-materials [ if not any? firms with [(near-enough product ?) and not (selling? = false)] [set selling? false stop] if any? firms with [(near-enough product ?) and (selling? = true)] [set ok ok + 1 ] ] [ set ok ok + 1 ] ] if ok = length inputs [set selling? true stop] end ;; report true if the product, prod, is near enough in value to inp to be ;; acceptable for use as the input to-report near-enough [ prod inp ] report abs (prod - inp) < delta end ;; same story as find-suppliers, but in addition suppliers have to be selling to buy ask firms [ ifelse selling? = true [set buying? "possible" ] [set buying? false] ] let changed? true while [changed?] [ set changed? false ask firms with [buying? = "possible"] [ find-best-supplier if not (buying? = "possible") [ set changed? true ] ] ] ask firms with [ buying? = true ] [ purchase ] end ;; find the best supplier for each of my inputs. If there is more than one offering ;; the cheapest price, choose the one offering the product with the highest quality. ;; Sets the supliers variable with a list of supplier firms, and total-cost with the ;; sum of the prices of the inputs. If no suitable supplier can be found, or the ;; total-cost is greater than my proposed selling price, set buying? to false, meaning ;; that I won't be producing for the market to find-best-supplier set total-cost 0 set suppliers [] let ok 0 foreach inputs [ let supplier nobody ifelse ? >= raw-materials [ ;; if there are no firms selling this input that are or might be in production, I can't produce if not any? firms with [(near-enough product ?) and selling? = true and not (buying? = false)] [set buying? false stop] ;; if there are any firms that are definitely making the input, find the cheapest and use that one if any? firms with [(near-enough product ?) and buying? = true] [ set ok ok + 1 let possible-suppliers firms with [(near-enough product ?) and buying? = true ] set supplier min-one-of possible-suppliers [ price * abs (product - ?)] if supplier != nobody [ set total-cost total-cost + price-of supplier ] ] ] [ ; raw materials are always available set total-cost total-cost + raw-cost set ok ok + 1 set supplier "raw-material" ] set suppliers lput supplier suppliers ] if ok = length inputs [ ; all inputs are available ; use cost-plus pricing set buying? true set price (total-cost + random maxPrice ) * (1 + markup / 100) ; ifelse total-cost < price ; [set buying? true] ; [ ; set buying? false ; set suppliers [] ; set price price * 1.1 ; raise the price I expect for next time by 10% ; ] ; stop ] end ;; after all that, actually purchase the inputs from my selected suppliers, ;; reducing my available capital and incrmenting the number of customers and ;; and sales total of each of the suppliers to purchase disconnect-edges "supplier" foreach suppliers [ ifelse ? = "raw-material" [ set capital capital - raw-cost ;show "Buying raw material" ] [ set capital capital - price-of ? set capital-of ? capital-of ? + price-of ? set nCustomers-of ? nCustomers-of ? + 1 set customers-of ? fput self customers-of ? set sales-of ? sales-of ? + price-of ? ;show "Buying " + product-of ? + " from " + ? + " at price of " + price-of ? + " capital = " + capital connect-edge ? "supplier" ] ] end ; If the firm is producing a consumer product, and the price is right, ; sell it to the end user to sell-to-end-users set activity "Selling to end users" ask firms with [buying? = true and product > nProducts - end-products and price <= final-price] [ set capital capital + price set sales sales + price set nCustomers nCustomers + 1 ;show "Selling " + product + " to end-user at a price of " + price ] end ; calculate the profit I have made from selling my product to take-profit set last-reward 0 if nCustomers > 0 and price > total-cost [ set last-reward nCustomers * (price - total-cost) ] end ;;; COLLABORATION ;;; ;;; find partners to collaborate with and form partnerships ;;; ; find some partners to form partnerships with, if the current product is not being produced to collaborate if not Partnering [ stop ] ; if buying? != true [ if sales = 0 [ find-partners if length partners > 0 [ learn-from-partners ] pay-tax collaboration-tax * length partners ] end ; try up to max-partners (5) times to find partners to collaborate with, looking first at previous ; partners and then at suppliers, customers and finally others. For each partner ; found, tell the partner that I am now a partner and draw an edge on the network ; diagram to find-partners locals [ candidates ] disconnect-edges "partner" set candidates (sentence previous-partners suppliers customers) while [ length candidates < max-partners ] [ set candidates lput one-of firms candidates ] set candidates remove-duplicates candidates while [ length candidates > max-partners ] [ set candidates but-last candidates ] set partners filter [ compatible? ? ] candidates foreach partners [ set partners-of ? fput self partners-of ? connect-edge ? "partner" ] end ; reports true or false according to whether the possible partner is sufficiently attractive, ; according to the current partnership strategy to-report compatible? [ possible-partner ] locals [ attractiveness ] ; reject impossible potential partners if possible-partner = self or possible-partner = nobody or not is-agent? possible-partner [ report false ] ; a partner cannot already be a member of my network if is-agent? network and network != nobody and member? possible-partner members-of network [ report false ] ; a possible partner cannot already be a partner of mine if member? self partners-of possible-partner or member? possible-partner partners [report false] ifelse partnership-strategy = "conservative" [ set attractiveness (length intersection advert advert-of possible-partner) / (min list length advert length advert-of possible-partner) ] [ ifelse (length intersection advert advert-of possible-partner) >= 1 [ set attractiveness (length set-difference advert advert-of possible-partner) / (length advert + length advert-of possible-partner) ] [ set attractiveness 0 ] ] report attractiveness > attractiveness-threshold end ; reports the set intersection of the lists a and b, treated as sets to-report intersection [ set-a set-b ] locals [ set-c ] set set-c [] foreach set-a [ if member? ? set-b [ set set-c fput ? set-c ] ] report set-c end ; reports the set difference of lists a and b, treated as sets to-report set-difference [ set-a set-b ] locals [ set-c ] set set-c intersection set-a set-b set set-b remove-duplicates sentence set-a set-b foreach set-c [ if member? ? set-b [ set set-b remove ? set-b ] ] report set-b end ; obtain capabilities from partners. The capabilities that are learned are those ; from the partners' innovation hypothesis. to learn-from-partners foreach partners [ merge-capabilities ? ] make-innovation-hypothesis end to merge-capabilities [ other ] add-capabilities other ask other [ add-capabilities myself ] end ; for each capability in the other's innovation hypothesis, if it is new to me, ; add it (and its ability) to my kene (if I have sufficient capital), and make ; the expertise level 1 less. For each capability that is not new, if the other's ; expertise level is greater than mine, adopt his ability and expertise level, ; otherwise do nothing. to add-capabilities [ other ] locals [ capability my-position ] foreach ih-of other [ set capability item ? capabilities-of other ifelse member? capability capabilities ; capability already known to me [ set my-position position capability capabilities if item my-position expertises < item ? expertises-of other [ set expertises replace-item my-position expertises item ? expertises-of other set abilities replace-item my-position abilities item ? abilities-of other] ] ; capability is new to me; adopt if I have 'room' [ if (length capabilities) < ((capital / capital-knowledge-ratio) + 1) [ set capabilities sentence capabilities capability set abilities sentence abilities item ? abilities-of other let other-expertise (item ? expertises-of other) - 1 ; if other-expertise is 1, it is immediatley forgotten by adjust-expertise if other-expertise < 2 [set other-expertise 2 ] set expertises sentence expertises other-expertise ] ] ] end ;;; RESEARCH ;;; ;;; carry out incremental or radical research and adjust expertise and prices ;;; ; Successful firms don't do research, they just keep on with their previous product ; (unless their kene has changed through partnering). Unsuccessful ; firms normally do incremental research. However, if their capital has almost ; all gone, they do radical research instead. to do-research ; if buying? != true [ if last-reward < success-threshold [ ifelse capital <= low-capital-threshold [ do-radical-research ] [ do-incremental-research ] ] end ; adjust an ability up or down. If this is the second or subsequent time of doing incremental ; research, and the last reward was positive (although less than success-threshold, since if it ; were above that, the firm would continue to produce the last innovation, rather than do ; research), make a change to the same ability in the same direction. ; If the first time or the research proved unsuccessful (the firm made a loss and last-reward ; is 0), choose a capability from the innovation hypothesis at random and alter the ability ; in a random direction by one unit. ; research-direction is initially "random". It is set here to "down" or "up" to show ; direction of research. If an ability has been explored to the limit (reached 0 or 10), ; the direction is reset to random. to do-incremental-research locals [ new-ability ] if not Incr-research [ stop ] ; if last-reward <= 0 [ set research-direction "random" ] if research-direction = "random" [ set ability-to-research random length ih ifelse (random 2) = 1 [ set research-direction "up" ] [ set research-direction "down" ] ] set new-ability item ability-to-research abilities ifelse research-direction = "up" [ set new-ability new-ability + incr-step / item ability-to-research capabilities ] [ set new-ability new-ability - incr-step / item ability-to-research capabilities ] if new-ability <= 0 [ set new-ability 0 set research-direction "random"] if new-ability > 10 [ set new-ability 10 set research-direction "random"] ; show "ability " + ability-to-research + " changed from " + item ability-to-research abilities + ; " to " + new-ability set abilities replace-item ability-to-research abilities new-ability pay-tax incr-research-tax end ; radical research just means ; a. randomly changing one capability for a new value and then ; b. constructing a new innovation hypothesis from the kene to do-radical-research locals [ capability-to-mutate new-capability ] if not Rad-research [ stop ] set done-rad-research true set capability-to-mutate (random length capabilities) set new-capability (random nCapabilities) + 1; find a capability that is new to this firm while [ member? new-capability capabilities ] [set new-capability (random nCapabilities) + 1 ] set capabilities replace-item capability-to-mutate capabilities new-capability make-innovation-hypothesis make-advert pay-tax radical-research-tax end ; raise the expertise level by one (up to a maximum of 10) for capabilities that ; are used in the innovation, and decrease by one for capabilities that are not. ; If an expertise level has dropped to zero, the capability is forgotten. to adjust-expertise locals [ location expertise ] if not Adj-expertise [ stop ] set location 0 while [ location < length capabilities ] [ set expertise item location expertises ifelse member? location ih [ if expertise < 10 [ set expertises replace-item location expertises (expertise + 1) ] ] [ ifelse expertise > 0 [ set expertises replace-item location expertises (expertise - 1) ] [ forget-capability location set location location - 1] ] set location location + 1 ] end ; remove the capability, ability, expertise at the given location of the kene. ; Warning; all hell will break loose if the capability that is being forgotten is included ; in the innovation hypothesis (but no test is done to check this). ; Although the keen is changed, the innovation hypothesis and the product are not (since ; the forgotten capability is not in the ih, this doesn't matter) to forget-capability [location ] set capabilities remove-item location capabilities set abilities remove-item location abilities set expertises remove-item location expertises adjust-ih location end ; reduce the values (which are indices into the kene) in the innovation hypothesis to ; account for the removal of a capability. Reduce all indices above 'location' by one to adjust-ih [ location ] locals [ i elem ] set i 0 while [ i < length ih ] [ set elem item i ih if elem > location [ set ih replace-item i ih (elem - 1 ) ] set i i + 1 ] end ; Adjust the price of my product to respond to market conditions: ; If in the last round I sold a product, increase the price by 10% for every customer ; If there were no buyers, reduce the price by 10% ; If I did not manage to make a product, because one or more inputs were missing, do nothing to adjust-price if not Adj-price [ stop ] if buying? = true [ let oldmarkup markup ifelse nCustomers > 0 [ set markup markup + 1 ] [ set markup markup - 1 ] ; show "ncustomers = " + nCustomers + ": Adjusting markup from " + oldmarkup + " to " + markup ] end ;;; CREATE NETWORKS ;;; ; if the firm's last innovation was successful and they are not already a member of ; a network and they have some partners that are not already members of a network ; and they have enough capital, initiate the ; formation of a network and add myself and my partners as the initial members to create-networks if not Networking [ stop ] ask firms with [ last-reward > success-threshold and capital > initial-capital and not is-agent? network ] [ without-interruption [ set previous-partners remove nobody previous-partners if length previous-partners > 0 and length filter [ not is-agent? network-of ? ] previous-partners > 0 [ create-network ] ] ] end ; create a network agent founded on myself as the first member and add my partners as members. ; a network consist of a network agent with an associated network firm. The latter does all ; the work of innovation and production for the network. Collect the start-up capital for the ; new firm from the partners, in proportion to the partners' wealth to create-network locals [ the-network ] if is-agent? network [ stop ] without-interruption [ set the-network make-network add-myself-and-partners the-network ; show "my network = " + network + " the-network= " + the-network + "firm= " + firm-of the-network + " Members=" + members-of the-network let partners-wealth reduce [ ?1 + ?2 ] map [ capital-of ?1 ] members-of the-network foreach members-of the-network [ set capital capital - (initial-capital * capital / partners-wealth) ] ask firm-of the-network [ make-innovation-hypothesis make-advert manufacture ] ] end ; make an 'empty' network (a new network object and a new firm object) to-report make-network locals [ founder net ] set founder self hatch 1 [ ; create a network agent set breed networks hideturtle set members [] hatch 1 [ ; create a firm for the network set breed firms set firm-of myself self ; tell network about its firm set capital initial-capital initialise-firm set network-firm true set network myself ; tell network firm about its network copy-ih-capabilities founder ; the network's firm starts with a ; copy of the capabilities from the ; founder's ih set Firm-ID current-max-Firm-ID ; the firm gets the first, never used, free Firm-ID set current-max-Firm-ID current-max-Firm-ID + 1 ; increment for the current-max-Firm-ID showturtle ] set net self ] report net end ; copy the kene triples corresponding to the innovation hypothesis ; from the source to this firm to copy-ih-capabilities [ source ] locals [ pos ] foreach ih-of source [ set capabilities fput item ? capabilities-of source capabilities set abilities fput item ? abilities-of source abilities set expertises fput item ? expertises-of source expertises ] end ; if I have enough capital and am not already a member, add myself to the network, and ; then add all my partners to the network (and so on recursively) to add-myself-and-partners [ the-network ] if not is-agent? network and not member? self members-of the-network and capital > initial-capital / (1 + length members-of the-network) [ connect-edge firm-of the-network "network" set members-of the-network fput self members-of the-network set network-of self the-network merge-capabilities firm-of the-network foreach previous-partners [ if ? != nobody [ ask ? [add-myself-and-partners the-network ] ] ] ] end ;;; ADMINISTRATION ;;; ;;; ; no comment needed! to pay-taxes pay-tax depreciation ; annual depreciation end ; the money paid just disappears. Later it may be transferred to end-users, to keep it ; in circulation to pay-tax [ amount ] set capital capital - amount end ; If the network has been successful, distribute all the profits of the network ; above the initial capital equally to all the network members ; Alternatively if the network has gone bankrupt, dissolve the network to distribute-network-profits if length members > 0 and capital-of firm > initial-capital [ let amount-to-distribute (capital-of firm - initial-capital) / length members foreach members [ set capital-of ? capital-of ? + amount-to-distribute ; show "distributing " + amount-to-distribute + " to " + who-of ? ] set capital-of firm initial-capital ] if capital-of firm < 0 [ dissolve-network ] end ; unhook each member from the network and kill both the network agent and the associated ; firm agent to dissolve-network foreach members [ set network-of ? [] ask ? [ disconnect-edges "network" ] ] set net-dead-ages fput age-of firm net-dead-ages ask firm [ die ] die end ; some final tidying up at the end of every round to do-admin ; dissolve this round's partnerships, but remember the partners for the future set previous-partners remove-duplicates sentence previous-partners partners set age age + 1 ;show "Last reward: " + last-reward ;show "inputs: " + inputs ;show "Product: " + product if member? self the-firms [ set total-age-of-the-firms total-age-of-the-firms + 1 if last-reward > success-threshold [ set successes-of-the-firms successes-of-the-firms + 1 ] ] ; die if bankrupt if capital < 0 [ exit ] end ; remove myself from the simulation, making sure that I am no longer a member of any network etc. to exit set dead-ages fput age dead-ages ; remove the firm from its network (if any). If the network has zero or one ; members, also kill the network if is-agent? network and network != nobody [ set members-of network remove self members-of network if length members-of network <= 1 or network-firm [ ask network [ dissolve-network ] ] ] die end ; start-ups are clones of the most successful firm, modified in two ways: ; they get only the standard starting capital ; they get their kene trimmed to the length appropriate to their capital ; create 1, or if the most successful firm was very successful, more to create-start-ups if count firms = 0 [ stop ] if not Start-ups [ stop ] let biggest-reward last-reward-of max-one-of firms [ last-reward ] if biggest-reward > reward-to-trigger-start-up [ repeat log biggest-reward 10 [ make-start-up ] ] end ; clone the firm with the largest reward to make-start-up create-custom-firms 1 [ set capital initial-capital set Firm-ID current-max-Firm-ID ; the firm gets the first, never used, free Firm-ID set current-max-Firm-ID current-max-Firm-ID + 1 ; increment for the current-max-Firm-ID initialise-firm clone-kene max-one-of firms with [ self != myself ] [ last-reward ] make-innovation-hypothesis make-advert manufacture ] end ; cloning a kene involves copying the triples in its innovation hypothesis, ; but chopping it to a length suitable for the capital of the firm receiving it to clone-kene [ firm-to-clone ] locals [ ih-pos triple-pos ] set ih-pos 0 repeat min list (length ih-of firm-to-clone) (ln ((capital / capital-knowledge-ratio) + 1) + 1) [ set triple-pos item ih-pos ih-of firm-to-clone set capabilities fput (item triple-pos capabilities-of firm-to-clone) capabilities set abilities fput (item triple-pos abilities-of firm-to-clone) abilities set expertises fput (item triple-pos expertises-of firm-to-clone) expertises set ih-pos ih-pos + 1 ] end ; display some plots to show-plots locals [ sum-capital turnovers avg count-of-firms ] set count-of-firms count firms if count-of-firms <= 2 [stop] layout-firms set-current-plot "Concentration" set-current-plot-pen "Herfindahl" set sum-capital sum values-from firms [ capital ] if sum-capital > 0 [ set herfindahl sum values-from firms [ (capital / sum-capital ) ^ 2 ]] plot 100 * herfindahl ; set-current-plot-pen "Avg Turnover" ; set turnovers values-from firms with [ sales > 0 ] [ sales ] ; if sum turnovers > 0 ; [ plotxy step 100 * mean turnovers / max turnovers ] set-current-plot "Capital" if count firms with [ capital > 0 ] > 0 [ set-current-plot-pen "Average" set avg mean values-from firms with [ capital > 0 ] [ log capital 10 ] plot avg ; set-current-plot-pen "+1 St Dev" ; plot avg + standard-deviation values-from firms with [ capital > 0 ] [ log capital 10 ] ; set-current-plot-pen "-1 St Dev" ; plot avg - standard-deviation values-from firms with [ capital > 0 ] [ log capital 10 ] ] set-current-plot "Collaboration" set-current-plot-pen "In partnership" plot 100 * sum values-from firms [ in-partnership ] / count-of-firms set-current-plot-pen "In network" plot 100 * count firms with [ is-agent? network ] / count-of-firms set-current-plot-pen "Connectedness" plot 100 * ((sum values-from firms [ length partners ] / 2) + (perm sum values-from networks [ length members ]) ) / ( perm count-of-firms) if any? networks [ plot-degree-distribution ] set-current-plot "Population" set-current-plot-pen "Firms" plot count-of-firms set-current-plot-pen "Networks" plot count networks set-current-plot "Dynamics" set-current-plot-pen "Successes" let successes count firms with [ last-reward > success-threshold ] set total-innovations total-innovations + successes plot successes set-current-plot-pen "Start-ups" plot count firms with [ age = 0 and step != 0 and not network-firm] set-current-plot-pen "Net Successes" plot count firms with [ network-firm and last-reward > success-threshold ] set-current-plot "Transactions" set-current-plot-pen "Firms selling" plot 100 * count firms with [ selling? = true ] / count-of-firms set-current-plot-pen "Firms buying" plot 100 * sum values-from firms [ nCustomers ] / sum values-from firms [ length inputs ] set-current-plot "Sales" if count firms with [sales > 0] > 0 [ set-current-plot-pen "Sales" plot median values-from firms with [sales > 0 ] [ sales ] ] if count firms with [last-reward > 0] > 0 [ set-current-plot-pen "Profit" plot median values-from firms with [last-reward > 0 ] [ last-reward ] ] if count firms with [network-firm and last-reward > 0] > 0 [ set-current-plot-pen "net profits" plot median values-from firms with [network-firm and last-reward > 0] [ last-reward ] ] set-current-plot "Networks" if count networks > 0 [ set-plot-x-range 1 max list 20 1 + max values-from networks [length members] histogram-from networks [ length members ] ] set-current-plot "Partners" histogram-from firms [length partners] set-current-plot "Age distribution" set-current-plot-pen "Age" let max-age max values-from firms [ age ] if max-age > 0 [ histogram-from firms [age ]] set-current-plot "Median age at death" ; this strange way is to provide a global for the BehaviourSpace ifelse length dead-ages > 0 [ set median-dead-ages median dead-ages ] [set median-dead-ages 0 ] set-current-plot-pen "All" plot median-dead-ages set-current-plot-pen "Net firms" if length net-dead-ages > 0 [ plot median net-dead-ages ] set-current-plot "Size distribution" set-current-plot-pen "Size" let max-cap max values-from firms [ capital ] if max-cap > 0 [ histogram-from firms [100 * capital / max-cap ] ] set-current-plot-pen "net firms" histogram-from firms with [network-firm] [100 * capital / max-cap ] set-current-plot "Rate of radical research" set-current-plot-pen "Rad-research" plot count firms with [ done-rad-research ] set-current-plot-pen "Rad-research successes" plot count firms with [ done-rad-research and last-reward > success-threshold ] set-current-plot "Products" set-current-plot-pen "Outputs" histogram-from firms [ product] set-current-plot-pen "Inputs" histogram-list reduce [sentence ?1 ?2] values-from firms [ inputs ] set-current-plot-pen "net products" histogram-from firms with [network-firm] [ product] if count firms with [network-firm] > 0 [ set-current-plot-pen "net inputs" histogram-list reduce [sentence ?1 ?2] values-from firms with [network-firm] [ inputs ] ] set-current-plot-pen "Purchases" histogram-from firms with [buying? = true ] [ product ] end ; report whether or not I am in a partnership to-report in-partnership ifelse length partners > 0 [ report 1 ] [ report 0 ] end to-report perm [ num ] report num * (num - 1 ) / 2 end ; ; plot log(number of members) by log(frequency of networks with that number of members) ; at the present moment of time, plus a regression line ; to plot-degree-distribution set-current-plot "Network size" clear-plot ;; erase what we plotted before set-plot-pen-color black set-plot-pen-mode 2 ;; plot points let max-degree max values-from networks [length members] ; let links sentence values-from firms [length partners] values-from networks [length members] ; let max-degree max links let degree 1 ; only include nodes with at least one link let sumx 0 ;; for regression line let sumy 0 let sumxy 0 let sumxx 0 let sumyy 0 let n 0 while [degree <= max-degree] [ let matches networks with [length members = degree] if any? matches ; let matches filter [? = degree ] links ; if not empty? matches [ let x log degree 10 let y log (count matches) 10 ; let y log (length matches) 10 plotxy x y set sumx sumx + x set sumy sumy + y set sumxy sumxy + x * y set sumxx sumxx + x * x set sumyy sumyy + y * y set n n + 1 ] set degree degree + 1 ] if n > 1 [ let slope (n * sumxy - sumx * sumy) / (n * sumxx - sumx * sumx) let intercept (sumy - slope * sumx) / n create-temporary-plot-pen "regression line" set-plot-pen-mode 0 set-plot-pen-color red plot-pen-up plotxy 0 intercept plot-pen-down ifelse slope = 0 [ plotxy intercept intercept ;; regression line is parallel to x-axis ] [ plotxy -1 * intercept / slope 0 ] set-current-plot "Degree distn corr. coeff" let divisor (n * sumyy - sumy * sumy) * (n * sumxx - sumx * sumx) let r2 0 if abs(divisor) > 0.00000001 [ let numerator (n * sumxy - sumx * sumy) set r2 numerator * numerator / divisor ] plot r2 set-current-plot "gamma" set gamma -1 * slope plot gamma ] end ; set the colour and size of the displayed icon according to whether it is the ; firm of a network, ; a firm set up at the beginning of the run, or a start-up. Adjust the icon size ; to show the firm's capital to set-size-and-color ifelse product < raw-materials [ set color brown ] [ ifelse product > nProducts - end-products [ set color blue ] [ set color green ] ] ifelse network-firm [ set color color - 3 ] [ if age < 10 and step > 10 [ set color color + 3 ] ] if capital > 0 [ set size (log capital 10) * diam ] set heading 0 end ; arrange the icons on the display in a way that brings linked firms closer together to layout-firms locals [ d ] if not view [ stop ] without-interruption [ no-display ask edges with [ kind = "supplier" ] [ set hidden? not showSales ] ask edges with [ kind = "partner" ] [ set hidden? not showPartners ] ask edges with [ kind = "networks" ] [ set hidden? not showNetworks ] ask edges [ if a = nobody or b = nobody [ die ] set d (spring-force * (size - spring-length)) / 2.0 if kind != "network" [ set d d - 2.0 ] ask a [set heading towards-nowrap b-of myself jump-nowrap d] ask b [set heading towards-nowrap a-of myself jump-nowrap d] ] ask firms [ ask firms with [self != myself] [ set d distance-nowrap myself if d > 0 [ set d mutual-repulsion / (d * d) ] set heading towards-nowrap myself jump-nowrap (- d) ] ] ask edges [ adjust-edge ] ask firms [ set-size-and-color ] display ] end to arrange locals [ t ] display if mouse-down? [ set t closest-xy mouse-xcor mouse-ycor firms ; while [mouse-down?] [ ask t [setxy mouse-xcor mouse-ycor] no-display ask edges with [a = t or b = t][adjust-edge] display ] ] layout-firms end ; create a turtle that will show as a line on the network diagram connecting two firms to connect-edge [ other-node knd ] if not view [ stop ] hatch 1 [ set breed edges set a myself set b other-node set kind knd ifelse knd = "network" [ set color lime set hidden? not showNetworks ] [ ifelse knd = "partner" [ set color magenta set hidden? not showPartners ] [ set color sky set hidden? not showSales ] ] adjust-edge ] end ; kill off all the lines betwen myself and any other agent, of the given kind to disconnect-edges [ knd ] ask edges with [ a = myself or b = myself and kind = knd ] [ die ] end ; move the line so that once again it links the two end nodes (firms) to adjust-edge setxy xcor-of a ycor-of a set size distance-nowrap b set heading towards-nowrap b jump size / 2 end ; report the sign of the number to-report sign [ num ] ifelse num < 0 [ report -1 ] [ report 1 ] end ; report the closest agent to the point x,y to-report closest-xy [x y agent-set] report min-one-of agent-set [distancexy-nowrap x y] end ; jump a distance 'dist' along the current heading, but don't wrap around the ; display edges to jump-nowrap [dist] locals [x y] set x xcor + dist * dx set y ycor + dist * dy if (abs x) > x-max [set x sign x * (x-max - (1 - friction) * ((abs x) - x-max))] if (abs y) > y-max [set y sign y * (y-max - (1 - friction) * ((abs y) - y-max))] setxy x y end ; end of file @#$#@#$#@ GRAPHICS-WINDOW 244 10 612 399 89 89 2.0 1 10 1 1 1 0 1 1 1 -89 89 -89 89 CC-WINDOW 5 1927 949 2022 Command Center 0 BUTTON 10 15 73 48 setup setup NIL 1 T OBSERVER T NIL PLOT 635 10 939 160 Population Time N 0.0 100.0 0.0 100.0 true true PENS "Firms" 1.0 0 -16777216 true "Networks" 1.0 0 -10899396 true PLOT 675 558 937 708 Concentration Time Index * 100 0.0 100.0 0.0 1.0 true false PENS "Herfindahl" 1.0 0 -14835848 true PLOT 635 317 938 467 Collaboration Time % 0.0 100.0 0.0 100.0 true true PENS "In partnership" 1.0 0 -5825686 true "In network" 1.0 0 -10899396 true "Connectedness" 1.0 0 -13840069 true BUTTON 11 53 74 86 NIL go T 1 T OBSERVER NIL NIL CHOOSER 8 262 181 307 partnership-strategy partnership-strategy "no partners" "conservative" "progressive" 1 MONITOR 8 92 186 141 Activity activity 3 1 PLOT 635 164 937 314 Transactions Time % 0.0 100.0 0.0 100.0 true true PENS "Firms selling" 1.0 0 -7500403 true "Firms buying" 1.0 0 -6459832 true SLIDER 9 224 181 257 nInputs nInputs 3 6 6 1 1 NIL SLIDER 9 185 181 218 nProducts nProducts 0 100 100 1 1 NIL SWITCH 8 311 181 344 open-system open-system 0 1 -1000 PLOT 250 557 461 708 Dynamics Time N 0.0 100.0 0.0 5.0 true true PENS "Successes" 1.0 0 -13791810 true "Start-ups" 1.0 0 -2674135 true "Net successes" 1.0 0 -955883 true SLIDER 9 347 181 380 n-big-firms n-big-firms 0 150 0 1 1 NIL PLOT 468 557 668 708 Networks Size Count 0.0 10.0 0.0 5.0 false false PENS "default" 1.0 1 -10899396 true SLIDER 9 145 181 178 nFirms nFirms 0 1000 500 1 1 NIL MONITOR 79 21 136 70 NIL step 0 1 SLIDER 9 385 181 418 attractiveness-threshold attractiveness-threshold 0 1 0.3 0.1 1 NIL TEXTBOX 253 402 613 429 Brown factory: raw material Green factory: firm Blue factory: end-user\nBlue line: supplier-customer Red line: partnership Green line: network PLOT 9 557 241 707 Capital Time log 10 Capital 0.0 100.0 0.0 10.0 true true PENS "Average" 1.0 0 -2674135 false SWITCH 276 432 382 465 showSales showSales 0 1 -1000 SWITCH 382 432 505 465 showPartners showPartners 0 1 -1000 SWITCH 505 432 632 465 showNetworks showNetworks 0 1 -1000 PLOT 9 712 240 894 Network size Log (k) Log (degree distribution) 0.0 2.0 0.0 2.0 true false PLOT 251 714 460 893 Degree distn corr. coeff Time R2 0.0 10.0 0.0 1.0 true false PLOT 469 714 669 894 gamma Time Gamma (slope of deg. distn) 0.0 10.0 0.0 1.0 true false PLOT 676 716 903 894 Partners Number Frequency 0.0 10.0 0.0 10.0 true false PLOT 10 903 240 1075 Age distribution Age N 0.0 100.0 0.0 10.0 false true PENS "Age" 1.0 1 -10899396 true PLOT 467 902 670 1074 Products NIL NIL 0.0 100.0 0.0 100.0 false true PENS "Inputs" 5.0 1 -11221820 true "Outputs" 1.0 1 -10899396 true "net inputs" 1.0 1 -955883 true "net products" 1.0 1 -6459832 true "Purchases" 1.0 1 -1184463 true PLOT 253 905 460 1075 Size distribution NIL NIL 0.0 100.0 0.0 50.0 false true PENS "size" 1.0 1 -13791810 true "net firms" 1.0 1 -955883 true PLOT 677 902 902 1072 Rate of radical research NIL NIL 0.0 10.0 0.0 10.0 true false PENS "rad-research" 1.0 0 -16777216 true "rad-research successes" 1.0 0 -2674135 true SWITCH 185 432 275 465 view view 0 1 -1000 SWITCH 2 508 144 541 Adj-expertise Adj-expertise 0 1 -1000 SWITCH 149 508 265 541 Adj-price Adj-price 0 1 -1000 SWITCH 270 508 412 541 Incr-research Incr-research 0 1 -1000 SWITCH 417 507 558 540 Rad-research Rad-research 0 1 -1000 SWITCH 564 507 685 540 Partnering Partnering 0 1 -1000 SWITCH 691 506 818 539 Networking Networking 0 1 -1000 PLOT 10 1078 238 1228 Median age at death Time Age 0.0 10.0 0.0 10.0 true true PENS "All" 1.0 0 -16777216 true "Net firms" 1.0 0 -955883 true SWITCH 140 56 230 89 clock clock 1 1 -1000 PLOT 251 1078 451 1228 Sales Time Value 0.0 10.0 0.0 10.0 true true PENS "Sales" 1.0 0 -13345367 true "Profit" 1.0 0 -2064490 true "net profits" 1.0 0 -955883 true CHOOSER 140 10 232 55 exp-condition exp-condition 0 1 2 3 4 5 6 7 0 SWITCH 824 506 940 539 Start-ups Start-ups 0 1 -1000 SLIDER 8 424 179 457 In-sector-capabilities In-sector-capabilities 0 100 50 1 1 % SLIDER 9 469 178 502 success-threshold success-threshold 0 1000 800 1 1 NIL SLIDER 186 470 389 503 reward-to-trigger-start-up reward-to-trigger-start-up 0 2000 1250 1 1 NIL SLIDER 397 469 569 502 incr-step incr-step 0 10 1.783 0.0010 1 NIL SLIDER 575 469 747 502 delta delta 0 10 2.0 0.1 1 NIL TEXTBOX 372 1895 522 1913 test @#$#@#$#@ 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. @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 link true 0 Line -7500403 true 150 0 150 300 link direction true 0 Line -7500403 true 150 150 30 225 Line -7500403 true 150 150 270 225 ant true 0 Polygon -7500403 true true 136 61 129 46 144 30 119 45 124 60 114 82 97 37 132 10 93 36 111 84 127 105 172 105 189 84 208 35 171 11 202 35 204 37 186 82 177 60 180 44 159 32 170 44 165 60 Polygon -7500403 true true 150 95 135 103 139 117 125 149 137 180 135 196 150 204 166 195 161 180 174 150 158 116 164 102 Polygon -7500403 true true 149 186 128 197 114 232 134 270 149 282 166 270 185 232 171 195 149 186 Polygon -7500403 true true 225 66 230 107 159 122 161 127 234 111 236 106 Polygon -7500403 true true 78 58 99 116 139 123 137 128 95 119 Polygon -7500403 true true 48 103 90 147 129 147 130 151 86 151 Polygon -7500403 true true 65 224 92 171 134 160 135 164 95 175 Polygon -7500403 true true 235 222 210 170 163 162 161 166 208 174 Polygon -7500403 true true 249 107 211 147 168 147 168 150 213 150 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 bee true 0 Polygon -1184463 true false 151 152 137 77 105 67 89 67 66 74 48 85 36 100 24 116 14 134 0 151 15 167 22 182 40 206 58 220 82 226 105 226 134 222 Polygon -16777216 true false 151 150 149 128 149 114 155 98 178 80 197 80 217 81 233 95 242 117 246 141 247 151 245 177 234 195 218 207 206 211 184 211 161 204 151 189 148 171 Polygon -7500403 true true 246 151 241 119 240 96 250 81 261 78 275 87 282 103 277 115 287 121 299 150 286 180 277 189 283 197 281 210 270 222 256 222 243 212 242 192 Polygon -16777216 true false 115 70 129 74 128 223 114 224 Polygon -16777216 true false 89 67 74 71 74 224 89 225 89 67 Polygon -16777216 true false 43 91 31 106 31 195 45 211 Line -1 false 200 144 213 70 Line -1 false 213 70 213 45 Line -1 false 214 45 203 26 Line -1 false 204 26 185 22 Line -1 false 185 22 170 25 Line -1 false 169 26 159 37 Line -1 false 159 37 156 55 Line -1 false 157 55 199 143 Line -1 false 200 141 162 227 Line -1 false 162 227 163 241 Line -1 false 163 241 171 249 Line -1 false 171 249 190 254 Line -1 false 192 253 203 248 Line -1 false 205 249 218 235 Line -1 false 218 235 200 144 bird1 false 0 Polygon -7500403 true true 2 6 2 39 270 298 297 298 299 271 187 160 279 75 276 22 100 67 31 0 bird2 false 0 Polygon -7500403 true true 2 4 33 4 298 270 298 298 272 298 155 184 117 289 61 295 61 105 0 43 boat1 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6459832 true false 150 32 157 162 Polygon -13345367 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7500403 true true 158 33 230 157 182 150 169 151 157 156 Polygon -7500403 true true 149 55 88 143 103 139 111 136 117 139 126 145 130 147 139 147 146 146 149 55 boat2 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6459832 true false 150 32 157 162 Polygon -13345367 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7500403 true true 157 54 175 79 174 96 185 102 178 112 194 124 196 131 190 139 192 146 211 151 216 154 157 154 Polygon -7500403 true true 150 74 146 91 139 99 143 114 141 123 137 126 131 129 132 139 142 136 126 142 119 147 148 147 boat3 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6459832 true false 150 32 157 162 Polygon -13345367 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7500403 true true 158 37 172 45 188 59 202 79 217 109 220 130 218 147 204 156 158 156 161 142 170 123 170 102 169 88 165 62 Polygon -7500403 true true 149 66 142 78 139 96 141 111 146 139 148 147 110 147 113 131 118 106 126 71 box true 0 Polygon -7500403 true true 45 255 255 255 255 45 45 45 butterfly1 true 0 Polygon -16777216 true false 151 76 138 91 138 284 150 296 162 286 162 91 Polygon -7500403 true true 164 106 184 79 205 61 236 48 259 53 279 86 287 119 289 158 278 177 256 182 164 181 Polygon -7500403 true true 136 110 119 82 110 71 85 61 59 48 36 56 17 88 6 115 2 147 15 178 134 178 Polygon -7500403 true true 46 181 28 227 50 255 77 273 112 283 135 274 135 180 Polygon -7500403 true true 165 185 254 184 272 224 255 251 236 267 191 283 164 276 Line -7500403 true 167 47 159 82 Line -7500403 true 136 47 145 81 Circle -7500403 true true 165 45 8 Circle -7500403 true true 134 45 6 Circle -7500403 true true 133 44 7 Circle -7500403 true true 133 43 8 circle false 0 Circle -7500403 true true 35 35 230 directed line true 0 Line -7500403 true 150 0 150 300 Circle -7500403 true true 135 16 31 factory true 0 Polygon -7500403 true true 1 152 2 296 299 296 299 3 264 3 265 91 152 2 2 119 line true 0 Line -7500403 true 150 0 150 300 person false 0 Circle -7500403 true true 155 20 63 Rectangle -7500403 true true 158 79 217 164 Polygon -7500403 true true 158 81 110 129 131 143 158 109 165 110 Polygon -7500403 true true 216 83 267 123 248 143 215 107 Polygon -7500403 true true 167 163 145 234 183 234 183 163 Polygon -7500403 true true 195 163 195 233 227 233 206 159 sheep false 15 Rectangle -1 true true 90 75 270 225 Circle -1 true true 15 75 150 Rectangle -16777216 true false 81 225 134 286 Rectangle -16777216 true false 180 225 238 285 Circle -16777216 true false 1 88 92 spacecraft true 0 Polygon -7500403 true true 150 0 180 135 255 255 225 240 150 180 75 240 45 255 120 135 thin-arrow true 0 Polygon -7500403 true true 150 0 0 150 120 150 120 293 180 293 180 150 300 150 truck-down false 0 Polygon -7500403 true true 225 30 225 270 120 270 105 210 60 180 45 30 105 60 105 30 Polygon -8630108 true false 195 75 195 120 240 120 240 75 Polygon -8630108 true false 195 225 195 180 240 180 240 225 truck-left false 0 Polygon -7500403 true true 120 135 225 135 225 210 75 210 75 165 105 165 Polygon -8630108 true false 90 210 105 225 120 210 Polygon -8630108 true false 180 210 195 225 210 210 truck-right false 0 Polygon -7500403 true true 180 135 75 135 75 210 225 210 225 165 195 165 Polygon -8630108 true false 210 210 195 225 180 210 Polygon -8630108 true false 120 210 105 225 90 210 turtle true 0 Polygon -7500403 true true 138 75 162 75 165 105 225 105 225 142 195 135 195 187 225 195 225 225 195 217 195 202 105 202 105 217 75 225 75 195 105 187 105 135 75 142 75 105 135 105 wolf false 0 Rectangle -7500403 true true 15 105 105 165 Rectangle -7500403 true true 45 90 105 105 Polygon -7500403 true true 60 90 83 44 104 90 Polygon -16777216 true false 67 90 82 59 97 89 Rectangle -1 true false 48 93 59 105 Rectangle -16777216 true false 51 96 55 101 Rectangle -16777216 true false 0 121 15 135 Rectangle -16777216 true false 15 136 60 151 Polygon -1 true false 15 136 23 149 31 136 Polygon -1 true false 30 151 37 136 43 151 Rectangle -7500403 true true 105 120 263 195 Rectangle -7500403 true true 108 195 259 201 Rectangle -7500403 true true 114 201 252 210 Rectangle -7500403 true true 120 210 243 214 Rectangle -7500403 true true 115 114 255 120 Rectangle -7500403 true true 128 108 248 114 Rectangle -7500403 true true 150 105 225 108 Rectangle -7500403 true true 132 214 155 270 Rectangle -7500403 true true 110 260 132 270 Rectangle -7500403 true true 210 214 232 270 Rectangle -7500403 true true 189 260 210 270 Line -7500403 true 263 127 281 155 Line -7500403 true 281 155 281 192 wolf-left false 3 Polygon -6459832 true true 117 97 91 74 66 74 60 85 36 85 38 92 44 97 62 97 81 117 84 134 92 147 109 152 136 144 174 144 174 103 143 103 134 97 Polygon -6459832 true true 87 80 79 55 76 79 Polygon -6459832 true true 81 75 70 58 73 82 Polygon -6459832 true true 99 131 76 152 76 163 96 182 104 182 109 173 102 167 99 173 87 159 104 140 Polygon -6459832 true true 107 138 107 186 98 190 99 196 112 196 115 190 Polygon -6459832 true true 116 140 114 189 105 137 Rectangle -6459832 true true 109 150 114 192 Rectangle -6459832 true true 111 143 116 191 Polygon -6459832 true true 168 106 184 98 205 98 218 115 218 137 186 164 196 176 195 194 178 195 178 183 188 183 169 164 173 144 Polygon -6459832 true true 207 140 200 163 206 175 207 192 193 189 192 177 198 176 185 150 Polygon -6459832 true true 214 134 203 168 192 148 Polygon -6459832 true true 204 151 203 176 193 148 Polygon -6459832 true true 207 103 221 98 236 101 243 115 243 128 256 142 239 143 233 133 225 115 214 114 wolf-right false 3 Polygon -6459832 true true 170 127 200 93 231 93 237 103 262 103 261 113 253 119 231 119 215 143 213 160 208 173 189 187 169 190 154 190 126 180 106 171 72 171 73 126 122 126 144 123 159 123 Polygon -6459832 true true 201 99 214 69 215 99 Polygon -6459832 true true 207 98 223 71 220 101 Polygon -6459832 true true 184 172 189 234 203 238 203 246 187 247 180 239 171 180 Polygon -6459832 true true 197 174 204 220 218 224 219 234 201 232 195 225 179 179 Polygon -6459832 true true 78 167 95 187 95 208 79 220 92 234 98 235 100 249 81 246 76 241 61 212 65 195 52 170 45 150 44 128 55 121 69 121 81 135 Polygon -6459832 true true 48 143 58 141 Polygon -6459832 true true 46 136 68 137 Polygon -6459832 true true 45 129 35 142 37 159 53 192 47 210 62 238 80 237 Line -16777216 false 74 237 59 213 Line -16777216 false 59 213 59 212 Line -16777216 false 58 211 67 192 Polygon -6459832 true true 38 138 66 149 Polygon -6459832 true true 46 128 33 120 21 118 11 123 3 138 5 160 13 178 9 192 0 199 20 196 25 179 24 161 25 148 45 140 Polygon -6459832 true true 67 122 96 126 63 144 @#$#@#$#@ NetLogo 3.1.4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setup go date-and-time step total-innovations gamma count firms sum values-from firms [ in-partnership ] count firms with [is-agent? network ] count networks herfindahl setup go date-and-time step total-innovations gamma count firms sum values-from firms [ in-partnership ] count firms with [is-agent? network ] count networks herfindahl setup go date-and-time learning-level total-age-of-the-firms setup go date-and-time learning-level total-age-of-the-firms successes-of-the-firms setup go count firms > 2000 count firms sum values-from firms [capital] sum values-from firms [in-partnership] count firms with [is-agent? network] count networks count firms with [last-reward > success-threshold] count firms with [age = 0 and not network-firm ] count firms with [selling? = true] sum values-from firms [nCustomers] count firms with [done-rad-research] setup go count firms > 2000 Adj-expertise Adj-price Incr-research Rad-research Partnering Networking count firms sum values-from firms [capital] sum values-from firms [in-partnership] count firms with [is-agent? network] count networks count firms with [last-reward > success-threshold] count firms with [age <= 1 and not network-firm ] count firms with [selling? = true] sum values-from firms [nCustomers] count firms with [done-rad-research] median-dead-ages date-and-time setup go Adj-expertise Adj-price Incr-research Rad-research Partnering Networking count firms sum values-from firms [capital] sum values-from firms [in-partnership] count firms with [is-agent? network] count networks count firms with [last-reward > success-threshold] count firms with [age <= 1 and not network-firm ] count firms with [selling? = true] sum values-from firms [nCustomers] count firms with [done-rad-research] median-dead-ages date-and-time setup go Adj-expertise Adj-price Incr-research Rad-research Partnering Networking count firms sum values-from firms [capital] sum values-from firms [in-partnership] count firms with [is-agent? network] count networks count firms with [last-reward > success-threshold] count firms with [age <= 1 and not network-firm ] count firms with [selling? = true] sum values-from firms [nCustomers] count firms with [done-rad-research] median-dead-ages date-and-time setup go count firms > 2000 Adj-expertise Adj-price Incr-research Rad-research Partnering Networking count firms sum values-from firms [capital] sum values-from firms [in-partnership] count firms with [is-agent? network] count networks count firms with [last-reward > success-threshold] count firms with [age <= 1 and not network-firm ] count firms with [selling? = true] sum values-from firms [nCustomers] count firms with [done-rad-research] median-dead-ages date-and-time setup go count firms > 2000 count firms sum values-from firms [capital] sum values-from firms [in-partnership] count firms with [is-agent? network] count networks count firms with [last-reward > success-threshold] count firms with [age <= 1 and not network-firm ] count firms with [selling? = true] sum values-from firms [nCustomers] count firms with [done-rad-research] median-dead-ages date-and-time @#$#@#$#@