VolatilityBankFailures

No preview image

1 collaborator

Default-person Jean van Haperen (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.5 • Viewed 132 times • Downloaded 11 times • Run 0 times
Download the 'VolatilityBankFailures' 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 [FIS FI]

patches-own
[
  returns         ;; this is the quantity we will be diffusing
  crash?
]

Turtles-own
[
  visible 
  default?
 
]


globals
[
  initiationx
  initiationy
]

to setup
  clear-all
  set-default-shape FIS "person"
  
  create-FIS NumberOfFIS ; make this an interface thing
  [
    set size 1.5
    setxy random-xcor random-ycor
    move-to patch-here
    ]
  
  ask patches [ set returns random-float 100
    set crash? false ]
  recolor-patches
  reset-ticks
  
  ask FIS
  
  [create-links-with FIS with [self != myself and
                                    random-float 1.0 < linkageProbability]]
end 

to go
  ifelse ticks < 200[
  recolor-patches
  ask patches
  [set crash? false]
  
  set initiationy random (max-pycor - min-pycor) + min-pycor - SizeOfCrash
    set initiationx random (max-pxcor - min-pycor) + min-pycor - SizeOfCrash
  ask patches [
    
    if pycor > initiationy and pycor < initiationy + SizeOfCrash and pxcor > initiationx and pxcor < initiationx + SizeOfCrash
    [set crash? true] ]
  
    ask patches
    [if crash? = true [set pcolor yellow]]
    
  
  if mouse-down?
  [ask patch mouse-xcor mouse-ycor [show returns]]
  

  ask FIS 
 

  [  
    set default? false  
   
   move-to patch-here
   let c max-one-of neighbors with [not any? turtles-here] [returns]  ;; or neighbors4
  if [returns] of c > [returns] of patch-here 
     [face c
     move-to c]
     
  let p max-one-of patch-set [neighbors with [not any? turtles-here]] of link-neighbors [returns]  ;; or neighbors4
  if p != nobody and [returns] of p > [returns] of patch-here AND not any? other turtles-on p 
     [face p 
     move-to p]
     
]
  
  ask FIS
  [if crash? = true [set default? true]]
  ]
  [stop]
  tick
end 


;patches procedure

to recolor-patches
  ask patches
    [ set pcolor scale-color red (returns) 100 0]
end 

to marketcrash
end 

There is only one version of this model, created about 10 years ago by Jean van Haperen.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.