Skip to content

How to seed your test

Kristian Karl edited this page Mar 4, 2021 · 5 revisions

Seeding your test, means that the random number generator that GraphWalker is using, will start off with a seed, thus generating the same path even if you are using a random path generator.

This is how you seed your test:

Command line

Running GraphWalker from a terminal, you add the option --seed with a number, like:

java -jar graphwalker-cli-4.3.1.jar offline --seed 123456 -g test.json

Model file

In the GraphWalker json model file, add:

 "seed": <NUMBER>,

See also JSON file format

Java API

In your java code, you can set the seed:

SingletonRandomGenerator.setSeed(1349327921);

See also: MultipleContextTest.java#54 for an example.

Clone this wiki locally