La presentazione è in caricamento. Aspetta per favore

La presentazione è in caricamento. Aspetta per favore

13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 1 _Strumenti, seguito _______________________________________ Simulazione.

Presentazioni simili


Presentazione sul tema: "13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 1 _Strumenti, seguito _______________________________________ Simulazione."— Transcript della presentazione:

1 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 1 _Strumenti, seguito _______________________________________ Simulazione in NetLogo ospedali.nlogo in linea a http://web.econ.unito.it/terna/materiale/master_ec_pol_san/ anche in line funzionante a http://web.econ.unito.it/terna/mastersan _______________________________________

2 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 2 problema da trattare Il problema della mobilità dei pazienti oncologici Persone che si spostano per ragioni sanitarie indizio di insoddisfazione? correlazione con ragioni di studio e lavoro esigenze di altri familiari indicazione del medico informazioni tra pazienti differenze tra strutture (es. mancanza della radioterapia) età (più mobilità nei giovani) costi sociali costi vivi Più opzioni di cura chi sceglie? chi ha le informazioni? il medico? il paziente? Strutture adeguato numero di interventi attività di ricerca bassa mortalità Soglia minima per gli ospedali al di sotto aumenta la mortalità collegamenti tra ospedali (rinvii a unità più specializzate) Comportamento di un paziente ben informato “ben informato” da un medico “perfettamente informato” o … gradi diversi di informazione Problemi di riferimento: El Farol; scelto locali nelle formiche e comportamenti aggregati

3 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 3 ospedali.nlogo

4 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 4 ospedali.nlogo Testo del programma a seguire WHAT IS IT? ----------- Simulazione di pazienti che si spostano di ospedale in ospedale. L'ospedale normale è bianco. Se un ospedale ha pochi pazienti e quindi rappresenta un punto critico, è segnalato in rosso; se decresce, è segnalato in blu; se diventa troppo grande, in verde. Se il paziente non è a suo agio, cambia ospedale, spostandosi a caso nell'ospdeale che si trova a sinistra o a destra; resta in situazione di disagio se incontra un ospedale non bianco. I pazienti in condizione di disagio sono indicati in rosso. HOW TO USE IT ------------- Provare a modificare una per volta le probabilità di cambiamento di situazione (agio/disagio) del paziente: cambiamento a caso; cambiamento se in ospedale rosso, blu o verde. Provare combinazioni diverse di tutte le probabilità. Osservare il formarsi di zone di ospedali in crisi.

5 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 5 ;; gli agenti scelgono un gruppo; lo lasciano se sono uneasy turtles-own [uneasy?] patches-own [people people-previous-value decreasing? huge?] globals [critical-groups decreasing-groups huge-groups moves number-uneasy group-sites] ;------------------------------------------------------ to setup ca ; 'with' takes two inputs: on the left, an agentset (usually "turtles" or "patches"). ; on the right, a boolean reporter. set group-sites patches with [group-site?] set-default-shape turtles "person" ; 'cct' create-custom-turtles cct number [ set uneasy? false set color white ifelse (random 2 = 0) [set heading 90] [set heading 270] ;; randomly face right or left set ycor 0 set xcor random world-width] ; These reporters give the total width and height of the NetLogo world. ; Screen-size is the same as ((2 * screen-edge) + 1)

6 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 6 ask turtles [move-into-groups] setup-patches update-critical-or-decreasing-or-huge-groups update-uneasiness setup-plots set moves 0 update-labels spread-people update-plots end ;------------------------------------------------------

7 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 7 ;------------------------------------------------------ to go if (number-uneasy = number) [ show "Catastrophe!" stop ;; stop the simulation if everyone is uneasy ] group-people ;; put all people on the x-axis move-if-uneasy update-critical-or-decreasing-or-huge-groups update-labels update-uneasiness spread-people ;; move the people into vertical columns set moves (moves + 1) update-plots if limit-speed? [ wait 0.75 ] ;; keep the spread groups on the screen for a bit end ;------------------------------------------------------

8 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 8 ;------------------------------------------------------ to setup-patches ask patches [ set people-previous-value 0 set people 0 set decreasing? false set huge? false] ask turtles [set people (people + 1)] end ;------------------------------------------------------ to update-labels ask group-sites [ set plabel count turtles-here ] ; plabel is a patch label ; turtles-here reports an agentset containing all ; the turtles on the caller's patch (including the caller ; itself if it's a turtle). ; count agentset reports the number of agents in the given agentset end ;------------------------------------------------------

9 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 9 ;------------------------------------------------------ to update-uneasiness ask turtles [ if plabel-color = white [set uneasy? false set color white] ; clear mood if (100 * p-of-random-mood-change) > random 100 [set uneasy? true set color red] if (100 * p-of-mood-change-if-critical) > random 100 and plabel-color = red [set uneasy? true set color red] if (100 * p-of-mood-change-if-decreasing) > random 100 and plabel-color = blue [set uneasy? true set color red] if (100 * p-of-mood-change-if-huge) > random 100 and plabel-color = green [set uneasy? true set color red] ] set number-uneasy count turtles with [uneasy?] ;; update number-uneasy variable end ;------------------------------------------------------

10 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 10 ;------------------------------------------------------ to move-if-uneasy ask turtles [ if (uneasy?)[ ifelse (random 2 = 0) [set heading 90] [set heading 270] ;; randomly face right or left set people (people - 1) ;;decrease the count in your old group fd 1 ;; move out of your group move-into-groups set people (people + 1)] ;;increase the count in your new group ] end ;------------------------------------------------------ to move-into-groups ;;turtle procedure ; move forward until you hit the closest group if not group-site? [ fd 1 if limit-speed? [ wait 0.1 ] ;; slow it down so user can see it happening move-into-groups] end ;------------------------------------------------------

11 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 11 ;------------------------------------------------------ to-report group-site? ;; turtle or patch procedure ;; if your pycor is 0 and your pxcor is where a group should be located, ;; then you're a group site (patch) or on a group site (turtle) locals [group-interval] ;; first figure out how many patches apart the groups will be set group-interval floor (world-width / num-groups) report ;; first check pycor (pycor = 0) and ;; then check if the distance between groups divides evenly into ;; our distance from the right hand edge of the screen (((max-pxcor - pxcor) mod group-interval) = 0) and ;; finally, make sure we don't wind up with more groups than ;; the user asked for (floor ((max-pxcor - pxcor) / group-interval) < num-groups) end ;------------------------------------------------------

12 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 12 ;------------------------------------------------------ to update-critical-or-decreasing-or-huge-groups ask group-sites [ set plabel-color white ifelse people < people-previous-value [set decreasing? true] [set decreasing? false] set people-previous-value people if decreasing? [set plabel-color blue] if people < number / (1.3 * (count group-sites)) [set plabel-color red] if people > number / (0.5 * (count group-sites)) [set plabel-color green] ] set critical-groups (count group-sites with [plabel-color = red]) set decreasing-groups (count group-sites with [plabel-color = blue]) ;NB a decreasing group can be accounted also as critical set huge-groups (count group-sites with [plabel-color = green]);NB a huge group can be accounted also as decreasing end ;------------------------------------------------------

13 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 13 ;------------------------------------------------------ to setup-plots set-current-plot "Uneasy People" set-plot-y-range 0 number set-current-plot "Critical or Decreasing or Huge Groups" set-plot-y-range 0 num-groups end ;------------------------------------------------------ to update-plots set-current-plot "Uneasy People" set-current-plot-pen "Uneasy" plot (count turtles with [uneasy?]) set-current-plot "Critical or Decreasing or Huge Groups" set-current-plot-pen "Critical-groups" plot critical-groups set-current-plot-pen "Decreasing-groups" plot decreasing-groups set-current-plot-pen "Huge-groups" plot huge-groups end ;------------------------------------------------------

14 13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 14 ;------------------------------------------------------ ;; spread people out vertically to spread-people ask turtles [set heading 0 fd 4 jump count other-turtles-here ] ;; this trick works because of the serial ordering of turtle execution ; 'jump': turtles move forward by number units all at once, without the ; amount of time passing depending on the distance. end ;------------------------------------------------------ ;------------------------------------------------------ ;; pile people up on the x-axis to group-people ask turtles [set ycor 0] end ;------------------------------------------------------


Scaricare ppt "13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 1 _Strumenti, seguito _______________________________________ Simulazione."

Presentazioni simili


Annunci Google