Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/main/java/org/simulator/sbml/EquationSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
import java.util.logging.Level;
Expand Down Expand Up @@ -110,6 +111,11 @@ public abstract class EquationSystem
* Holds the current time of the simulation
*/
protected double currentTime;
/**
* A random number generator used for stochastic decisions (e.g., picking events).
* It is instantiated once so that the simulation can be seeded.
*/
protected Random randomGenerator = new Random(12345L);

/**
* This array stores for every event an object of {@link SBMLEventInProgress} that is used to
Expand Down Expand Up @@ -1850,7 +1856,7 @@ public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
* @param highOrderEvents
*/
protected void pickRandomEvent(List<Integer> highOrderEvents) {
int randomIndex = ThreadLocalRandom.current().nextInt(highOrderEvents.size());
int randomIndex = randomGenerator.nextInt(highOrderEvents.size());
Integer winner = highOrderEvents.get(randomIndex);
highOrderEvents.clear();
highOrderEvents.add(winner);
Expand Down
9 changes: 2 additions & 7 deletions src/test/java/org/simulator/sbml/SBMLTestSuiteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* Run full sbml-test-suite
*/
@RunWith(value = Parameterized.class)
@RunWith(Parameterized.class)
public class SBMLTestSuiteTest {

private String path;
Expand All @@ -53,11 +53,8 @@ public SBMLTestSuiteTest(String path) {
@Parameters(name = "{index}: {0}")
public static Iterable<Object[]> data() {

// environment variable for semantic test case folder
String testsuite_path = TestUtils.getPathForTestResource(
File.separator + "sbml-test-suite" + File.separator + "cases" + File.separator + "semantic"
+ File.separator);
System.out.println(SBML_TEST_SUITE_PATH + ": " + testsuite_path);
File.separator + "sbml-test-suite" + File.separator + "cases" + File.separator + "semantic" + File.separator);

if (testsuite_path.length() == 0) {
Object[][] resources = new String[0][1];
Expand Down Expand Up @@ -108,8 +105,6 @@ public void testModel() throws IOException {
"01165", "01167", "01168", "01471", "01472", "01473", "01475", "01476", "01477", "01778",
// sbml model with changing compartment size (see issue #50)
"01507", "01508", "01511",
// failing due to long run time (see issue #39)
"01287", "01592",
// failing due to delay in rateOf (see issue #46)
"01400", "01401", "01403", "01406", "01409",
// failing due to event triggers before mentioned condition (see issue #44)
Expand Down