[Pybrainsim-activity] SF.net SVN: pybrainsim:[73] trunk/src/Head.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-03 17:56:35
|
Revision: 73 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=73&view=rev Author: rgoj Date: 2009-08-03 17:56:27 +0000 (Mon, 03 Aug 2009) Log Message: ----------- * Prepared a new method for checking which generator's output must a connection recieve in the runSimulation method, using the new getSource() method in the Connection class * Removed the old method Modified Paths: -------------- trunk/src/Head.py Modified: trunk/src/Head.py =================================================================== --- trunk/src/Head.py 2009-08-03 17:31:21 UTC (rev 72) +++ trunk/src/Head.py 2009-08-03 17:56:27 UTC (rev 73) @@ -96,26 +96,11 @@ # Sending the output of generators through connections for i in range(len(self.connectionList)): - # All the generator names are checked against names of the - # source generators of all the connections, to find which - # generator's output should be passed on to the connection. - # There must be a better way to do this... - sourceGeneratorIndex = 0 - for j in range(len(self.generatorList)): - if self.connectionList[i].getSourceName() == self.generatorList[j].getName(): - sourceGeneratorIndex = j - - # Perhaps this is a nicer method of doing the same thing as - # above... but leaving this here for further testing. Besides - # it breaks the encapsulation of the connection class - - # directly communicating with one of it's members... - sourceGeneratorIndex2 = self.generatorList.index(self.connectionList[i].sourceGenerator) - print("Established method: " + str(sourceGeneratorIndex) + ", new method: " + str(sourceGeneratorIndex2)) - + # Checking which generator's output must a connection recieve + sourceGeneratorIndex = self.generatorList.index(self.connectionList[i].getSource()) self.connectionList[i].runConnection(generatorOutput[sourceGeneratorIndex]) - # Passing the output of the generators through to the head model to - # get the recording + # Passing the output of the generators through to the head model recording = self.runHeadModel(generatorOutput, recording) return recording This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |