From: Douglas N. <pet...@gm...> - 2009-07-29 18:12:33
|
I tried this, but still the same. Repast stars counting at time step 0, that value says only the begining step of recorder. Anybody has other idea? --- Doug 2009/7/29 Mira Kattwinkel <mir...@uf...> > HI, > > have you tried > schedule.scheduleActionBeginning(1, new BasicAction()... > instead of > schedule.scheduleActionBeginning(0, new BasicAction()... > > I think Repast starts counting at time step 1. Maybe that's the reason, > although I don't know exactly why. > > Cheers, > Mira > > Douglas Nogueira schrieb: > >> I'm trying to do this: >> >> public double getNumAgentsX() { >> return numAgentsX >> } >> >> public void buildSchedule(){ >> schedule.scheduleActionBeginning(0, new BasicAction() { >> public void execute() { >> recorder.record(); >> } >> }); >> schedule.scheduleActionAtEnd(recorder, "writeToFile"); >> } >> >> public void buildModel() { >> recorder = new DataRecorder("./data.txt", this); >> recorder.createNumericDataSource("numAgentsX", this, >> "getNumAgentsX"); >> ... >> } >> >> It has to record the variable numAgentsX each step. >> It record zero, the value that is in the setup(), not the value along the >> simulation that changes in method step(). >> Im using RepastJ 3. >> Does anybody know what im doing wrong? >> >> --- >> Doug >> >> >> ------------------------------------------------------------------------ >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day trial. Simplify your report design, integration and deployment - and >> focus on what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Repast-interest mailing list >> Rep...@li... >> https://lists.sourceforge.net/lists/listinfo/repast-interest >> > > -- > _______________________________________________________________ > > Mira Kattwinkel, Dipl.-Geoecologist > Deptartment of System Ecotoxicology > Helmholtz Centre for Environmental Research - UFZ > Permoserstrasse 15, D-04318 Leipzig, Germany > phone: +49 341 235 -1497 > fax: +49 341 235 45 1578 > url: http://www.ufz.de/index.php?en=2122 > _______________________________________________________________ > > Registered Office: Leipzig > Registration Office: Amtsgericht Leipzig > Trade Register Nr. B 4703 > Chairman of the Supervisory Board: MinDirig Hartmut F. Grübel > Scientific Director: Prof. Dr. Georg Teutsch > Administrative Director: Dr. Andreas Schmidt > |