Movie Theater Profits

Movie Theater Profits preview image

3 collaborators

Default-person Trevor Cickovski (Author)
Ross Busch (Author)
Julia Barton (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.1.0 • Viewed 368 times • Downloaded 33 times • Run 0 times
Download the 'Movie Theater Profits' 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

Turtles-own [ gender rom-com bought-ticket?  
    age female-friends male-friends possible-female-friends possible-male-friends ] ;;; Declaring which variables will be turtle variables.

Patches-own [theater?]  ;;;Declaring which variables will be patch variables. 

Globals [ max-female-friends max-male-friends rom-com-revenue action-movie-revenue social-network
  switching-chance]  ;;; Declaring which variables will be global variables, known by all agents.  

To Setup 
  ca                      ;;;When the setup button is clicked, the model is cleared of all previous data. 
  reset-ticks             ;;;When the setup button is clicked, the model resets any ticks from previous model runs. 
  crt female-population-percentage [
  set size 1
  set color pink
  set gender "female" 
  
  setxy random-xcor random-ycor ]  ;;; Creates the amount of turtles specified by the slider "female-population-percentage," sets the size of the turtle, the color of the turtle,and the gender
  
                                   ;;; of the turtle to female.  Furthermore, this portion of the code sets the location of the turtles to be completely random (random-xcor random-ycor.)
  

  
  set rom-com-revenue 0 set action-movie-revenue 0  ;;; Sets the value of rom-com-revenue and action-movie-revenue to zero. 
  
  crt 100 - female-population-percentage [ set size 1 set color blue set gender "male" setxy random-xcor random-ycor ]  ;;;Establishes the male population percentage, gender, color, size, and location. 
 
ask turtles [ ifelse gender = "female" [set rom-com true][set rom-com false]]  ;;; Sets the movie preference if a turtle is a female to a romantic comedy.
 
   if age2%31-45 > 100 - age1%15-30 [set age2%31-45 100 - age1%15-30]  ;;; These four equations determine the age range for each turtle, which helps establish a social network later in the model. 
   if age3%46-60 > 100 - age2%31-45 - age1%15-30 [set age3%46-60 100 - age2%31-45 - age1%15-30]
   if age4%61-75 > 100 - age3%46-60 - age2%31-45 - age1%15-30 [set age4%61-75 100 - age3%46-60 - age2%31-45 - age1%15-30]
   if age4%61-75 + age3%46-60 + age2%31-45 + age1%15-30 < 100 [set other% 100 - age4%61-75 - age3%46-60 - age2%31-45 - age1%15-30] 
  
   ask turtles
   [let yoage random 100 
      ifelse yoage < age1%15-30 [set age 1][ifelse yoage < age1%15-30 + age2%31-45[set age 2][ifelse yoage < age1%15-30 + age2%31-45 + age3%46-60[set age 3]
          [ifelse yoage < age1%15-30 + age2%31-45 + age3%46-60 + age4%61-75[set age 4][set age 5]]]]] ;;; Sets each age range to a definite number value. 
   
   
      
  ask n-of num-theaters patches [set theater? true set pcolor green]  ;;; Establishes the location of movie theaters, and the color of a movie theater patch. 
  
 
 
 
set max-female-friends max-social-network-size * 0.6 
set max-male-friends max-social-network-size - max-female-friends ;;; Establishes the maximum amount of friends a female or male could have based on the maximum social network size.


  
ask turtles [ 

 set possible-female-friends n-of max-female-friends other turtles with [gender = "female" and abs (age - [age] of myself) <= 1]
 set possible-male-friends n-of max-male-friends other turtles with [gender = "male" and abs (age - [age] of myself) <= 1] ;;; Establishes the possible friends of each gender based on gender and age. 
  
  

let f 0 ;;; Temporarily establishes a value for the amount of female and male friends.  It is important that it starts at 0, so that friends can be counted as they increase in number.
let m 0

ask possible-female-friends 
[ifelse [gender] of myself = "female" [if female-friends < max-female-friends [create-link-with myself 
  set female-friends female-friends + 1 
  set f f + 1]][if male-friends < max-male-friends [create-link-with myself set male-friends male-friends + 1
    set f f + 1]]] ;;;This aspect of the code initiates the "friending" for females process.


ask possible-male-friends
[ifelse [gender] of myself = "male" [if male-friends < max-male-friends [create-link-with myself
    set male-friends male-friends + 1 set m m + 1]][if female-friends < max-female-friends [create-link-with myself set female-friends female-friends + 1 
    set m m + 1]]] ;;; This aspect of the code initiates the "friending" for males process.
  
  

]
ask turtles [set bought-ticket? false]  ;;;Establishes that no turtles have purchased a ticket at this point in the model.  
end 

  

  
  
To go 
  if ticks = 60 [stop] ;;; Establishes that after 60 ticks, whereas each tick is equivalent to one day, the model would conclude. 
  tick ;;; The model begins to record ticks. 
 ask turtles [let min-theater min-one-of patches with [pcolor = green][distance myself] face min-theater fd 1   ;;; Asks turtles to move towards theaters. 
 
 ifelse male-friends > female-friends [set rom-com false][set rom-com true]] ;;; Establishes that when there are more female friends than male friends in a group of friends, those turtles will be more likely to see a romantic comedy. 

 ask turtles[
 set switching-chance .3 ;;; Establishes that although a turtle may have a predisposed movie preference, that turtle also has an opportunity to change its mind based on a turtle's social network.
 let other-turtles turtles-on patch-here
 if theater? = true and count other-turtles > 0 [let other-rom-coms count other-turtles with [rom-com = true] let other-action count other-turtles with [rom-com = false]
 let pct-rom-com (other-rom-coms) / (other-rom-coms + other-action)
 let pct-action 1 - pct-rom-com
 ifelse rom-com = false [set switching-chance switching-chance * pct-rom-com let rand random-float 1
   ifelse gender = "female" and age > 1 and age < 4 [set switching-chance switching-chance * (3 / 2)][if gender = "female"and age > 4 [set switching-chance switching-chance * (4 / 3)]]
ifelse rand < switching-chance  [set rom-com true][set rom-com false]]
    [set switching-chance switching-chance * (1 - pct-rom-com) let rand random-float 1 
ifelse rand < switching-chance  [set rom-com false][set rom-com true]]
    ;;; The above code determines the amount of turtles at a theater seeing a given movie, and programs a switching chance into a turtle based on what movies turtles at a theater are seeing, as well as a decrease in preference for action movies as female turtles increase in age.  
   
 


if female-friends + male-friends > 0 [
let pct-female-friends female-friends / (female-friends + male-friends)
 let pct-male-friends 1 - pct-female-friends
 ifelse rom-com = false [set switching-chance switching-chance * pct-female-friends let rand2 random-float 1 
ifelse rand2 < switching-chance [set rom-com true][set rom-com false]][set switching-chance switching-chance * (1 - pct-female-friends) let rand2 random-float 1 
ifelse rand2 < switching-chance [set rom-com false][set rom-com true]]]]  
;;; Codes for a switch in movie preference based on switching chance based on female and male populations at a movie theater. 
 
 if theater? = true and bought-ticket? = false [ifelse rom-com = false [set action-movie-revenue action-movie-revenue + 10 set bought-ticket? true]
   [set rom-com-revenue rom-com-revenue + 10 set bought-ticket? true]] ;;; Codes for the increase in revenue based on tickets purchased.
  
 
 ]
end 

To output 
 set-current-plot  "rom-com-revenue" set-current-plot "action-movie-revenue" ;;; Establishes the outputs created in the plot.  
end 
 

There is only one version of this model, created about 10 years ago by Trevor Cickovski.

Attached files

File Type Description Last updated
Movie Theater ODD.docx word ODD Documentation for Movie Theater Profits about 10 years ago, by Trevor Cickovski Download
Movie Theater Profits.png preview Preview for 'Movie Theater Profits' about 10 years ago, by Trevor Cickovski Download

This model does not have any ancestors.

This model does not have any descendants.