Lodging Choice Model
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This model simulates the influence of racial homophily in sharing economy accommodations (like AirBnB). In this simulation, we can see how how guests' racial homophily (guests' preference for same-race hosts and guests' preference for same-race reviewers who previously stayed) influence their choices of hosts.
Racial groups and their icon colors: White = Blue; Black = Grey; Asian = Orange.
HOW IT WORKS
First, we can set the proportion of hosts (house icon) by race on the market.
Second, the guests (person icon) enter in the market by probability (can be adjusted during the model run). The probabilities of guests of different races entering the market sum up to 1. We only need to adjust the first two probabilities and the third one will be displayed automatically.
Third, the guests' choices of hosts are based on 1) guest-host homopihily and 2) guest-reviewer homophily.
1) Guest-host homopihilies are displayed under "Guest-host homophily proportion (sum=1)". "w" = "Whhite", "b" = "Black", and "a" = "Asian". The first "w/b/a" means the racial groups for guests, while the second "w/b/a" means the racial groups for hosts. The last digit means this it the first type of homophily preference. Thus, "w-w-1" means "White guests' preference for White hosts".
For the guest-host homopihily, we can set how a guest of a specific race will choose a host based on their racial groups. For instance, the default setting is that the probability of guests' choosing same-race hosts is double (0.5) as the probability of choosing different-race hosts (0.25).
2) Guest-reviewer homophily variables are displayed under "Guest-reviewer homophily proportion (sum=1)". Similarly, "w" = "Whhite", "b" = "Black", and "a" = "Asian". The first "w/b/a" means the racial groups for guests, while the second "w/b/a" means the racial groups for hosts. The last digit means this it the second type of homophily preference. Thus, "w-w-2" means "White guests' preference for the ratio of previous White reviewers".
For the guest-reviewer homophily, we can set how a guest of a racial group will be influenced by the ratio of previous reviewers from a specific racial group. Our assumption is that the more a guest sees a place being stayed by people from their own racial groups, the more likely they are going to choose this place (host). In other words this type of homophily is the extent to which White/Black/Asian guests prefer to stay with hosts that have already been stayed by other White/Black/Asian guests. In our default setting, the extent is double for same-race reviewers as different-race reviewers.
Both types of homophily preferences can be adjusted while the model is running.
The three plots from the top to the bottom are: the average number of guests by hosts' racial groups; the Lorenz Curve in terms of the distribution of the number of guests; the Gini-index in terms of the distribution of the number of guests. All of the three plots will change over ticks/time.
HOW TO USE IT
Before running the model, we need to set up the number of hosts by race on the market. This should be done BEFORE running the model and cannot be adjusted when the model is running. By default, we set the number of White, Black, Asian hosts as 25, 25, 25.
Next, we can adjust the proportion of guests of a specific racial group that enter into the market. By default, we set proportion of White:Black:Asian guests as 0.5: 0.25: 0.25
Then, we can adjust the 1) guest-host homopihily and 2) guest-reviewer homophily. By default, we set guests' preference for same-race hosts and reviewers double as their preference for different-race hosts and reviewers.
After the above settings, we can choose to "go once" for trial run or "go forever" to see the simulation over ticks.
THINGS TO NOTICE
It is important to know that we should make sure the proportions in each category add up to 1. In most cases, Netlogo will automatically make this adjustment, but in some cases, it will not and needs to be refreshed by moving the sliders.
THINGS TO TRY
We can tweak the model with different combinations of four groups of variables: host number/distribution, guest distribution, guest-host homopihily and guest-reviewer homophily. Again, host number/distribution cannot be adjusted during the model run but others can.
To what extent the population distribution by race lead to uneuqal performance of hosts. Specifically, how will the hosts from the majority group benefit solely by this population distribution?
We can make the two types of homophilies become racial biases by setting guests' preference for a specific group to a very small value (e.g., 0.8:0.19:0.01). We thus can explore the influence of racial discrimination on the performance (number of guests received) of hosts over time.
EXTENDING THE MODEL
We can extend this model by adding other variables that influence people's homophily preferences such as room types and prices. However, here we solely want to focus on the choices people would make based on racial homophily, assuming other things being equal.
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 [ guest-count host-count choice gini-index-reserve lorenz-points base-ratio aff-homo ] ;extensions [ import-a ] ;extensions [ rnd ] breed [hosts host] breed [guests guest] breed [trees tree] hosts-own [ h-race w-ratio b-ratio a-ratio w-cnt ;;expected number of white on the front page b-cnt ;;expected number of black on the front page a-cnt ;;expected number of asian on the front page num-guest ] guests-own [ g-race cate ] to setup clear-all ask patches [set pcolor green - random-float 0.5] ;ask patches [set pcolor 56 ] ;import-drawing "map.jpg" set-default-shape guests "person" set-default-shape hosts "house" set host-count (white-hosts + black-hosts + asian-hosts) ;;set guest-count (white-hosts + black-hosts + asian-hosts) ;;add number of hosts according to the input create-hosts white-hosts [ set size 2 set h-race "White" set color 105 ;; white = 105 set xcor -20 + random 40 set ycor -20 + random 50 ] create-hosts black-hosts [ set size 2 set h-race "Black" set color 3 ;; grey = 3 set xcor -20 + random 40 set ycor -20 + random 50 ] create-hosts asian-hosts [ set size 2 set h-race "Asian" set color 25 ;; yellow = 45 set xcor -20 + random 40 set ycor -20 + random 50 ] ;;set hosts apart for visual purpose ask hosts [move-to one-of patches with [not any? other hosts in-radius 2]] update-lorenz-and-gini reset-ticks end to go ;; update the front page reviewer counts for all hosts based on the guest race ask hosts [ if count link-neighbors > 0 [ set w-ratio count (link-neighbors with [g-race = "White"])/ count link-neighbors set b-ratio count (link-neighbors with [g-race = "Black"])/ count link-neighbors set a-ratio count (link-neighbors with [g-race = "Asian"])/ count link-neighbors if count link-neighbors > front-page [ set w-cnt w-ratio * front-page ;count (link-neighbors with [g-race = "White"]) set b-cnt b-ratio * front-page ;count (link-neighbors with [g-race = "Black"]) set a-cnt a-ratio * front-page ;count (link-neighbors with [g-race = "Asian"]) ] if count link-neighbors <= front-page [ set w-cnt count (link-neighbors with [g-race = "White"]) set b-cnt count (link-neighbors with [g-race = "Black"]) set a-cnt count (link-neighbors with [g-race = "Asian"]) ] ] if count link-neighbors = 0 [ set w-ratio 0 set b-ratio 0 set a-ratio 0 set w-cnt 0 set b-cnt 0 set a-cnt 0 ] set num-guest count (link-neighbors) ] ask links [ set color gray ] set guest-count (guest-count + 1) create-guest make-decision find-partner update-lorenz-and-gini tick end ;; used for creating a new guest to create-guest create-guests 1 [ ;set new? true let a-g-prob 1 - w-g-prob - b-g-prob let probs ( list (w-g-prob) (b-g-prob) (a-g-prob) ) set g-race (random-pick-guest-race probs) if g-race = "White" [set color 105 set cate 1] if g-race = "Black" [set color 3 set cate 2] if g-race = "Asian" [set color 25 set cate 3] ] end to make-decision [listing] ask (max-one-of guests [who]) [ if listing != nobody [ create-link-with listing [ set color grey ] ;; position the new node near its partner move-to listing fd 3 + (random 6) ] ] end to-report find-partner let temp-race ([g-race] of (max-one-of guests [who])) ;; update the attractiveness of hosts based on the guest race --> attractiveness is a list of probabilities ifelse gr_homo? [ ;;########################### ;;########################### ;;if switch is ON, pick host based on the coefficient and intercept let w-pref reduce sentence (map [[a] -> [w-cnt] of hosts with [who = a]] (range 0 (host-count))) let b-pref reduce sentence (map [[a] -> [b-cnt] of hosts with [who = a]] (range 0 (host-count))) let a-pref reduce sentence (map [[a] -> [a-cnt] of hosts with [who = a]] (range 0 (host-count))) if temp-race = "White" [ let coef (sentence (n-values white-hosts [w-w-coef]) (n-values black-hosts [w-b-coef]) (n-values asian-hosts [w-a-coef])) let ic (sentence (n-values white-hosts [w-w-ic]) (n-values black-hosts [w-b-ic]) (n-values asian-hosts [w-a-ic])) let att (map [[a b c] -> (a * b + c) ] coef w-pref ic) set choice (random-pick-host att) ;set choice first rnd:weighted-one-of-list (map list host-order att) last report host choice ] if temp-race = "Black" [ let coef (sentence (n-values white-hosts [b-w-coef]) (n-values black-hosts [b-b-coef]) (n-values asian-hosts [b-a-coef])) let ic (sentence (n-values white-hosts [b-w-ic]) (n-values black-hosts [b-b-ic]) (n-values asian-hosts [b-a-ic])) let att (map [[a b c] -> (a * b + c) ] coef b-pref ic) set choice (random-pick-host att) ;set choice first rnd:weighted-one-of-list (map list host-order att) last report host choice ] if temp-race = "Asian" [ let coef (sentence (n-values white-hosts [a-w-coef]) (n-values black-hosts [a-b-coef]) (n-values asian-hosts [a-a-coef])) let ic (sentence (n-values white-hosts [a-w-ic]) (n-values black-hosts [a-b-ic]) (n-values asian-hosts [a-a-ic])) let att (map [[a b c] -> (a * b + c) ] coef a-pref ic) set choice (random-pick-host att) ;set choice first rnd:weighted-one-of-list (map list host-order att) last report host choice ] ] [ ;;########################### ;;########################### ;;if switch is off, pick host without considering guest-reviewer homophily let w-a-1 1 - w-w-1 - w-b-1 let b-a-1 1 - b-w-1 - b-b-1 let a-w-1 1 - a-a-1 - a-b-1 if temp-race = "White" [ let gh-pref (sentence (n-values white-hosts [w-w-1]) (n-values black-hosts [w-b-1]) (n-values asian-hosts [w-a-1])) set gh-pref (map [[a] -> a * 1] gh-pref ) set choice (random-pick-host gh-pref) report host choice ] if temp-race = "Black" [ let gh-pref (sentence (n-values white-hosts [b-w-1]) (n-values black-hosts [b-b-1]) (n-values asian-hosts [b-a-1])) set gh-pref (map [[a] -> a * 1] gh-pref ) set choice (random-pick-host gh-pref) report host choice ] if temp-race = "Asian" [ let gh-pref (sentence (n-values white-hosts [a-w-1]) (n-values black-hosts [a-b-1]) (n-values asian-hosts [a-a-1])) set gh-pref (map [[a] -> a * 1] gh-pref ) set choice (random-pick-host gh-pref) report host choice ] ] end to-report random-pick-guest-race [tmp] let var (1 / sum tmp) let _ps map [[a] -> a * var] tmp ;[0.1 0.2 0.1 0.4 0.1 0.01] let _r random-float 1 let _lst [ "White" "Black" "Asian" ] let _i 0 while [_r >= item _i _ps] [ set _r (_r - item _i _ps) set _i (_i + 1) ] report item _i _lst end to-report random-pick-host [tmp] let var (1 / sum tmp) let _ps map [[a] -> a * var] tmp ;[0.1 0.2 0.1 0.4 0.1 0.01] let _r random-float 1 let _lst (range 0 host-count) let _i 0 while [_r >= item _i _ps] [ set _r (_r - item _i _ps) set _i (_i + 1) ] report item _i _lst end ;;;;;;Gini coefficient to update-lorenz-and-gini let sorted-wealths sort [num-guest] of hosts let total-wealth sum sorted-wealths let wealth-sum-so-far 0 let index 0 set gini-index-reserve 0 set lorenz-points [] ;; now actually plot the Lorenz curve -- along the way, we also ;; calculate the Gini index. ;; (see the Info tab for a description of the curve and measure) if total-wealth > 0 [ repeat host-count [ set wealth-sum-so-far (wealth-sum-so-far + item index sorted-wealths) set lorenz-points lput ((wealth-sum-so-far / total-wealth) * 100) lorenz-points set index (index + 1) set gini-index-reserve gini-index-reserve + (index / host-count) - (wealth-sum-so-far / total-wealth) ] ] end
There is only one version of this model, created about 5 years ago by Chao Yu.
This model does not have any ancestors.
This model does not have any descendants.