[Pybrainsim-activity] SF.net SVN: pybrainsim:[126] trunk/src/Connection.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-09-11 10:30:35
|
Revision: 126 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=126&view=rev Author: rgoj Date: 2009-09-11 10:30:28 +0000 (Fri, 11 Sep 2009) Log Message: ----------- * Connections can now have gain, with the default gain equal to 1. Modified Paths: -------------- trunk/src/Connection.py Modified: trunk/src/Connection.py =================================================================== --- trunk/src/Connection.py 2009-09-11 10:07:37 UTC (rev 125) +++ trunk/src/Connection.py 2009-09-11 10:30:28 UTC (rev 126) @@ -27,10 +27,11 @@ """ class Connection: - def __init__(self, name, head, sourceGenerator, targetGenerator): + def __init__(self, name, head, sourceGenerator, targetGenerator, gain = 1): self.name = name self.sourceGenerator = sourceGenerator self.targetGenerator = targetGenerator + self.gain = gain head.addConnection(self) def printInfo(self): @@ -46,4 +47,4 @@ return self.targetGenerator def runConnection(self, sourceGeneratorOutput): - self.targetGenerator.receiveInput(sourceGeneratorOutput) + self.targetGenerator.receiveInput(self.gain * sourceGeneratorOutput) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |