Booktrade

Booktrade preview image

1 collaborator

Default-person Michael Gavin (Author)

Tags

book history 

Tagged by Michael Gavin over 10 years ago

digital humanities 

Tagged by Michael Gavin over 10 years ago

history 

Tagged by Michael Gavin over 10 years ago

humanities 

Tagged by Michael Gavin over 10 years ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.3 • Viewed 859 times • Downloaded 71 times • Run 0 times
Download the 'Booktrade' modelDownload this modelEmbed this model

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

breed [readers reader]
breed [booksellers bookseller]
breed [manuscripts manuscript]

readers-own [
  book-list
  number-of-books
  money
  curiosity
  my-seller
  ]

booksellers-own [
  my-manuscripts
  min-title-diversity
  preferred-print-run
  price-target
  career-span
  capital
  ]



manuscripts-own [
  my-publisher
  title
  editions
  appeal
  price
  depreciation-rate
  book-age-threshold
  earnings
  expenses
  copies-on-the-shelf
  shelf-time
  viable
  failed-solicitations
  ]

to setup
  ca
 
  ; Booksellers publish and distribute manuscripts. They have a capital of money, and if they slip
  ; into too much debt, they go bankrupt and die.
  set-default-shape booksellers "house"
  create-booksellers initial-booksellers [ 
    set color brown
    set size 3
    set career-span 0
    set min-title-diversity 0
    set preferred-print-run 200 - random 190
    set price-target 0.5 + random-gamma 1 2
    set my-manuscripts nobody
    set capital initial-capital
    setxy random-xcor random-ycor
    ]
   
  ; Readers' behavior is controlled by several variables: color, closed-mindedness, and money. All readers will
  ; seek out books of their own color. If they are curious (that is, not incurious) they will also
  ; look for books of different color. They gain money every tick and use money to buy books.
  set-default-shape readers "circle"
  create-readers number-of-readers [
    set color 55 + random-float 4
    set money 0.5 + random-gamma 1 2
    set book-list []
    set size 1.5
    set curiosity random 100
    set my-seller one-of booksellers
    setxy random-xcor random-ycor
  ]
  
  ; Manuscripts are owned by booksellers. They are "published" by hatching
  ; a number of books that share their variables.
  set-default-shape manuscripts "star"

  reset-ticks
end 

; Go activates readers and booksellers.

to go
  tick
  ask readers [ determine-behavior ]
  ask booksellers [manage-inventory check-accounts]
  if not any? booksellers [ stop ]
  if mean [capital] of booksellers > initial-capital * 2 or mean [career-span] of booksellers > 500 [ create-booksellers 1 [
    set color brown
    set size 3
    set career-span 0
    set preferred-print-run 200 - random 190
    set price-target 0.5 + random-gamma 1 2
    set my-manuscripts nobody
    set capital initial-capital
    setxy random-xcor random-ycor ] 
  ]
end 

to determine-behavior
  set curiosity curiosity + 1
  if my-seller = nobody [ set my-seller one-of booksellers ]
  ifelse curiosity > curiosity-threshold 
    [ buy-books ]
    [ move ]
end 

; Readers move about randomly and carry their books with them.

to move                
  rt random 50
  lt random 50
  fd 0.5
end 
   
; Reader look for books to buy. The decision to purchase a book is based on
; a simple randomization of the books' appeal. 

to buy-books
  if my-seller != nobody [ face my-seller ]
  fd 1
  
  if count booksellers in-radius seller-radius > 0 [
  let temp-list [book-list] of self
  let books-to-buy manuscripts in-radius seller-radius with [ ; creates agentset of nearby books   
    copies-on-the-shelf > 0 and                        ; must be owned by bookseller
    not member? title temp-list and
    (appeal + random-float 1 - random-float 1) >= price and  ; appeal (randomly adjusted) must be higher than price
    price <= [money] of myself                               ; reader must have enough money
    ]
  
  let chosen-book one-of books-to-buy                         ; reader chooses one of the eligible books
  ifelse chosen-book != nobody [
    let chosen-seller [my-publisher] of chosen-book
    set book-list fput [title] of chosen-book book-list
    set number-of-books length book-list
    set curiosity 0
    ask chosen-seller [                             
      set capital capital + [price] of chosen-book ]           ; booksellers account is increased
    ask chosen-book [ 
      set earnings earnings + price 
      set copies-on-the-shelf copies-on-the-shelf - 1 ]  
  ] 
  [ 
    set my-seller one-of booksellers 
    ]
  ]
end 

; Booksellers check their inventory.

to manage-inventory
  set capital capital - overhead
  set career-span career-span + 1
  set min-title-diversity abs capital / 100
  set my-manuscripts manuscripts with [my-publisher = myself]
  ask my-manuscripts [update-mss]
  
  if count my-manuscripts with [viable = true] <= min-title-diversity [ acquire-copy ]
  
  if count my-manuscripts with [copies-on-the-shelf > 0] < min-title-diversity [ print-mss ]
end 
  
; When sitting on the shelf, books lose appeal over time.

to update-mss
  set appeal appeal - depreciation-rate
  if earnings >= expenses [ 
    set viable true 
    set shelf-time 0 
    ]
  if expenses > earnings [
    set viable false
    set shelf-time shelf-time + 1 
    ]
  if shelf-time > book-age-threshold [ 
    ask my-publisher [ set capital capital + ([price] of myself * pulp-rate) ]
    die
    ]
  if failed-solicitations > 5 [ die ]
  if appeal < 0 [ die ]
end 

; Bookseller creates a new title.

to acquire-copy
    hatch-manuscripts 1 [
    set size 1
    set color 25 + random-float 4
    set title random-float 100 ; The title create an identifier that can be inherited by copies
    set viable true
    set appeal 1.5 - random-float 1 
    set my-publisher myself
    set price [price-target] of myself - random-float .5
    set depreciation-rate 0.01 - random-float .009
    set book-age-threshold 700 - random 600
    ]
end 

  
; Manuscripts "hatch" copies of themselves as books. When manuscripts hatch books
; those books retain the original's title, appeal, and price.

to print-mss
  let chosen-manuscript one-of my-manuscripts with [ viable = true ]
  if chosen-manuscript != nobody [
  set capital capital - (fixed-cost + ([price] of chosen-manuscript * (preferred-print-run * per-unit-cost)))
  ask chosen-manuscript 
    [
      set expenses expenses + (fixed-cost + ([price] of chosen-manuscript * ([preferred-print-run] of myself * per-unit-cost)))
      set copies-on-the-shelf copies-on-the-shelf + [preferred-print-run] of myself
      ]
  ]
end 

; Booksellers check to see if they have gone bankrupt.

to check-accounts
  if capital < -200 [ 
    ask my-manuscripts [ die ]
    die 
    ]
end 

There are 2 versions of this model.

Uploaded by When Description Download
Michael Gavin over 10 years ago documentation edited Download this version
Michael Gavin over 10 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Booktrade.png preview Preview for 'Booktrade' over 10 years ago, by Michael Gavin Download

This model does not have any ancestors.

This model does not have any descendants.