X hits on this document

61 views

0 shares

0 downloads

0 comments

7 / 30

if (self.getNumOutEdges()):

otherAgent = (TutorialThreeAgent)self.getRandomNodeOut()

otherWealth = otherAgent.getWealth()

if (otherWealth > self.wealth and otherWealth > 2):

self.wealth = self.wealth + 2

otherAgent.setWealth(otherWealth - 2)

else:

self.removeEdgesTo(otherAgent)

otherAgent.removeEdgesFrom(self)

self.makeRandomOutEdge(self.model.getAgentList(), DefaultDrawableEdge(), false)

else:

self.makeRandomOutEdge(self.model.getAgentList(), DefaultDrawableEdge(), false)

self.setNodeLabel(String.valueOf(self.wealth))

Figure 2: RepastPy agent actions behavior using Python scripting

Document info
Document views61
Page views61
Page last viewedMon Dec 05 19:04:37 UTC 2016
Pages30
Paragraphs495
Words6732

Comments