Uniform linear motion

Uniform linear motion preview image

1 collaborator

Default-person Hrvoje Mladinić (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.2 • Viewed 303 times • Downloaded 18 times • Run 0 times
Download the 'Uniform linear motion' 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

turtles-own 
[d_x]

globals
[s v B d_t]

to setup
  clear-all
  setup-cestica
  setup-pozadina
  reset-ticks
end 

to setup-pozadina
   ask patches
   [
     set pcolor white
   ]
   set B random 15
   ask patch -10 0 
   [
     set pcolor grey
     set plabel "A"  
   ]
   ask patch B 0 
   [
     set pcolor grey
     set plabel "B"
   ]
end 

to setup-cestica
    create-turtles 1
    ask turtle 0 
    [
    set color red
    setxy -10 0
    set heading 90
    set shape "car" 
    if path? 
    [
      pen-down
    ]
    ]
end 

to go
  ask turtle 0 
  [
  ifelse xcor <= B
  [
  unos
  izracun
  ]
  
  [ 
  set v 0
  ]
  ]
  tick
end 

to unos
    set v speed
    set d_t 0.001
end 

to izracun 
  set d_x (v * d_t)
  set xcor (xcor + d_x) 
  set s (s + d_x)
end 



  
  

There is only one version of this model, created about 11 years ago by Hrvoje Mladinić.

Attached files

File Type Description Last updated
Uniform linear motion.png preview Preview for 'Uniform linear motion' about 11 years ago, by Hrvoje Mladinić Download

This model does not have any ancestors.

This model does not have any descendants.