SimpleShoeFactory

SimpleShoeFactory preview image

1 collaborator

Default-person Rotimi Ogunsakin (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0 • Viewed 301 times • Downloaded 31 times • Run 0 times
Download the 'SimpleShoeFactory' 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

breed [shoes shoe]
breed [soles sole]

shoes-own [
  shoe_type
  shoe_speed
  shoe_speed_limit
  shoe_speed_min]

soles-own[
  sole_type
  sole_speed
  sole_speed_limit
  sole_speed_min]


globals[sample-shoe
  sample-sole]

to setup
  clear-all
  setup-patches
  setup-turtles
  setup-links
  set-default-shape turtles "wheel"
  set-default-shape links "belt"
  ;watch sample-shoe
  ;watch sample sole
  reset-ticks
end 

to start
  create-shoes number-of-shoes
  create-soles number-of-soles
  ask shoes [
    ;set label "shoe head"
    set color white
    set xcor -23
    set ycor 5
    set shape "shoe_1"
    set size 5
    set heading 90
    set shoe_speed 2 ;+ random-float 0.9
    set shoe_speed_limit 1
    set shoe_speed_min 0
    ]
  ask soles [
    set color white
    set xcor -23
    set ycor -5
    set shape "sole_1"
    set size 5
    set heading 90
    set sole_speed 2 ;+ random-float 0.9
    set sole_speed_limit 1
    set sole_speed_min 0
    ]
  set sample-shoe one-of shoes
  set sample-sole one-of soles
end 

to go
  move-shoe
  move-sole
  tick
end 

to move-shoe
  if any? shoes[
  ask one-of shoes [
    if any? other shoes-here [ fd 1]
    fd shoe_speed
    if xcor >= -11 [
       set heading 110
     set shape "shoe_2"]

    if xcor >= 3[
     set heading 90
     set shape "shoe_3"]

    if xcor >= 15[
     ;set heading 90
     set shape "shoe_box"]

    if xcor >= 22[
      ask one-of shoes-here [die]]
  ]]
;  ifelse show-shoe?
;  [set label shoe_type ]
;  [set label "" ]
end 

to move-sole
  if any? soles[
  ask one-of soles[
    if any? other soles-here [ fd 1]
  fd sole_speed
   if xcor >= -11 [
       set heading 70
     set shape "sole_2"]

    if xcor >= 2[
    ask one-of soles-here [die]]

  ]]
;   ifelse show-sole?
;  [set label sole_type ]
;  [set label "" ]
end 

to setup-patches
  ask patches [ set pcolor blue - 2]
end 

to setup-conveyor-main
  ;if pycor < 10 and pycor > 4  and pxcor <= -5 [ set pcolor white]
  ;if pycor < -4 and pycor > -10 and pxcor <= -5[ set pcolor white]
  ;if pycor < 10 and pycor > 4  and pxcor <= -5 [ set pcolor white]
end 

to setup-turtles
  create-turtles 6

  ask turtle 1 [
    set size 3
    set xcor -23
    set ycor 5
    set label "UpperProduction"
  ]

   ask turtle 2 [
    set size 3
    set xcor -11
    set ycor 5
    set label "UpperPainting"
  ]

ask turtle 3 [
    set size 3
    set xcor -23
    set ycor -5
    set label "SoleProduction"
  ]

   ask turtle 4 [
    set size 3
    set xcor -11
    set ycor -5
    set label "SolePainting"
  ]

   ask turtle 5 [
    set size 3
    set xcor 3
    set ycor 0
    set label "Upper&SoleAttachement"
  ]

   ask turtle 0 [
    set size 3
    set xcor 15
    set ycor 0
    set label "Packaging"
  ]
;  foreach [ 2 4  6 9 ] [ ask turtles [
;    set xcor ?
;    set ycor ?]
;  ]
end 

to setup-links
  ask turtle 1 [create-link-to turtle 2]
  ask turtle 3 [create-link-to turtle 4]
  ask turtle 2 [create-link-to turtle 5]
  ask turtle 4 [create-link-to turtle 5]
  ask turtle 5 [create-link-to turtle 0]
  ask links [set thickness 3]
end 

There is only one version of this model, created over 8 years ago by Rotimi Ogunsakin.

Attached files

File Type Description Last updated
SimpleShoeFactory.png preview Preview for 'SimpleShoeFactory' over 8 years ago, by Rotimi Ogunsakin Download

This model does not have any ancestors.

This model does not have any descendants.