Jednoliko pravocrtno gibabanje s vise automobila
No preview image
Model was written in NetLogo 5.0.2
•
Viewed 174 times
•
Downloaded 51 times
•
Run 0 times
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 [automobili automobil] turtles-own [d_x] automobili-own [v_a] globals [s v B d_t a_d_x a_s] to setup clear-all setup-cestica setup-pozadina reset-ticks end to setup-pozadina set B random 30 ask patch 0 0 [ set pcolor white set plabel "A" set plabel-color red ] ask patch B 0 [ set pcolor white set plabel "B" set plabel-color red ] end to setup-cestica ifelse (vise_automobila?) [ create-automobili 8 ask automobili [ setxy 0 who set color (2 * who + 1) * 5 set shape "car" set heading 90 set v_a random 200 if putanja? [ pen-down ] ] ] [ create-turtles 1 ask turtle 0 [ set color red setxy 0 0 set heading 90 set shape "car" if putanja? [ pen-down ] ] ] end to go ifelse (vise_automobila?) [ ask automobili [ ifelse xcor <= B [ automobili-unos automobili-izracun ] [ set v_a 0 ] ] ] [ ask turtle 0 [ ifelse xcor <= B [ unos izra_un ] [ set v 0 ] ] ] tick end to unos set v brzina set d_t 0.001 end to izra_un set d_x (v * d_t) set xcor (xcor + d_x) set s (s + d_x) end to automobili-unos set d_t 0.001 end to automobili-izracun set a_d_x (v_a * d_t) set xcor (xcor + a_d_x) end
There are 4 versions of this model.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.