WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: How to record an array from an agent method?

How to record an array from an agent method?

by Vlad Chiriacescu :: Rate this Message:

| View in Thread

  Hello everyone,

  I need your help with an older version of Repast (the U. Chicago one, before Synchrony).

  I am using a DataRecorder object in order to record some values.

  I do something like this:
  In setup() method, recorder = null (init)
 
  In buildModel(), I do this:
  recorder = new DataRecorder("./Data/Data.csv", this);
  recorder.createNumericDataSource("# Avg confusion", this, "getAvgAgentConfusion");

  When getAvgAgentConfusion method returns a double everything is fine.

  However, I want to change this method to return a double array with the metric (called 'confusion') of each agent.

  If I use the code above, I get the following exception:
  uchicago.src.codegen.GeneratorException: Method getAvgAgentConfusion() must return a number at uchicago.src.sim.util.ByteCodeBuilder.getMethodRetDouble(Unknown Source)
  ...
  at java.lang.Thread.run(Thread.java:662)

  Do you know if there is any way to return and record an array?

  Thanks a lot,
 
  Vlad

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Repast-interest mailing list
Repast-interest@...
https://lists.sourceforge.net/lists/listinfo/repast-interest

 « Return to Thread: How to record an array from an agent method?