DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part...
Transcript of DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part...
![Page 1: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/1.jpg)
DRAKON Visual Language
Tutorial. Part 2:Interaction with the outside world,parallel algorithms and real time
![Page 2: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/2.jpg)
The extended set of DRAKON icons
Shelf
Input
Output
Parallel process
Pause, Synchronizer
Timer
![Page 3: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/3.jpg)
What can a “Shelf” icon do?
Put a value on the shelf
Send a command to the doer
Terminate the algorithm
![Page 4: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/4.jpg)
Put a value on the shelf
● Assign a new value to the property● Put a new value in the variable● Set or clear a flag
![Page 5: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/5.jpg)
Put a value on the shelf
Place the product of width and height in the “area” variable
Set the “Power ON” flag
![Page 6: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/6.jpg)
Shelf: send a command to the doer
![Page 7: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/7.jpg)
Shelf: terminate the algorithm
Example:● “Make a new version” algorithm invokes
“Development task” algorithm● “Development task” algorithm invokes
“Analyze dependencies” algorithm● This “Shelf” icon is executed inside “Analyze
dependencies” algorithm
What happens next?● “Analyze dependencies” terminates● “Development task” terminates● The control is returned to “Make a new
version”
![Page 8: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/8.jpg)
Interaction with the outside world
“Input” icon
“Output” icon
“Parallel process” icon
![Page 9: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/9.jpg)
Input Output Parallel process
![Page 10: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/10.jpg)
A keyword or a key phrase
The upper floor
Input Output Parallel process
![Page 11: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/11.jpg)
The details
The lower floor
Input Output Parallel process
![Page 12: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/12.jpg)
What does “Input” icon do?
● Receives information from external senders● Gets messages from a parallel process● Performs data input into the computer:
– Receives data from the user via keyboard and mouse
– Reads data from disk– Receives data from the network
![Page 13: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/13.jpg)
What does “Output” icon do?
● Sends information to external recipients● Sends messages to a parallel process● Performs data output from the computer :
– Shows data on the screen– Writes data to disk– Sends data over the network
![Page 14: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/14.jpg)
An example with “Input” and “Output”
![Page 15: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/15.jpg)
What is the difference between “Shelf” and “Output”?
Assigns a value to aninternal variable
Shelf
Gives an order to aninternal doer
Sends a message to anexternal process
Output
Sends information to anexternal recipient
![Page 16: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/16.jpg)
The commands that control parallel processes
Start Starts a parallel process
Stop Stops the parallel process forever
Suspend Suspends the parallel process
Resume Resumes the suspended process
![Page 17: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/17.jpg)
Controlling a parallel process
![Page 18: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/18.jpg)
Commands sent to a parallel processdo not suspend the main process
Main process
Parallel process
Start Stop
![Page 19: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/19.jpg)
Internal parallel processes
This double horizontal line starts a parallel skewer
![Page 20: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/20.jpg)
Internal parallel processesThe parallel skewer executes simultaneously with the main skewer
![Page 21: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/21.jpg)
Internal parallel processes
This horizontal line stops the parallel skewer
![Page 22: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/22.jpg)
Wrong! The main skewer must not be broken
![Page 23: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/23.jpg)
The following actions can be done in any order after the field of operations is prepared:● Extend electric power
line● Purchase wires● Install windows● Finish roof● Purchase water pipes
The assembling of the electric panel cannot be started before the installing of windows and finishing the roof are complete.
A complex parallel algorithm
![Page 24: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/24.jpg)
Adds a delay between two operators
Pause
![Page 25: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/25.jpg)
Timer “T” starts
Timer and synchronizer
![Page 26: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/26.jpg)
This operator executes when the specified time has passed since the start of timer “T”.(0.3 of period of revolution of crankshaft)
Timer and synchronizer
![Page 27: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/27.jpg)
What is the difference between “Pause” and “Synchronizer”?
Runs the next operatorafter some time has passedsince the previous operator
Pause
No need for a timer
Runs the operator aftersome time has passed
since the timer start
Synchronizer
The timer must be started
![Page 28: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/28.jpg)
“Wait” loop
A “Wait” loop sleeps between iterations
![Page 29: DRAKON Visual Language › files › drakon_part2_eng.pdf · DRAKON Visual Language Tutorial. Part 2: Interaction with the outside world, parallel algorithms and real time](https://reader033.fdocuments.us/reader033/viewer/2022052518/5f04d8a67e708231d4100054/html5/thumbnails/29.jpg)
Stepan Mitkin
The diagrams on the slides were made with DRAKON Editor
http://drakon-editor.sourceforge.net/
June 2013
End