Mendelian Inheritance in sunflowers

Mendelian Inheritance in sunflowers preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (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.2.2 • Viewed 521 times • Downloaded 111 times • Run 0 times
Download the 'Mendelian Inheritance in sunflowers' modelDownload this modelEmbed this model

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


Info tab cannot be displayed because of an encoding error

Comments and Questions

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

Click to Run Model

globals [x y p1 p2 population-size list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 f-x f-y flower-ID]    ;p1=selected parent 1, p2=selected parent 2,
turtles-own [parent c1 c2 c3 c4 genotype phenotype f-color inflorescence disc-flower]

breed [gametes gamete]
breed [flowers flower]
breed [leaves a-leaf]
breed [crosses cross]

to setup
ca

  set-ground
  set-gametes
  fertilization-1
  set-leaves
  set-cross
  output-results

  set list-1 []
  set list-2 []
  set list-3 []
  set list-4 []
  set list-5 []
  set list-6 []
  set list-7 []
  set list-8 []

reset-ticks
end 

to gamete-trait
    set size 0.1
    set color white
    set shape "dot"
end 

to set-gametes        ;produce gametes. These gametes are more randomized.

    create-gametes (50 + random 20) * 2
  [gamete-trait
    if cases = "Case 1" [                 ;monohybrid case 1--flower color
      set c1 item random 3 ["Y" "y" "y"]      ;produce two alleles for gene Y. Produce more y than Y to deviate from ratio of 3:1
      set c2 "s"
      set c3 "C"
      set genotype word c1 c2
      set genotype word genotype c3]

    if cases = "Case 2" [                 ;monohybrid case 2--Inflorescence
      set c1 "Y"
      set c2 item random 3 ["S" "s" "s"]      ;produce two alleles for gene S. Produce more s than S to deviate from ratio of 3:1
      set c3 "C"
      set genotype word c1 c2
      set genotype word genotype c3]

    if cases = "Case 3" [                 ;monohybrid case 3--disc-flower
      set c1 "y"
      set c2 "s"
      set c3 item random 3 ["C" "c" "c"]      ;produce two alleles for gene C. Produce more c than C to deviate from ratio of 3:1
      set genotype word c1 c2
      set genotype word genotype c3]

    if cases = "Case 4" [                 ;dihybrid--flower color and inflorescence
      set c1 item random 3 ["Y" "y" "y"]
      set c2 item random 3 ["S" "s" "s"]
      set c3 "C"
      set genotype word c1 c2
      set genotype word genotype c3]

    if cases = "Case 5" [                 ;dihybrid--disc-flower and inflorescence
      set c1 "y"
      set c2 item random 3 ["S" "s" "s"]
      set c3 item random 3 ["C" "c" "c"]
      set genotype word c1 c2
      set genotype word genotype c3]

    if cases = "Case 6" [                 ;dihybrid--flower color and disc-flower
      set c1 item random 3 ["Y" "y" "y"]
      set c2 "s"
      set c3 item random 3 ["C" "c" "c"]
      set genotype word c1 c2
      set genotype word genotype c3]

    if cases = "Challenges" [                 ;Challenges--cross get certain phenotypes
      set c1 item random 3 ["Y" "y" "y"]
      set c2 item random 3 ["S" "s" "s"]
      set c3 item random 3 ["C" "c" "c"]
      set genotype word c1 c2
      set genotype word genotype c3]
  ]
end 

to fertilization-1     ;Starting the P generation
  ask gametes [
    let mate one-of other gametes
    if mate != nobody
    [hatch-flowers 1
      [set genotype word genotype [genotype] of mate
       expression
       arrange-genotype
       set-position
        set size 0.8
        set label ""
       ]
    ]
    ask mate [die]
    die]
end 

to fertilization-2    ;both self-corss and test cross procedure

  ask gametes with [color = white] [
    let mate one-of gametes with [color = black]
    if mate != nobody
    [hatch-flowers 1
      [set genotype word genotype [genotype] of mate
        expression
        arrange-genotype
       set-position
        set size 0.8
        set label ""
       ]
    ]
    ask mate [die]
    die]
end 

to arrange-genotype
  set c1 item 0 genotype      ;read 1st allele
  set c2 item 3 genotype      ;read 4th allele
  set c1 word c1 c2           ;set the 1st pair of alleles
  if member? "yY" c1 [set c1 "Yy"]  ;rearrange alleles

  set c2 item 1 genotype      ;read 2nd allele
  set c3 item 4 genotype      ;read 5th allele
  set c2 word c2 c3           ;set the 2nd pair of alleles
  if member? "sS" c2 [set c2 "Ss"]  ;rearrange alleles


  set c3 item 2 genotype      ;read 3rd allele
  set c4 item 5 genotype      ;read 6th allele
  set c3 word c3 c4           ;set the 3rd pair of alleles
  if member? "cC" c3 [set c3 "Cc"]  ;rearrange alleles

  set genotype word c1 c2     ;connect the three pairs of alleles
  set genotype word genotype c3     ;connect the three pairs of alleles
end 

to expression

  ifelse member? "Y" genotype = true [set f-color "yellow" set color rgb 255 215 25 ]
                                     [set f-color "lemon-yellow" set color rgb 255 255 170 ]
  ifelse member? "S" genotype = true [set inflorescence "chrysanthemum-type" ifelse member? "C" genotype = true [set shape "sunflower" set disc-flower "purple-disc"][set shape "sunflower-0" set disc-flower "yellow-disc"]]
                                     [set inflorescence "normal-type" ifelse member? "C" genotype = true [set shape "sunflower-2" set disc-flower "purple-disc" ][set shape "sunflower-1" set disc-flower "yellow-disc"]]
end 

to pick

 ;clear-output
  if mouse-inside? [
    if mouse-down? [
      set x round mouse-xcor set y round mouse-ycor
      let closest-patch patches with [pxcor = x and pycor = y]
      ask closest-patch
      [if any? flowers-here
        [ask one-of flowers-here
        [ifelse count flowers with [pxcor >= (max-pxcor - 1)] > 0
          [setxy max-pxcor - 0.5 max-pycor - 2.5 set size 1.1]
          [setxy max-pxcor - 0.5 max-pycor - 0.5 set size 1.1]
        ]
      ]
    ]
  ]]


 if count flowers with [pxcor >= max-pxcor - 1] = 2 [     ;clean up the last generations when 2 parents are chosen

    let mom flowers with [ycor = max-pycor - 0.5]
    let dad flowers with [ycor = max-pycor - 2.5]

    set p1 [f-color] of mom    ;set phenotype color inflorescence disc-flower
    set p1 word p1 " "
    set p1 word p1 [inflorescence] of mom
    set p1 word p1 " "
    set p1 word p1 [disc-flower] of mom



    set p2 [f-color] of dad  ;set phenotype
    set p2 word p2 " "
    set p2 word p2 [inflorescence] of dad
    set p2 word p2 " "
    set p2 word p2 [disc-flower] of dad



    ask flowers with [pxcor < max-pxcor - 1 ] [die]
    ask gametes [die]

    stop
     ]
end 

to gametogenesis-1        ;self-cross

  set population-size (8 + random 4) * 8     ;times 8 so no decimals are generated when producing different gametes

  let parent-1 one-of flowers with [xcor = max-pxcor - 0.5 and ycor = max-pycor - 0.5]   ;must use one-of to show the genotype

  ;set sperms
  (ifelse                                     ;set Y gene
    member? "YY" [genotype] of parent-1 = true
      [create-gametes population-size [set genotype "Y" gamete-trait]]

    member? "Yy" [genotype] of parent-1 = true
      [create-gametes population-size * 0.5 [set genotype "Y" gamete-trait ]
       create-gametes population-size * 0.5 [set genotype "y" gamete-trait ]]

    member? "yy" [genotype] of parent-1 = true
      [create-gametes population-size [set genotype "y" gamete-trait]])


   (ifelse                                     ;set S gene
    member? "SS" [genotype] of parent-1 = true
    [ask gametes [set genotype word genotype "S"]]

    member? "ss" [genotype] of parent-1 = true
    [ask gametes [set genotype word genotype "s"]]

    member? "Ss" [genotype] of parent-1 = true
    [ask n-of (count gametes with [genotype = "Y"] * 0.5 ) gametes with [genotype = "Y"][set genotype word genotype "S"] ;first get a half of "Y" and set them as "YS"
     ask gametes with [genotype = "Y"][set genotype word genotype "s"]        ;get the rest "Y" and set them as "Ys"
     ask n-of (count gametes with [genotype = "y"] * 0.5 ) gametes with [genotype = "y"][set genotype word genotype "S"] ;first get a half of "y" and set them as "yS"
     ask gametes with [genotype = "y"][set genotype word genotype "s"]] )        ;get the rest "y" and set them as "ys"

     (ifelse                                     ;set C gene
      member? "CC" [genotype] of parent-1 = true
      [ask gametes [set genotype word genotype "C"]]

      member? "cc" [genotype] of parent-1 = true
      [ask gametes [set genotype word genotype "c"]]

      member? "Cc" [genotype] of parent-1 = true
      [ask n-of (count gametes with [genotype = "YS"] * 0.5 ) gametes with [genotype = "YS"][set genotype word genotype "C"] ;first get a half of "YS" and set them as "YSC"
       ask gametes with [genotype = "YS"][set genotype word genotype "c"]    ;;get the rest "YS" and set them as "YSc"

       ask n-of (count gametes with [genotype = "Ys"] * 0.5 ) gametes with [genotype = "Ys"][set genotype word genotype "C"] ;first get a half of "Ys" and set them as "YsC"
       ask gametes with [genotype = "Ys"][set genotype word genotype "c"]    ;;get the rest "Ys" and set them as "Ysc"

       ask n-of (count gametes with [genotype = "yS"] * 0.5 ) gametes with [genotype = "yS"][set genotype word genotype "C"] ;first get a half of "yS" and set them as "ySC"
       ask gametes with [genotype = "yS"][set genotype word genotype "c"]    ;;get the rest "yS" and set them as "ySc"

      ask n-of (count gametes with [genotype = "ys"] * 0.5 ) gametes with [genotype = "ys"][set genotype word genotype "C"] ;first get a half of "ys" and set them as "ysC"
      ask gametes with [genotype = "ys"][set genotype word genotype "c"]])    ;;get the rest "yS" and set them as "ysc"

  ;set eggs
    (ifelse                                     ;set Y gene
    member? "YY" [genotype] of parent-1 = true
      [create-gametes population-size [set genotype "Y" gamete-trait set color black]]

    member? "Yy" [genotype] of parent-1 = true
      [create-gametes population-size * 0.5 [set genotype "Y" gamete-trait set color black]
       create-gametes population-size * 0.5 [set genotype "y" gamete-trait set color black]]

    member? "yy" [genotype] of parent-1 = true
      [create-gametes population-size [set genotype "y" gamete-trait set color black]])

   (ifelse                                     ;set S gene
    member? "SS" [genotype] of parent-1 = true
    [ask gametes with [color = black] [set genotype word genotype "S"]]

    member? "ss" [genotype] of parent-1 = true
    [ask gametes with [color = black] [set genotype word genotype "s"]]

    member? "Ss" [genotype] of parent-1 = true
    [ask n-of (count gametes with [genotype = "Y" and color = black] * 0.5 ) gametes with [genotype = "Y" and color = black][set genotype word genotype "S"] ;first get a half of "Y" and set them as "YS"
     ask gametes with [genotype = "Y" and color = black][set genotype word genotype "s"]        ;get the rest "Y" and set them as "Ys"
     ask n-of (count gametes with [genotype = "y" and color = black] * 0.5 ) gametes with [genotype = "y" and color = black][set genotype word genotype "S"] ;first get a half of "y" and set them as "yS"
     ask gametes with [genotype = "y" and color = black][set genotype word genotype "s"]] )        ;get the rest "y" and set them as "ys"

     (ifelse                                     ;set C gene
      member? "CC" [genotype] of parent-1 = true
    [ask gametes with [color = black] [set genotype word genotype "C"]]

      member? "cc" [genotype] of parent-1 = true
      [ask gametes with [color = black] [set genotype word genotype "c"]]

      member? "Cc" [genotype] of parent-1 = true
      [ask n-of (count gametes with [genotype = "YS" and color = black] * 0.5 ) gametes with [genotype = "YS" and color = black][set genotype word genotype "C"] ;first get a half of "YS" and set them as "YSC"
       ask gametes with [genotype = "YS" and color = black][set genotype word genotype "c"]    ;;get the rest "YS" and set them as "YSc"

       ask n-of (count gametes with [genotype = "Ys" and color = black] * 0.5 ) gametes with [genotype = "Ys" and color = black][set genotype word genotype "C"] ;first get a half of "Ys" and set them as "YsC"
       ask gametes with [genotype = "Ys" and color = black][set genotype word genotype "c"]    ;;get the rest "Ys" and set them as "Ysc"

       ask n-of (count gametes with [genotype = "yS" and color = black] * 0.5 ) gametes with [genotype = "yS" and color = black][set genotype word genotype "C"] ;first get a half of "yS" and set them as "ySC"
       ask gametes with [genotype = "yS" and color = black][set genotype word genotype "c"]    ;;get the rest "yS" and set them as "ySc"

      ask n-of (count gametes with [genotype = "ys" and color = black] * 0.5 ) gametes with [genotype = "ys" and color = black][set genotype word genotype "C"] ;first get a half of "ys" and set them as "ysC"
      ask gametes with [genotype = "ys" and color = black][set genotype word genotype "c"]])    ;;get the rest "yS" and set them as "ysc"


  ask flowers [die]
end 

to gametogenesis-2         ;test cross

  set population-size (8 + random 4) * 8   ;times 8 so no decimals are generated when producing different gametes

  let mom one-of flowers with [xcor = max-pxcor - 0.5 and ycor = max-pycor - 0.5]    ;must use one-of to show the genotype
  let dad one-of flowers with [xcor = max-pxcor - 0.5 and ycor = max-pycor - 2.5]    ;must use one-of to show the genotype

   ;set eggs
  (ifelse                                     ;set Y gene
    member? "YY" [genotype] of mom = true
      [create-gametes population-size [set genotype "Y" gamete-trait]]

    member? "Yy" [genotype] of mom = true
      [create-gametes population-size * 0.5 [set genotype "Y" gamete-trait ]
       create-gametes population-size * 0.5 [set genotype "y" gamete-trait ]]

    member? "yy" [genotype] of mom = true
      [create-gametes population-size [set genotype "y" gamete-trait]])


   (ifelse                                     ;set S gene
    member? "SS" [genotype] of mom = true
    [ask gametes [set genotype word genotype "S"]]

    member? "ss" [genotype] of mom = true
    [ask gametes [set genotype word genotype "s"]]

    member? "Ss" [genotype] of mom = true
    [ask n-of (count gametes with [genotype = "Y"] * 0.5 ) gametes with [genotype = "Y"][set genotype word genotype "S"] ;first get a half of "Y" and set them as "YS"
     ask gametes with [genotype = "Y"][set genotype word genotype "s"]        ;get the rest "Y" and set them as "Ys"
     ask n-of (count gametes with [genotype = "y"] * 0.5 ) gametes with [genotype = "y"][set genotype word genotype "S"] ;first get a half of "y" and set them as "yS"
     ask gametes with [genotype = "y"][set genotype word genotype "s"]] )        ;get the rest "y" and set them as "ys"

     (ifelse                                     ;set C gene
      member? "CC" [genotype] of mom = true
      [ask gametes [set genotype word genotype "C"]]

      member? "cc" [genotype] of mom = true
      [ask gametes [set genotype word genotype "c"]]

      member? "Cc" [genotype] of mom = true
      [ask n-of (count gametes with [genotype = "YS"] * 0.5 ) gametes with [genotype = "YS"][set genotype word genotype "C"] ;first get a half of "YS" and set them as "YSC"
       ask gametes with [genotype = "YS"][set genotype word genotype "c"]    ;;get the rest "YS" and set them as "YSc"

       ask n-of (count gametes with [genotype = "Ys"] * 0.5 ) gametes with [genotype = "Ys"][set genotype word genotype "C"] ;first get a half of "Ys" and set them as "YsC"
       ask gametes with [genotype = "Ys"][set genotype word genotype "c"]    ;;get the rest "Ys" and set them as "Ysc"

       ask n-of (count gametes with [genotype = "yS"] * 0.5 ) gametes with [genotype = "yS"][set genotype word genotype "C"] ;first get a half of "yS" and set them as "ySC"
       ask gametes with [genotype = "yS"][set genotype word genotype "c"]    ;;get the rest "yS" and set them as "ySc"

      ask n-of (count gametes with [genotype = "ys"] * 0.5 ) gametes with [genotype = "ys"][set genotype word genotype "C"] ;first get a half of "ys" and set them as "ysC"
      ask gametes with [genotype = "ys"][set genotype word genotype "c"]])    ;;get the rest "yS" and set them as "ysc"

  ;set sperms
    (ifelse                                     ;set Y gene
    member? "YY" [genotype] of dad = true
      [create-gametes population-size [set genotype "Y" gamete-trait set color black]]

    member? "Yy" [genotype] of dad = true
      [create-gametes population-size * 0.5 [set genotype "Y" gamete-trait set color black]
       create-gametes population-size * 0.5 [set genotype "y" gamete-trait set color black]]

    member? "yy" [genotype] of dad = true
      [create-gametes population-size [set genotype "y" gamete-trait set color black]])

   (ifelse                                     ;set S gene
    member? "SS" [genotype] of dad = true
    [ask gametes with [color = black] [set genotype word genotype "S"]]

    member? "ss" [genotype] of dad = true
    [ask gametes with [color = black] [set genotype word genotype "s"]]

    member? "Ss" [genotype] of dad = true
    [ask n-of (count gametes with [genotype = "Y" and color = black] * 0.5 ) gametes with [genotype = "Y" and color = black][set genotype word genotype "S"] ;first get a half of "Y" and set them as "YS"
     ask gametes with [genotype = "Y" and color = black][set genotype word genotype "s"]        ;get the rest "Y" and set them as "Ys"
     ask n-of (count gametes with [genotype = "y" and color = black] * 0.5 ) gametes with [genotype = "y" and color = black][set genotype word genotype "S"] ;first get a half of "y" and set them as "yS"
     ask gametes with [genotype = "y" and color = black][set genotype word genotype "s"]] )        ;get the rest "y" and set them as "ys"

     (ifelse                                     ;set C gene
      member? "CC" [genotype] of dad = true
    [ask gametes with [color = black] [set genotype word genotype "C"]]

      member? "cc" [genotype] of dad = true
      [ask gametes with [color = black] [set genotype word genotype "c"]]

      member? "Cc" [genotype] of dad = true
      [ask n-of (count gametes with [genotype = "YS" and color = black] * 0.5 ) gametes with [genotype = "YS" and color = black][set genotype word genotype "C"] ;first get a half of "YS" and set them as "YSC"
       ask gametes with [genotype = "YS" and color = black][set genotype word genotype "c"]    ;;get the rest "YS" and set them as "YSc"

       ask n-of (count gametes with [genotype = "Ys" and color = black] * 0.5 ) gametes with [genotype = "Ys" and color = black][set genotype word genotype "C"] ;first get a half of "Ys" and set them as "YsC"
       ask gametes with [genotype = "Ys" and color = black][set genotype word genotype "c"]    ;;get the rest "Ys" and set them as "Ysc"

       ask n-of (count gametes with [genotype = "yS" and color = black] * 0.5 ) gametes with [genotype = "yS" and color = black][set genotype word genotype "C"] ;first get a half of "yS" and set them as "ySC"
       ask gametes with [genotype = "yS" and color = black][set genotype word genotype "c"]    ;;get the rest "yS" and set them as "ySc"

      ask n-of (count gametes with [genotype = "ys" and color = black] * 0.5 ) gametes with [genotype = "ys" and color = black][set genotype word genotype "C"] ;first get a half of "ys" and set them as "ysC"
      ask gametes with [genotype = "ys" and color = black][set genotype word genotype "c"]])    ;;get the rest "yS" and set them as "ysc"



  ask mom [die]
  ask dad [die]
end 

to set-lists
  if any? flowers with [xcor <= 12][
  (ifelse
      cases = "Case 1" [
        set list-1 [who] of flowers with [f-color = "yellow" and xcor < max-pxcor - 1]
        set list-2 [who] of flowers with [f-color = "lemon-yellow" and xcor < max-pxcor - 1]
        set list-1 sentence list-1 list-2
        sorting
      ]

      cases = "Case 2" [
        set list-1 [who] of flowers with [inflorescence = "normal-type" and xcor < max-pxcor - 1]
        set list-2 [who] of flowers with [inflorescence = "chrysanthemum-type" and xcor < max-pxcor - 1]
        set list-1 sentence list-1 list-2
        sorting  ]

      cases = "Case 3" [
        set list-1 [who] of flowers with [disc-flower = "purple-disc" and xcor < max-pxcor - 1]
        set list-2 [who] of flowers with [disc-flower = "yellow-disc" and xcor < max-pxcor - 1]
        set list-1 sentence list-1 list-2
        sorting  ]


      cases = "Case 4" [
        set list-1 [who] of flowers with [f-color = "yellow" and inflorescence = "normal-type" and xcor < max-pxcor - 1]
        set list-2 [who] of flowers with [f-color = "lemon-yellow" and inflorescence = "normal-type" and xcor < max-pxcor - 1]
        set list-1 sentence list-1 list-2

        set list-3 [who] of flowers with [f-color = "yellow" and inflorescence = "chrysanthemum-type" and xcor < max-pxcor - 1]
        set list-4 [who] of flowers with [f-color = "lemon-yellow" and inflorescence = "chrysanthemum-type" and xcor < max-pxcor - 1]
        set list-3 sentence list-3 list-4

        set list-1 sentence list-1 list-3

        sorting ]

      cases = "Case 5" [
        set list-1 [who] of flowers with [disc-flower = "purple-disc" and inflorescence = "normal-type" and xcor < max-pxcor - 1]
        set list-2 [who] of flowers with [disc-flower = "yellow-disc" and inflorescence = "normal-type" and xcor < max-pxcor - 1]
        set list-1 sentence list-1 list-2

        set list-3 [who] of flowers with [disc-flower = "purple-disc" and inflorescence = "chrysanthemum-type" and xcor < max-pxcor - 1]
        set list-4 [who] of flowers with [disc-flower = "yellow-disc" and inflorescence = "chrysanthemum-type" and xcor < max-pxcor - 1]
        set list-3 sentence list-3 list-4

        set list-1 sentence list-1 list-3

        sorting ]


      cases = "Case 6" [
        set list-1 [who] of flowers with [disc-flower = "purple-disc" and f-color = "yellow" and xcor < max-pxcor - 1]
        set list-2 [who] of flowers with [disc-flower = "yellow-disc" and f-color = "yellow" and xcor < max-pxcor - 1]
        set list-1 sentence list-1 list-2

        set list-3 [who] of flowers with [disc-flower = "purple-disc" and f-color = "lemon-yellow" and xcor < max-pxcor - 1]
        set list-4 [who] of flowers with [disc-flower = "yellow-disc" and f-color = "lemon-yellow" and xcor < max-pxcor - 1]
        set list-3 sentence list-3 list-4

        set list-1 sentence list-1 list-3

        sorting ]

      cases = "Challenges" [
        set list-1 [who] of flowers with [f-color = "yellow" and inflorescence = "normal-type" and disc-flower = "purple-disc" and xcor < max-pxcor - 1]
        set list-2 [who] of flowers with [f-color = "yellow" and inflorescence = "normal-type" and disc-flower = "yellow-disc" and xcor < max-pxcor - 1]
        set list-1 sentence list-1 list-2

        set list-3 [who] of flowers with [f-color = "yellow" and inflorescence = "chrysanthemum-type" and disc-flower = "purple-disc" and xcor < max-pxcor - 1]
        set list-4 [who] of flowers with [f-color = "yellow" and inflorescence = "chrysanthemum-type" and disc-flower = "yellow-disc" and xcor < max-pxcor - 1]
        set list-3 sentence list-3 list-4

        set list-1 sentence list-1 list-3

        set list-5 [who] of flowers with [f-color = "lemon-yellow" and inflorescence = "normal-type" and disc-flower = "purple-disc" and xcor < max-pxcor - 1]
        set list-6 [who] of flowers with [f-color = "lemon-yellow" and inflorescence = "normal-type" and disc-flower = "yellow-disc" and xcor < max-pxcor - 1]
        set list-5 sentence list-5 list-6

        set list-7 [who] of flowers with [f-color = "lemon-yellow" and inflorescence = "chrysanthemum-type" and disc-flower = "purple-disc" and xcor < max-pxcor - 1]
        set list-8 [who] of flowers with [f-color = "lemon-yellow" and inflorescence = "chrysanthemum-type" and disc-flower = "yellow-disc" and xcor < max-pxcor - 1]
        set list-7 sentence list-7 list-8

        set list-5 sentence list-5 list-7

        set list-1 sentence list-1 list-5

        sorting ]
  )
    ]
end 

to sorting

   set f-x 0
        set f-y max-pycor
        set flower-ID 0

        repeat length list-1
        [ask flowers with [who = item flower-ID list-1] [setxy f-x f-y]
          ifelse f-y > 0 [set f-y f-y - 1][set f-y max-pycor set f-x f-x + 1]
          set flower-ID flower-ID + 1 ]
end 

to output-results

 (ifelse
  cases = "Case 1" [
  output-print "Use case 1 to explore the inheritance patterns of ray flower color."
  ]

 cases = "Case 2" [
  output-print "Use case 2 to explore the inheritance patterns of inflorescence type."
  ]

 cases = "Case 3" [
  output-print "Use case 3 to explore the inheritance patterns of disc color."
  output-print ""
  ]

 cases = "Case 4" [
  output-print "Use case 4 to explore the inheritance patterns between ray flower color and inflorescence type."
  ]

 cases = "Case 5" [
  output-print "Use case 5 to explore the inheritance patterns between inflorescence type and disc color."
  ]

 cases = "Case 6" [
  output-print "Use case 6 to explore the inheritance patterns between ray flower color and disc color."
  ]

 cases = "Challenges" [
  output-print "Challege 1: Create a purebred 'Teddy bear' variety--yellow color, chrysanthemum-type inflorescence, and yellow disc. "
  output-print "Challege 2: Create a purebred 'White Nite' variety--light yellow color, normal-type inflorescence, and purple disc."
  ]
    )
end 

to set-cross

  create-crosses 1
  [set size 1.2
    set color 49
    set shape "square-1"
    setxy max-pxcor - 0.5 max-pycor - .5]

  create-crosses 1
  [set size 0.5
    set color 49
    set shape "x"
    setxy max-pxcor - 0.5 max-pycor - 1.5]

  create-crosses 1
  [set size 1.2
    set color 49
    set shape "square-1"
    setxy max-pxcor - 0.5 max-pycor - 2.5]
end 

to set-ground
  ask patches [set pcolor 52.5 + random-float 0.5]
  ask patches with [pxcor >= max-pxcor - 1] [set pcolor 0]
end 

to set-leaves
create-leaves 7 + random 4
  [
    set shape "stem-2"
    setxy max-pxcor - random-float 1.2 0.2 + min-pycor + random-float 2.5
    set size 1.5 - [ycor] of self * 0.2
    set color 55 - ([ycor] of self) * 0.75
  ]
end 

to set-position
  setxy random (max-pxcor - 1) random (max-pycor + 1)
  if any? other flowers-here [set-position]
end 

There are 16 versions of this model.

Uploaded by When Description Download
lin xiang almost 2 years ago Minor interface adjustment Download this version
lin xiang almost 2 years ago Refine the Gametogenesis and phenotypic sorting code Download this version
lin xiang almost 2 years ago Remove the trihybrids, add challenges of creating new purebred varieties Download this version
lin xiang about 2 years ago Change orange flower to lemon-yellow, add flower sorting Download this version
lin xiang about 2 years ago Add subtotal monitors to help data collection Download this version
lin xiang over 3 years ago update license Download this version
lin xiang almost 5 years ago adjust the label color Download this version
lin xiang almost 5 years ago fix button settings Download this version
lin xiang almost 5 years ago include inspect function for running the model on NetLogo Web Download this version
lin xiang almost 6 years ago remove ask-concurrent Download this version
lin xiang almost 6 years ago The number of gametes are adjusted at the beginning of a case. Download this version
lin xiang almost 6 years ago fix self pollination error Download this version
lin xiang almost 6 years ago fix the cross pollination error Download this version
lin xiang almost 6 years ago Phenotype expression is updated. Download this version
lin xiang almost 6 years ago Ask-concurrent is removed from the online version. Download this version
lin xiang almost 6 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Mendelian Inheritance in sunflowers.png preview preview about 2 years ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.