Changes for page Simulation (KiSim)
Last modified by Richard Kreissig on 2023/09/14 11:07
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -171,7 +171,7 @@ 171 171 String, the shell command that is used to start the process 172 172 )))|(% colspan="1" %)(% colspan="1" %) 173 173 ((( 174 -python -i"${executable_path}"174 +python "${executable_path}" 175 175 )))|(% colspan="1" %)(% colspan="1" %) 176 176 ((( 177 177 The shell command to start the executable ... ... @@ -701,30 +701,4 @@ 701 701 702 702 === Python Example === 703 703 704 -The following shows a tiny python script, that will write a Data Pool containing an output variable x to stdout. 705 - 706 -{{code title="prog.py"}} 707 -import sys 708 - 709 -x = 0 710 -while True: 711 - json = """{"x":{"value":""" + str(x) + ""","interface":2}}""" 712 - print(json) # Send output to simulation 713 - raw_input("") # Wait for input from simulation 714 - x = x + 1 715 - 716 - 717 -{{/code}} 718 - 719 -This script can be executed from within KIELER to start a simulation because it uses the JSON communication on stdin and stdout. Note however that the input coming from the simulation is not handled in the script. An example kisim configuration to start such a scipt is given below. 720 - 721 -{{code}} 722 -configure sim A { 723 - executable: prog.py 724 - command: "python -i ${executable_path}" 725 -} 726 - 727 -execution { 728 - write sim A 729 -} 730 -{{/code}} 704 +\\
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -3326010 61 +33260105 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/3326010 6/V2 Simulation1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/33260105/V2 Simulation