[Home]History of AdamBurke

HomePage | RecentChanges | Preferences


Revision 2 . . August 3, 2003 6:35 pm by 213.78.81.xxx [freeloader note]
  

Difference (from prior major revision) (no other diffs)

Added: 1a2,34




Freeloader


#! /usr/bin/python

# economic agent, resources in RRMaps

from Agent import Agent
from RRMap import RRMap

class FreeLoaderAgent(Agent) :

def type(self) :
return "FreeLoaderAgent"

def oneStep(self) :
if self.alive == 1 :
for r in self.resources.values() :
r.oneStep()

def addResource(self, name, needRange, rgcRange, rcrRange) :
r = RRMap(name)
r.randomize(needRange,rgcRange,rcrRange)
r.rgc = 0
self.addRRMap(r)


I guess I should have subclassed RRMap instead of this hack :>

Breaks Table.py a bit at the moment ... Freeloaders are important for invalids etc, I suspect some of these environments are a bit too easy to survive in. Even if rgcRange << rcrRange a few Agents will manage to survive because the randomized result will have rgc > rcr.

Software error:

Can't locate object method "startform" via package "CGI" at optimaes.cgi line 1479.

For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.