Shopping Checkout

No preview image

1 collaborator

Default-person Tanya Flores (Author)

Tags

(This model has yet to be categorized with any tags)
Model group sharona-modeling-class | Visible to everyone | Changeable by the author
Model was written in NetLogo 4.1 • Viewed 207 times • Downloaded 7 times • Run 6 times
Download the 'Shopping Checkout' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This section could give a general understanding of what the model is trying to show or explain.

HOW IT WORKS

This section could explain what rules the agents use to create the overall behavior of the model.

HOW TO USE IT

This section could explain how to use the model, including a description of each of the items in the interface tab.

THINGS TO NOTICE

This section could give some ideas of things for the user to notice while running the model.

THINGS TO TRY

This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.

EXTENDING THE MODEL

This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc.

NETLOGO FEATURES

This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.

RELATED MODELS

This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.

CREDITS AND REFERENCES

This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
  checkout-one?
  checkout-two?
  checkout-three?
  checkout-number  
  wait-time1
  wait-time2
  wait-time3
 ]
turtles-own [
  energy
]

to setup
  clear-all
  set-default-shape turtles "person"
  crt population
  [ set size 2         
    set color red  ] 
  setup-store
end 

to setup-store
 ask patch -10 6
  [set checkout-number 1 
    set checkout-one? (distancexy -10 6) < 1
    set pcolor cyan]
 ask patch 0 6
  [set checkout-number 2
    set checkout-two? (distancexy 0 6) < 1
    set pcolor blue]
 ask patch 10 6
  [set checkout-number 1 
    set checkout-three? (distancexy 10 6) < 1
    set pcolor white]
end 

to go  ;; forever button
  ask turtles
  [ if who >= ticks [ stop ] ;; delay initial departure
    if color = red
    [ look-for-checkout ] ;;ready for checkout? find checkout  
    keep-shopping
    fd 1 ]
  
  ask patches
  [if checkout-number = 1 [set wait-time1 wait-time1 * (1 - regular-checkout-rate)]
  if checkout-number = 2 [set wait-time2 wait-time2 * (1 - self-checkout-rate)]
  if checkout-number = 3 [set wait-time3 wait-time3 * (1 - item-checkout-rate)] ] 
  tick
  do-plotting
end 

to keep-shopping  ;; turtle procedure
  rt random 40
  lt random 40
  if not can-move? 1 [ rt 180 ]
end 

to look-for-checkout  ;; turtle procedure
  if patch-here = patch -10 6
    [set color orange + 1
    stamp
    set wait-time1 wait-time1 + 1        ;; and increase the wait time
    set energy ticks + wait-time1
    if ticks > energy [die]
    stop]
  if patch-here = patch 0 6
    [set color orange + 1 
    stamp
    set wait-time2 wait-time2 + 1        ;; and increase the wait time
    set energy ticks + wait-time2
    if ticks > energy [die]
    stop]
 if patch-here = patch 10 6
    [set color orange + 1         ;; find store
    stamp
    set wait-time3 wait-time3 + 1        ;; and increase the wait time
    set energy ticks + wait-time3
    if ticks > energy [die]
    stop]
 
   rt 45
end 

to do-plotting
  set-current-plot "Wait time"
  set-current-plot-pen "15-item checkout"
  plot  wait-time3
  set-current-plot-pen "self checkout"
  plot  wait-time1
   set-current-plot-pen "regular checkout"
  plot  wait-time2
end 

There is only one version of this model, created almost 7 years ago by Tanya Flores.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.