From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- html/SmootLight.behaviors.RandomWalk-pysrc.html | 132 ++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 html/SmootLight.behaviors.RandomWalk-pysrc.html (limited to 'html/SmootLight.behaviors.RandomWalk-pysrc.html') diff --git a/html/SmootLight.behaviors.RandomWalk-pysrc.html b/html/SmootLight.behaviors.RandomWalk-pysrc.html new file mode 100644 index 0000000..625710b --- /dev/null +++ b/html/SmootLight.behaviors.RandomWalk-pysrc.html @@ -0,0 +1,132 @@ + + + + + SmootLight.behaviors.RandomWalk + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package behaviors :: + Module RandomWalk + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.behaviors.RandomWalk

+
+ 1  from operationscore.Behavior import * 
+ 2  import util.ComponentRegistry as compReg 
+ 3  import util.Geo as Geo 
+ 4  import util.Strings as Strings 
+ 5  import random 
+ 6  import pdb 
+
7 -class RandomWalk(Behavior): +
8 """Behavior to move the curent location by a random distance specified by + 9 <StepSize> -- StepSize in units/response""" +10 +
11 - def processResponse(self, sensors, recursives): +
12 ret = [] +13 s = self['StepSize'] +14 for sensory in sensors: +15 step = [random.randint(-s,s), random.randint(-s,s)] +16 outdict = dict(sensory) +17 outdict[Strings.LOCATION] = Geo.addLocations(step, outdict[Strings.LOCATION]) +18 ret.append(outdict) +19 return (ret,recursives) +
20 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3