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

Source Code for Module SmootLight.behaviors.SmootWind

+
+ 1  from operationscore.Behavior import * 
+ 2  import util.ComponentRegistry as compReg 
+ 3  import random 
+ 4  
 
+
5 -class SmootWind(Behavior): +
6 - def behaviorInit(self): +
7 self.mapper = None + 8 self.xFor = None +
9 +
10 - def processResponse(self, sensorInputs, recursiveInputs): +
11 if self.mapper == None: +12 try: +13 self.mapper = compReg.getComponent('windgaussmap') +14 except KeyError: +15 pass +16 if self.xFor == None: +17 try: +18 self.xFor = compReg.getComponent('xfor') +19 except KeyError: +20 pass +21 +22 for sensory in sensorInputs: +23 print sensory +24 # input[0] is windspeed, [1] is dir +25 if 0 in sensory and 1 in sensory: +26 windSpeed = sensory[0] +27 windDir = sensory[1] +28 #print self.mapper.argDict +29 self.mapper.argDict['Width'] = self.mapper.argDict['Width']+float(windSpeed)*2+20 +30 self.xFor.argDict['ParamOp'] = self.xFor.argDict['ParamOp']+float(windSpeed)*3+10*random.random(); +31 #print 'Width: ' + str(self.mapper.argDict['Width']) +32 #print 'xFor: ' + str(self.xFor.argDict['ParamOp']) +33 +34 elif 'Key' in sensory: +35 if sensory['Key'] == 273: +36 self.mapper.argDict['Width'] = self.mapper.argDict['Width']+10; +37 self.xFor.argDict['ParamOp'] = self.xFor.argDict['ParamOp']+5; +38 +39 elif sensory['Key'] == 274: +40 self.mapper.argDict['Width'] = self.mapper.argDict['Width']-10; +41 self.xFor.argDict['ParamOp'] = self.xFor.argDict['ParamOp']-5; +42 +43 return (sensorInputs, recursiveInputs) +
44 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3