cinematica
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
breed [ corpo1 ] breed [ corpo2 ] globals [pos veloc acel pos2 veloc2 acel2 tempo dist] to setup clear-all ask patches [set pcolor white ] create-corpo1 1 [ setxy pos-ini 2 ] ask corpo1 [set shape "car"] ask corpo1 [set color blue ] ask corpo1 [set size 3 ] ask corpo1 [set pos pos-ini] ask corpo1 [set veloc veloc-ini] ask corpo1 [set acel acel-ini] create-corpo2 1 [ setxy pos-ini2 -2 ] ask corpo2 [set shape "car"] ask corpo2 [set color red ] ask corpo2 [set size 3 ] ask corpo2 [set pos2 pos-ini2] ask corpo2 [set veloc2 veloc-ini2] ask corpo2 [set acel2 acel-ini2] reset-ticks end to move-corpo1 ask corpo1 [set pos pos-ini + (veloc-ini * (tempo) +(acel * (tempo) * (tempo) / 2))] ask corpo1 [set veloc veloc-ini + (acel * (tempo))] ask corpo1 [ set xcor pos ] end to move-corpo2 ask corpo2 [set pos2 pos-ini2 + (veloc-ini2 * (tempo) +(acel2 * (tempo) * (tempo) / 2))] ask corpo2 [set veloc2 veloc-ini2 + (acel2 * (tempo))] ask corpo2 [set xcor pos2 ] ask corpo2 [ set dist (pos - pos2) ] ;if dist < 0 [set dist (dist * -1)] ask corpo2 [ if dist < 0 [set dist (dist * -1) ] ifelse encontro [ set dist (dist + 0.1) ] [ set dist (dist * -1) ] ] end to go set tempo (ticks / 10000) if tempo >= time [ stop ] move-corpo1 move-corpo2 if dist < 0.0002 [ user-message "Os corpos se encontraram na posição" user-message pos user-message "metros e no tempo" user-message tempo user-message "segundos" ] tick end
There is only one version of this model, created over 11 years ago by Alexandre Ramos.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
cinematica.png | preview | Preview for 'cinematica' | over 11 years ago, by Alexandre Ramos | Download |
This model does not have any ancestors.
This model does not have any descendants.