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. --- ...SmootLight.behaviors.RunningBehavior-pysrc.html | 142 +++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 html/SmootLight.behaviors.RunningBehavior-pysrc.html (limited to 'html/SmootLight.behaviors.RunningBehavior-pysrc.html') diff --git a/html/SmootLight.behaviors.RunningBehavior-pysrc.html b/html/SmootLight.behaviors.RunningBehavior-pysrc.html new file mode 100644 index 0000000..80e3bca --- /dev/null +++ b/html/SmootLight.behaviors.RunningBehavior-pysrc.html @@ -0,0 +1,142 @@ + + + + + SmootLight.behaviors.RunningBehavior + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package behaviors :: + Module RunningBehavior + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.behaviors.RunningBehavior

+
+ 1  from operationscore.Behavior import * 
+ 2  import util.ComponentRegistry as compReg 
+ 3  import util.Geo as Geo 
+ 4  import pdb 
+
5 -class RunningBehavior(Behavior): +
6 """RunningBehavior is a straightforward behavior that makes a Location run back and forth across + 7 a screen. Specify: + 8 <StepSize> -- the length of movment in units when the response moves. + 9 """ +10 +
11 - def processResponse(self, sensorInputs, recursiveInputs): +
12 newResponses = sensorInputs +13 ret = [] +14 ret += newResponses +15 for recurInput in recursiveInputs: +16 outDict = dict(recurInput) +17 if not 'Dir' in outDict: +18 outDict['Dir'] = 1 #to the right +19 if not 'StepSize' in outDict: +20 outDict['StepSize'] = self['StepSize'] +21 outDict['Location']= Geo.addLocations(outDict['Location'], +22 (outDict['StepSize']*outDict['Dir'],0)) +23 +24 if not Geo.pointWithinBoundingBox(outDict['Location'], \ +25 compReg.getComponent('Screen').getSize()): +26 outDict['Dir'] *= -1 +27 ret.append(outDict) +28 ret += newResponses +29 return (ret, ret) +
30 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3