electry

No preview image

1 collaborator

Default-person soheir othman (Author)

Tags

(This model has yet to be categorized with any tags)
Model group uhaifa-modeling-11 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 4.1.2 • Viewed 149 times • Downloaded 20 times • Run 0 times
Download the 'electry' 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 code example is a demo of a basic random walk. At each step, the yellow turtle changes its heading randomly.

THINGS TO NOTICE

The turtle's pen is down, so it leaves a trail behind it in the drawing.

RELATED MODELS

Random Grid Walk Example - the same except that the random walk is constrained to lie on a grid

Comments and Questions

שאלות חשמל (Question)

שלום שרונה אחרי ניסויים של הרבה שעות היום 3 שעות ואתמול שעתיים מעלים מה הצלחנו לעשות. הצלחנו לבקש מהאלקטרונים לזוז רק בתיל אבל בכיוון אחד ולא הצלחנו לסובב אותו. הפקודות הם go-cs go-pc יש לנו כמה שאלות : 1. איך נסובב את האלקטרון 2. אם נוסיף מנורות בשימוש ב slider קשה למקם אותו אז צריכים להוסיף כמה buttun על מינת להוסיף מנורות רוצים לקבוע אתך פגישת סקייב להמשיך לעבוד נשות החשמל סוהיר + אמאל+ רנא+ מונא+ לילא

Posted almost 13 years ago

שאלות חשמל (Question)

שלום שרונה אחרי ניסויים של הרבה שעות היום 3 שעות ואתמול שעתיים מעלים מה הצלחנו לעשות. הצלחנו לבקש מהאלקטרונים לזוז רק בתיל אבל בכיוון אחד ולא הצלחנו לסובב אותו. הפקודות הם go-cs go-pc יש לנו כמה שאלות : 1. איך נסובב את האלקטרון 2. אם נוסיף מנורות בשימוש ב slider קשה למקם אותו אז צריכים להוסיף כמה buttun על מינת להוסיף מנורות רוצים לקבוע אתך פגישת סקייב להמשיך לעבוד נשות החשמל סוהיר + אמאל+ רנא+ מונא+ לילא

Posted almost 13 years ago

שינוי שפה במודל מקשה (Question)

איני יכולה לראות את הכפתורים על המודל - כי השינוי בשפה לא עובר למחשב שלי, הוא מקינטוש. אני מציעה שתרשמו שמות באנגלית עד לגרסה האחרונה

Posted almost 13 years ago

כיוון של צב (Question)

heading זה התכונה שמתארת את כיוון הצב אפשר ליצור מצב שאם האלקטרון חש בשינוי בסביבה שלו (למשל היא לא הצבע של התיל) אזי הוא צריך להסתובב ימינה 90 מעלות right 90

Posted almost 13 years ago

מספר נורות (Question)

מיקום הנורות אפשר גם לעבוד אחרת לפי מספר הנורות שבוחרים לפני setup מסדרים את הנורות במרחב של המעגל

Posted almost 13 years ago

פגישת סקייפ (Question)

מציעה שתרשמו לי את זה במייל, שכולן רשומות - כדי שנוכל לסגור על זמן מהר באופן עקרוני אפשר מחר, יום ראשון, בערב

Posted almost 13 years ago

Click to Run Model





breed [electrons-cs  electron-cs]
breed [lights-on-cs light-on-cs]
breed [mafseks-on-cs  mafsek-on-cs]
breed [mafseks-off-cs   mafsek-off-cs]
breed [battery-cs  batteries-cs]



breed [electrons-pc  electron-Pc]
breed [lights-on-Pc  light-on-Pc]
breed [mafseks-on-Pc mafsek-on-Pc]
breed [mafseks-off-Pc  mafsek-off-Pc]
breed [battery-Pc   batteries-Pc]

globals [ current ]

to setup [ 
   clear all 
  
]
end 

to set-up-mafsek-on-ciruit-Serial 
  
   set-default-shape mafseks-on-cs  "mafsek-on-cs"
  create-mafseks-on-cs 1 [
       setxy 20 11
        set size 12
        set heading 180
    ]
end 

to set-up-mafsek-off-ciruit-Serial
  
   set-default-shape mafseks-off-cs  "mafsek-off-cs"
  create-mafseks-off-cs 1 [
       setxy 20 8.5
        set size 12
        set heading 0
    ]
end 

to set-up-light-on-ciruit-Serial 
  
  set-default-shape lights-on-cs  "light-on-cs"
  create-lights-on-cs 1 [
    
    setxy 25 20
    set size 2
    set heading 90
    
  ]
  
   
  set-default-shape lights-on-cs  "light-on-cs"
  create-lights-on-cs 1 [
    
    setxy 15 20
    set size 2
    set heading 90
    
  ]
end  

to set-up-electron-ciruit-Serial
 
 set-default-shape electrons-cs  "electron-cs"
  create-electrons-cs 10 [
    setxy 10 10
    set size 0.5
    set heading 90
  ]
end 

to set-up-battery-ciruit-Serial
   
   set-default-shape battery-cs  "battery-cs"
   create-battery-cs 1 [
       setxy 30 9
        set size 12
        set heading 360
    ] 
end 

to set-up-light-on-Parallel-circuit
 set-default-shape lights-on-Pc "light-on-Pc"
    create-lights-on-Pc 1 [
    setxy 62 15
    set size 2
    set heading 90
  ]
  set-default-shape lights-on-Pc  "light-on-Pc"
  create-lights-on-Pc 1 [
    setxy 62 20
    set size 2
    set heading 90
  ]
end 

to set-up-mafsek-on-Parallel-circuit
  
 set-default-shape mafseks-on-Pc  "mafsek-on-Pc"
  create-mafseks-on-Pc 1 [
    setxy 57 10.5
    set size 8
    set heading 180
  ]
end 

to set-up-mafsek-off-Parallel-circuit
  
 set-default-shape mafseks-off-Pc  "mafsek-off-Pc"
  create-mafseks-off-Pc 1 [
    setxy 58 10.5
    set size 8
    set heading 90
  ]
end 

to set-up-electron-Parallel-circuit
 
 set-default-shape electrons-Pc  "electron-Pc"
  create-electrons-Pc 10 [
    setxy 50 10
    set size 0.5
    set heading 90
    
    ]
end 

to set-up-battery-Parallel-circuit
   
   set-default-shape battery-Pc  "battery-Pc"
   create-battery-Pc 1 [
       setxy 68 9
        set size 12
        set heading 360
    ] 
end 

to Closed-Circuit-Serial
ca  
end  

to open-Circuit-Serial
  
ca
 ca                                              ;; clear everything
 
  ask patches[
    ;; if patches are between (10,10) to (10,20)...
    if (pxcor = (10) and pycor >= (10) and pycor <= ( 20 ) )
      [set pcolor red]                                ;; ... draws left edge in red
    ;; if patches are between (35,10) to (35,20)...
    if ( pxcor = (35) and pycor >= (10) and pycor <= (20) )
      [set pcolor red]                                ;; ... draws right edge in red
    ;; if patches are between (10,10) to (35,10)...
    if ( pycor = (10) and pxcor >= (10) and pxcor <= (35) )
      [set pcolor red]                                ;; ... draws bottom edge in red
    ;; if patches are between (10,20) to (35,20)...
    if ( pycor = (20) and pxcor >= (10) and pxcor <= (35) )
      [set pcolor red]                                ;; ... draws upper edge in red
    ]
 
    set-up-light-on-ciruit-Serial
    set-up-mafsek-off-ciruit-Serial
    set-up-electron-ciruit-Serial
    set-up-battery-ciruit-Serial
end 

to Burning-light-cs
  ca 
end  

to close-circuit-cs
  ca
end 

to insert-light-cs
ca
end  

to Increasing-electrons-cs
ca
end  

to open-circuit-pc
  ca
end 

to Burning-light-pc
  ca 
end  

to close-circuit-pc
  
  ca
end 

to insert-light-pc 
  set-default-shape lights-on-Pc  "light-on-Pc"
  create-lights-on-Pc 1 [
    setxy 56 20
    set size 2
    set heading 90
  ]
end 

to Increasing-electrons
ca
end  

to Increasing-electrons-pc
ca
end  

to setup-ciruit-Serial
  ca                                              ;; clear everything
 
  ask patches[
    ;; if patches are between (10,10) to (10,20)...
    if (pxcor = (10) and pycor >= (10) and pycor <= ( 20 ) )
      [set pcolor red]                                ;; ... draws left edge in red
    ;; if patches are between (35,10) to (35,20)...
    if ( pxcor = (35) and pycor >= (10) and pycor <= (20) )
      [set pcolor red]                                ;; ... draws right edge in red
    ;; if patches are between (10,10) to (35,10)...
    if ( pycor = (10) and pxcor >= (10) and pxcor <= (35) )
      [set pcolor red]                                ;; ... draws bottom edge in red
    ;; if patches are between (10,20) to (35,20)...
    if ( pycor = (20) and pxcor >= (10) and pxcor <= (35) )
      [set pcolor red]                                ;; ... draws upper edge in red
    ]
 
    set-up-light-on-ciruit-Serial
    set-up-mafsek-off-ciruit-Serial  
    set-up-electron-ciruit-Serial
    set-up-battery-ciruit-Serial
end 

;******************************************************************

to go-pc
  tick

  ask electrons-pc
    [
   ; set heading 360
   ; fd speed-of-electrons
   
    fd 0.5
  ]

  ask electrons-pc with [pcolor = black]
  [
    hatch-electrons-pc 1
   [
      set color orange - 2  ;; dark orange
      set size 1
       setxy  50 10 
   ]
          ifelse
    pxcor >= 50   and pxcor <= 74 [ fd 0.5] 
      [ set heading 270 ]
      
  
  ask electrons-Pc
     
   [ ifelse
    pycor >= 10   and pycor <= 20 [ fd 0.5] 
      [ set heading 360 ]
     ]
     ; setxy max-pxcor - 10 ycor
  
    set current current + 1
    die
 
]
;  if current >= Filling-Capacity
 ; [
  ;  user-message (word "The Sink Is Full; Time Taken to Fill = " ticks " isecs ")
   ; stop
  ;]
end 

;*************************************************


; ***********************************

to go-cs
  tick

  ask electrons-cs
    [
    set heading 90
   ; fd speed-of-electrons
   
    fd 0.5
  ]

  ask electrons-cs with [pcolor = black]
  [
    hatch-electrons-cs 1
   [
      set color orange - 2  ;; dark orange
      set size 1
       setxy  10 10 
   ]
     ask electrons-cs
   
  [ ifelse
    pxcor >= 10   and pxcor <= 34 [ fd 0.5] 
      [ set heading 90 ]
     ]  
  
  ; ask electrons-cs
   
  ;  [ ifelse
  ;  pycor >= 10   and pycor <= 30 [ fd 1] 
   ;   [ set heading 0 ]
   ;  ]
    
    ask electrons-cs
   
    [ ifelse
    pycor >= 10   and pycor <= 19.5 [ fd 0.5] 
      [ set heading 270 ]
     ]
    
       
   ask electrons-cs
   
    [ ifelse
    pxcor    <= 36    and pxcor >= 11 [ fd 0.5] 
      [ set heading 180] stop   
     ] 
   
   
  
    set current current + 1
    die
 
]
;  if current >= Filling-Capacity
 ; [
  ;  user-message (word "The Sink Is Full; Time Taken to Fill = " ticks " isecs ")
   ; stop
  ;]
end 

;*************************************************

to  go-Serial-circuit
   

   ask electrons-cs
   
  [ ifelse
    pxcor >= 10   and pxcor <= 34 [ fd 0.5] 
      [ set heading 0 ]
     ]  
  
  ; ask electrons-cs
   
  ;  [ ifelse
  ;  pycor >= 10   and pycor <= 30 [ fd 1] 
   ;   [ set heading 0 ]
   ;  ]
    
    ask electrons-cs
   
    [ ifelse
    pycor >= 10   and pycor <= 19.5 [ fd 0.5] 
      [ set heading 270 ]
     ]
    
       
   ask electrons-cs
   
    [ ifelse
    pxcor    <= 36    and pxcor >= 11 [ fd 0.5] 
      [ set heading 180] stop   
     ] 
   
   
    
    ;**************************************************
     ; we try but donwt sucseec 
  ;  ask patches with  color of red 
  ;       patch-set set pcolor orange
;*********************************************************


       
   ; ask electrons-cs
   
    ;[ ifelse
    ;pxcor    <= 34    and pxcor >= 10 [ bk 1] 
     ; [ set heading 360]
     ;] 

    
  ;  repeat 2 [ fd 8 rt 90 ]   
end 

to setup-ciruit-Parallel 
                                              
  ask patches[
    ;; if patches are between (50,10) to (50,20)...
    if (pxcor = (50) and pycor >= (10) and pycor <= ( 20 ) )
      [set pcolor red]                                ;; ... draws left edge in blue
    ;; if patches are between (75,10) to (75,20)...
    if ( pxcor = (75) and pycor >= (10) and pycor <= (20) )
      [set pcolor red]                                ;; ... draws right edge in blue
    ;; if patches are between (50,10) to (75,10)...
    if ( pycor = (10) and pxcor >= (50) and pxcor <= (75) )
      [set pcolor red]                                ;; ... draws bottom edge in blue
    ;; if patches are between (50,20) to (75,20)...
    if ( pycor = (20) and pxcor >= (50) and pxcor <= (75) )
      [set pcolor red]                                     ;; ... draws upper edge in pink
       ;; if patches are between (50,15) to (75,15)...
       if ( pycor = (15) and pxcor >= (50) and pxcor <= (75) )
      [set pcolor red]                                     ;; ... draws middle edge in pink 
      
    ]
  
    set-up-light-on-Parallel-circuit
    set-up-mafsek-on-Parallel-circuit
    set-up-battery-Parallel-circuit
    set-up-electron-Parallel-circuit
end 

to go-Parallel-circuit
  
  ask electrons-Pc
   
  [ ifelse
    pxcor >= 50   and pxcor <= 74 [ fd 0.5] 
      [ set heading 0 ]
     ]  
  
  ask electrons-Pc
     
   [ ifelse
    pycor >= 10   and pycor <= 20 [ fd 0.5] 
      [ set heading 0 ]
     ]
   
    
   
  ;  ask electrons-Pc
   
   ; [ ifelse
    ; pxcor    <= 34    and pxcor >= 10 [ bk 1] 
    ; [ set heading 360]
  ; ] 
end  
  
  


There is only one version of this model, created almost 13 years ago by soheir othman.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.