LLNL
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
globals [n data cumulative_hazard] turtles-own [h_i lambda eta theta xi1 xi2 xi3 xi4 xi5 xi6 xi7 c1 c2 c3 c4 c5 c6 c7]; x's are covariates between the ith component and the jth component links-own [] to setup ca ask patches [ set pcolor white ] load-data setup-nodes ask turtles [ assign-component-data create-network ] reset-ticks end to go tick ask turtles [update-hazards] if ticks = 5000 [stop] end to load-data ifelse ( file-exists? "data.txt" ) [ set data [] file-open "data.txt" set n 0 while [ not file-at-end? ] [ set data sentence data (list (list file-read file-read file-read file-read file-read file-read file-read file-read file-read file-read file-read file-read file-read n ) ) set n n + 1 ] user-message "File read. Please wait. A message will let you know when the data are loaded." ; done reading - close file-close ] [ user-message "File not found" ] show n end to setup-nodes crt n layout-circle sort turtles n ask turtles [ set label-color black if who = 0 [set label "electrical"] if who = 1 [set label "HVAC"] if who = 2 [set label "Fire"] if who = 3 [set label "Plumbing"] if who = 4 [set label "Roof"] set shape "dot" set color [255 0 0 125] ] end to assign-component-data ifelse ( is-list? data ) [ foreach data [ ask turtles with [ who = last ? ] [ set lambda first ? set eta item 1 ? set theta item 2 ? set xi1 item 3 ? set xi2 item 4 ? set xi3 item 5 ? set xi4 item 6 ? set xi5 item 7 ? set c1 item 8 ? set c2 item 9 ? set c3 item 10 ? set c4 item 11 ? set c5 item 12 ? ] ] ] [user-message "You need to load in data first" ] end to create-network if c1 != 0 [ create-links-to other turtles with [c1 = 1] ] if c2 != 0 [ create-links-to other turtles with [c2 = 2]] if c3 != 0 [ create-links-to other turtles with [c3 = 3]] if c4 != 0 [ create-links-to other turtles with [c4 = 4]] if c5 != 0 [ create-links-to other turtles with [c5 = 5]] if c6 != 0 [ create-links-to other turtles with [c6 = 6]] if c7 != 0 [ create-links-to other turtles with [c7 = 7]] ask links [set color blue - 2 + random 7] end to update-hazards set h_i lambda * exp ( - lambda * eta ) * ticks ^ (lambda - 1) set size h_i end
There is only one version of this model, created over 12 years ago by Michelle Saksena.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
data.txt | data | data file | over 12 years ago, by Michelle Saksena | Download |
This model does not have any ancestors.
This model does not have any descendants.