From: Önder G. <ond...@gm...> - 2012-05-02 08:33:22
|
Hello again, I think I fixed the problem for now. I changed the function as follows: public void runInitialize() { DefaultParameters defaultParameters = new DefaultParameters(); defaultParameters.addParameter("randomSeed", "randomSeed", Number.class, 1, true); controller.runInitialize(defaultParameters); schedule = RunState.getInstance().getScheduleRegistry() .getModelSchedule(); } However, I wonder if there is another way to handle this problem? And I also want to ask what should be the default value for "randomSeed" parameter? Best, Önder. On Wed, May 2, 2012 at 10:17 AM, Önder Gürcan <ond...@gm...>wrote: > Hello, > > I am using Repast since 2 years and I am purely programmatically running > my simulations. > > I have a runner class extended from AbstractRunner and I have this > initialization method: > > public void runInitialize() { > controller.runInitialize(null); > schedule = RunState.getInstance().getScheduleRegistry() > .getModelSchedule(); > } > > I just installed the newest version of Repast and now I getting a null > pointer exception (with the previous version I was not getting this > exception) in the first line of this method as follows: > > java.lang.NullPointerException > at > repast.simphony.data2.AbstractDataSetManager.runStarted(AbstractDataSetManager.java:202) > at > repast.simphony.data2.BatchRunDataSetManager.runStarted(BatchRunDataSetManager.java:40) > at > repast.simphony.data2.engine.DataInitActionCreator$1.runInitialize(DataInitActionCreator.java:61) > at > repast.simphony.engine.controller.DefaultController$2.visit(DefaultController.java:207) > at > repast.simphony.engine.controller.DefaultController$2.visit(DefaultController.java:1) > at > repast.simphony.util.collections.NaryTree.preOrderTraverals(NaryTree.java:287) > at > repast.simphony.util.collections.NaryTree.preOrderTraverals(NaryTree.java:290) > at > repast.simphony.util.collections.NaryTree.preOrderTraversal(NaryTree.java:283) > at > repast.simphony.engine.controller.DefaultController.runInitialize(DefaultController.java:205) > at > repast.simphony.engine.controller.DefaultController.runInitialize(DefaultController.java:376) > at rast.RepastRunner.runInitialize(RepastRunner.java:60) > at > rast.AbstractScenarioExecuter.initialize(AbstractScenarioExecuter.java:65) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at > org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122) > at > org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86) > at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) > at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) > at > org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) > at > org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) > at > org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) > at > org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) > at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) > at > org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) > at > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) > > Do you know how can I tackle this problem?? > > Best regards, > > Önder Gürcan > |