RunTimeException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RunTimeException

Cenfei Sun

Hi all,

 

I am a beginner in Repast. I am building a very simple model with two objectives moving on specific path. When I try to run the model, I got the following error:

 

FATAL [Thread-7] 16:56:13,456 repast.simphony.ui.GUIScheduleRunner - RunTimeException when running the schedule

Current tick (1.0)

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

                at repast.simphony.engine.schedule.DynamicTargetAction.execute(DynamicTargetAction.java:72)

                at repast.simphony.engine.controller.ScheduledMethodControllerAction$ScheduleMethodAllAction.execute(ScheduledMethodControllerAction.java:333)

                at repast.simphony.engine.schedule.DefaultAction.execute(DefaultAction.java:38)

                at repast.simphony.engine.schedule.ScheduleGroup.executeList(ScheduleGroup.java:205)

                at repast.simphony.engine.schedule.ScheduleGroup.execute(ScheduleGroup.java:231)

                at repast.simphony.engine.schedule.Schedule.execute(Schedule.java:352)

                at repast.simphony.ui.GUIScheduleRunner$ScheduleLoopRunnable.run(GUIScheduleRunner.java:52)

                at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.reflect.InvocationTargetException

                at pathfinding.Lifter$$FastClassByCGLIB$$4d597e82.invoke(<generated>)

                at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)

                at repast.simphony.engine.schedule.DynamicTargetAction.execute(DynamicTargetAction.java:69)

                ... 7 more

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0

                ... 10 more

 

Can someone tell me how it comes?

 

Thanks,

 

Phyllis

 


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RunTimeException

srcnick
Is there more to the stack trace (the error you have below)? Typically some line in that will refer to a line in your code and you can check what is wrong by examining that line. 

The root cause is in the last “caused by” section. The error is saying that an array index is out of bounds which means that there something accessing an array at an index beyond the bounds of the array (e.g. there’s two elements in an array and you try to get the 3rd). In this case, the array index is 0, so something is trying to get an element from an empty array. Is there anything in your code that accesses arrays?

Nick

On Aug 30, 2016, at 6:11 PM, Cenfei Sun <[hidden email]> wrote:

Hi all,
 
I am a beginner in Repast. I am building a very simple model with two objectives moving on specific path. When I try to run the model, I got the following error:
 
FATAL [Thread-7] 16:56:13,456 repast.simphony.ui.GUIScheduleRunner - RunTimeException when running the schedule
Current tick (1.0)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
                at repast.simphony.engine.schedule.DynamicTargetAction.execute(DynamicTargetAction.java:72)
                at repast.simphony.engine.controller.ScheduledMethodControllerAction$ScheduleMethodAllAction.execute(ScheduledMethodControllerAction.java:333)
                at repast.simphony.engine.schedule.DefaultAction.execute(DefaultAction.java:38)
                at repast.simphony.engine.schedule.ScheduleGroup.executeList(ScheduleGroup.java:205)
                at repast.simphony.engine.schedule.ScheduleGroup.execute(ScheduleGroup.java:231)
                at repast.simphony.engine.schedule.Schedule.execute(Schedule.java:352)
                at repast.simphony.ui.GUIScheduleRunner$ScheduleLoopRunnable.run(GUIScheduleRunner.java:52)
                at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
                at pathfinding.Lifter$$FastClassByCGLIB$$4d597e82.invoke(<generated>)
                at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
                at repast.simphony.engine.schedule.DynamicTargetAction.execute(DynamicTargetAction.java:69)
                ... 7 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
                ... 10 more
 
Can someone tell me how it comes?
 
Thanks,
 
Phyllis
 
------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RunTimeException

srcnick
Does the agent move the entire path in a single timestep (perhaps within a single method call)? By default the display updates each timestep (tick) so if all the movement is within that tick then agent will appear not to move. If that’s the case, you’ll need to spread the movement out over multiple ticks. 

Nick

On Sep 1, 2016, at 4:57 PM, Cenfei Sun <[hidden email]> wrote:

Hi Nick,
 
I have fixed the error, but I have another question. It may be very basic, sorry for that.
My model contains two objectives. One is an agent moving on certain path. The path, for example, is from grid point(10,8) to grid point(10,20), then grid point(20,20). Then the agent will move back to grid point(10,8) through the same path. However, as I set the this as one step method, in the display, the agent shows no movement. I think that is because the starting point is the same as the ending point. Is there a way to show the whole moving path of the agent?
 
Thanks,
 
Phyllis
 
From: Nick Collier [[hidden email]] 
Sent: Wednesday, August 31, 2016 7:20 AM
To: Cenfei Sun <[hidden email]>
Cc: [hidden email]
Subject: Re: [Repast-interest] RunTimeException
 
Is there more to the stack trace (the error you have below)? Typically some line in that will refer to a line in your code and you can check what is wrong by examining that line. 
 
The root cause is in the last “caused by” section. The error is saying that an array index is out of bounds which means that there something accessing an array at an index beyond the bounds of the array (e.g. there’s two elements in an array and you try to get the 3rd). In this case, the array index is 0, so something is trying to get an element from an empty array. Is there anything in your code that accesses arrays?
 
Nick
 
On Aug 30, 2016, at 6:11 PM, Cenfei Sun <[hidden email]> wrote:
 
Hi all,
 
I am a beginner in Repast. I am building a very simple model with two objectives moving on specific path. When I try to run the model, I got the following error:
 
FATAL [Thread-7] 16:56:13,456 repast.simphony.ui.GUIScheduleRunner - RunTimeException when running the schedule
Current tick (1.0)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
                at repast.simphony.engine.schedule.DynamicTargetAction.execute(DynamicTargetAction.java:72)
                at repast.simphony.engine.controller.ScheduledMethodControllerAction$ScheduleMethodAllAction.execute(ScheduledMethodControllerAction.java:333)
                at repast.simphony.engine.schedule.DefaultAction.execute(DefaultAction.java:38)
                at repast.simphony.engine.schedule.ScheduleGroup.executeList(ScheduleGroup.java:205)
                at repast.simphony.engine.schedule.ScheduleGroup.execute(ScheduleGroup.java:231)
                at repast.simphony.engine.schedule.Schedule.execute(Schedule.java:352)
                at repast.simphony.ui.GUIScheduleRunner$ScheduleLoopRunnable.run(GUIScheduleRunner.java:52)
                at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
                at pathfinding.Lifter$$FastClassByCGLIB$$4d597e82.invoke(<generated>)
                at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
                at repast.simphony.engine.schedule.DynamicTargetAction.execute(DynamicTargetAction.java:69)
                ... 7 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
                ... 10 more
 
Can someone tell me how it comes?
 
Thanks,
 
Phyllis
 
------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...