Menu

#1 Fixes bugs in Sugarscape chapter IV examples

open
nobody
None
5
2011-06-27
2011-06-27
No

Patch of sugarscape example files to fix Null Pointer exception in the GAS Chapter IV examples.

Subversion-generated patch relative to revision 438 (5.6.1 release), in directory org.ascape.models.brook/src/edu/brook/sugarscape

Moves the StatCollector code from SpiceAgent.scapeCreated() and SpiceCell.scapeCreated() to GAS_SpiceBase.createScape().

Discussion

  • Jonathan Gilligan

    Sugarscape patch, updated 2011 06 28

     
  • Jonathan Gilligan

    Updated the patch file. I discovered some more problems: The TradeT and TradeT3 classes didn't record the trades in the StatCollectors, so I fixed that.

    Also, GAS_IV_d, GAS_IV_e, and GAS_IV_i didn't call super.createScape() so it was necessary to paste the StatCollector business from GAS_SpiceBase.createScape() into them. In the long run, it would be nice to refactor that StatCollector creation and attachment because maintaining four instances of duplicated code would be a headache, but since this is example code, not core code for the package, that's probably not worth the work.

    Also, the new patch file is relative to the root directory of the ASCAPE package, not org.ascape.models.brook/edu/brook/sugarscape the way the older patch file was.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.