Spoken to fast, I still have the exception...

Le mercredi 26 mars 2014 14:11:09 UTC+1, Chris Coat a écrit :
>
> Did a mistake for passing Integer to Double, a simple cast did it. No 
> error for know, hope I'll work. Thanks.
>
> Le mercredi 26 mars 2014 13:04:56 UTC+1, Chris Coat a écrit :
>>
>> changed the code to that : 
>> public  static class ObjectList extends DefaultReporter
>> {
>> public Syntax getSyntax() {
>> return Syntax.reporterSyntax
>> (new int[]{}, Syntax.ListType());
>> }
>>
>> public String getAgentClassString() { return "OTPL"; }
>>
>> public synchronized Object report(Argument args[], Context context)
>> throws ExtensionException, LogoException {
>> ArrayList<Integer> test = new ArrayList<Integer> 
>> (manager.getObjectInput().keySet());
>> LogoListBuilder list = new LogoListBuilder();
>> for (Integer i : test)
>> {
>> list.add(Double.valueOf(i));
>> }
>> return list.toLogoList();
>> }
>> }
>>
>>
>>
>> Still got this exception : 
>> error (RuntimeException)
>>  while observer running ASK
>>   called by procedure COLLECT-TUIOEVENTS (C:\Users\Coat\Desktop\Demo 
>> 26-03-14\circulation\tuio-input.nls)
>>   called by procedure GO
>>   called by Button 'go'
>>
>> NetLogo is unable to supply you with more details about this error. 
>>  Please report the problem
>> at https://github.com/NetLogo/NetLogo/issues, or to 
>> [email protected], and paste the
>> contents of this window into your report.
>>
>> java.lang.RuntimeException: java.lang.Integer: 0
>>  at scala.sys.package$.error(package.scala:27)
>>  at org.nlogo.api.Dump$.logoObject(Dump.scala:43)
>>  at org.nlogo.api.Dump.logoObject(Dump.scala)
>>  at 
>> org.nlogo.nvm.ArgumentTypeException.getMessage(ArgumentTypeException.java:47)
>>  at 
>> org.nlogo.nvm.StackTraceBuilder$$anonfun$1.apply(StackTraceBuilder.scala:35)
>>  at 
>> org.nlogo.nvm.StackTraceBuilder$$anonfun$1.apply(StackTraceBuilder.scala:33)
>>  at scala.Option.map(Option.scala:133)
>>  at org.nlogo.nvm.StackTraceBuilder$.build(StackTraceBuilder.scala:33)
>>  at org.nlogo.nvm.StackTraceBuilder.build(StackTraceBuilder.scala)
>>  at org.nlogo.nvm.Context.buildRuntimeErrorMessage(Context.java:349)
>>  at 
>> org.nlogo.nvm.EngineException.fillInStackTrace(EngineException.java:83)
>>  at org.nlogo.nvm.CommandTask.perform(Task.scala:87)
>>  at org.nlogo.prim.etc._foreach.perform(_foreach.scala:36)
>>  at org.nlogo.nvm.Context.stepConcurrent(Context.java:91)
>>  at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.java:82)
>>  at org.nlogo.job.JobThread.org
>> $nlogo$job$JobThread$$runPrimaryJobs(JobThread.scala:143)
>>  at 
>> org.nlogo.job.JobThread$$anonfun$run$1.apply$mcV$sp(JobThread.scala:78)
>>  at org.nlogo.job.JobThread$$anonfun$run$1.apply(JobThread.scala:76)
>>  at org.nlogo.job.JobThread$$anonfun$run$1.apply(JobThread.scala:76)
>>  at scala.util.control.Exception$Catch.apply(Exception.scala:88)
>>  at org.nlogo.util.Exceptions$.handling(Exceptions.scala:41)
>>  at org.nlogo.job.JobThread.run(JobThread.scala:75)
>>
>> NetLogo 5.0.5
>> main: org.nlogo.app.AppFrame
>> thread: JobThread
>> Java HotSpot(TM) Server VM 1.6.0_45 (Sun Microsystems Inc.; 1.6.0_45-b06)
>> operating system: Windows 7 6.1 (x86 processor)
>> Scala version 2.9.2
>> JOGL: (3D View not initialized)
>> OpenGL Graphics: (3D View not initialized)
>> model: model
>>
>> 01:11:26.717 SwitchedTabsEvent (org.nlogo.app.Tabs) AWT-EventQueue-0
>> 01:11:26.702 RuntimeErrorEvent (org.nlogo.app.App$$anon$1 
>> (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
>> 01:11:26.702 InterfaceGlobalEvent (org.nlogo.app.InterfacePanel$2 
>> (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
>> 01:11:26.702 InterfaceGlobalEvent (org.nlogo.app.InterfacePanel$2 
>> (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
>> 01:11:26.702 InterfaceGlobalEvent (org.nlogo.app.InterfacePanel$2 
>> (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
>> 01:11:26.702 InterfaceGlobalEvent (org.nlogo.app.InterfacePanel$2 
>> (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
>> 01:11:26.702 InterfaceGlobalEvent (org.nlogo.app.InterfacePanel$2 
>> (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
>> 01:11:26.702 InterfaceGlobalEvent (org.nlogo.widget.SwitchWidget) 
>> AWT-EventQueue-0
>> 01:11:26.702 InterfaceGlobalEvent (org.nlogo.window.ChooserWidget) 
>> AWT-EventQueue-0
>> 01:11:26.702 InterfaceGlobalEvent (org.nlogo.widget.SwitchWidget) 
>> AWT-EventQueue-0
>>
>>
>> Le mercredi 26 mars 2014 09:38:13 UTC+1, Chris Coat a écrit :
>>>
>>> I didn't know about the Integer thing, I'll change it right away thanks.
>>>
>>> Here is the Exception Code : 
>>> error (RuntimeException)
>>>  while observer running 
>>> _asm_procedurecollecttuioeventscuserscoatdesktopdemo260314circulationtuioinputnls_setprocedurevariable_2
>>>   called by procedure COLLECT-TUIOEVENTS (C:\Users\Coat\Desktop\Demo 
>>> 26-03-14\circulation\tuio-input.nls)
>>>   called by procedure GO
>>>   called by Button 'go'
>>>
>>> NetLogo is unable to supply you with more details about this error. 
>>>  Please report the problem
>>> at https://github.com/NetLogo/NetLogo/issues, or to 
>>> [email protected], and paste the
>>> contents of this window into your report.
>>>
>>> java.lang.RuntimeException: java.lang.Integer: 0
>>>  at scala.sys.package$.error(package.scala:27)
>>>  at org.nlogo.api.Dump$.logoObject(Dump.scala:43)
>>>  at org.nlogo.api.Dump$.logoObject(Dump.scala:31)
>>>  at org.nlogo.api.Dump.logoObject(Dump.scala)
>>>  at org.nlogo.nvm.Argument.getExceptionMessage(Argument.java:192)
>>>  at org.nlogo.nvm.Argument.getIntValue(Argument.java:99)
>>>  at SocketExtension$getTouchCoordX.report(SocketExtension.java:398)
>>>  at org.nlogo.prim._externreport.report(_externreport.java:50)
>>>  at org.nlogo.nvm.Instruction.argEvalString(Instruction.java:443)
>>>  at org.nlogo.prim.etc._readfromstring.report(_readfromstring.java:25)
>>>  at 
>>> org.nlogo.prim._asm_procedurecollecttuioeventscuserscoatdesktopdemo260314circulationtuioinputnls_setprocedurevariable_2.perform()
>>>  at org.nlogo.nvm.Context.stepConcurrent(Context.java:91)
>>>  at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.java:82)
>>>  at org.nlogo.job.JobThread.org
>>> $nlogo$job$JobThread$$runPrimaryJobs(JobThread.scala:143)
>>>  at 
>>> org.nlogo.job.JobThread$$anonfun$run$1.apply$mcV$sp(JobThread.scala:78)
>>>  at org.nlogo.job.JobThread$$anonfun$run$1.apply(JobThread.scala:76)
>>>  at org.nlogo.job.JobThread$$anonfun$run$1.apply(JobThread.scala:76)
>>>  at scala.util.control.Exception$Catch.apply(Exception.scala:88)
>>>  at org.nlogo.util.Exceptions$.handling(Exceptions.scala:41)
>>>  at org.nlogo.job.JobThread.run(JobThread.scala:75)
>>>
>>>
>>> Le mardi 25 mars 2014 16:50:10 UTC+1, Seth Tisue a écrit :
>>>>
>>>> >>>>> "Chris" == Chris Coat <[email protected]> writes: 
>>>>
>>>>  Chris> public synchronized Object report(Argument args[], Context 
>>>>  Chris> context) throws ExtensionException, LogoException { 
>>>> Set<Integer> 
>>>>  Chris> keyset = manager.getObjectInput().keySet(); return 
>>>>  Chris> LogoList.fromJava(keyset); } } 
>>>>
>>>> I'm not sure if it's where your exception is coming from, but one 
>>>> problem I see with this code is that NetLogo uses only java.lang.Double 
>>>> to represent numbers, never java.lang.Integer. 
>>>>
>>>> -- 
>>>> Seth Tisue | Northwestern University | http://tisue.net 
>>>> developer, NetLogo: http://ccl.northwestern.edu/netlogo/ 
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to