Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
14.2.5
14.2.5
A way to understand the code is to simply read through it. But this is very hard indeed and it is recommended to inspect the code when it is running. That way, variables can be inspected and execution flow is directly visible.

...

Tip: to find classes (i.e. to get the GenericVictimSystemSimulation.java) do Ctrl+N.

Anchor
F309
F309
Figure 309: Code inspection - Setting breakpoints

SEAMCAT is launched in debug mode from Intellij. This is done by opening Seamcat.java and right-clicking on the class name. In the menu that appears choose ‘Debug ‘Seamcat.main()’. 

Anchor
F310
F310
Figure 310: Launch SEAMCAT in debug mode

...

The button panel below has different control buttons to handle the code flow: step over will go to the next line of code. Step into will go into the method on the line. This has to be tried a number of times before one masters this!

Anchor
F311
F311
Figure 311: Catching breakpoint

The callstack shows how we got here in the code (Figure 312). This is extremely valuable for inspecting who calls who during the simulation.  Here we see that we are coming from line 114 in GenericVictimSystemSimulation.java. This only apply during an active breakpoint i.e. When the code it temporary suspended.

Anchor
F312
F312
Figure 312: Callstack

 

The evaluate can be used to evaluate expression in the current code state. Here we take one of the variables eventResult and evaluates the expression eventResult.getDRSSResult(). This evaluates to the double value 0.0. This only applies when you have an active breakpoint.

Anchor
F313
F313
Figure 313: Expression evaluation

...