Skip to main content
. 2010 Sep 15;10(9):8585–8603. doi: 10.3390/s100908585

Listing 3.

Modified simulation, version 2.

1 import jtt.*; // Import the JTT package
2 public class MyProcess {
3   // Initialize the process
4   public MyProcess ( ) {
5     // Sets reflection
6     RTenv.setReflectionContext (this);
7     . . .
8     // create a task
9     . . .
10     // add code to a task
11     task.addCode (“mycode”);
12     // create kernel and add it the tasks
13     . . .
14   }
15   . . .
16   // code of a task
17   public void mycode ( ) {
18     // code of the first segment
19     . . .
20     RTenv.endSegment (0.3); // execution time
21     . . .
22     // code of the last segment
23     . . .
24     RTenv.endSegment (0.1); // execution time
25   }
26 } // end of class