Ask your own question, for FREE!
MIT 6.01SC Introduction to Electrical Engineering and Computer Science I 15 Online
OpenStudy (anonymous):

Anybody know why the Cascade class has a method startState(self) that overrides the SM class variable startState? And why this is required for a Feedback machine that uses a Cascade machine? I find if I remove the assignment of the Cascade's startState method to the Feedback instance's startState variable - the Feedback machine won't work (for a simple counter - INCR->DELAY). WHY?

OpenStudy (anonymous):

def __init__(self, sm): self.m = sm #self.startState = self.m.startState print 'Feedback startState = ' + str(self.m.startState) Above is the Feedback's __init__ method. If I comment out the line as in the above, what does that change? Specifically when sm is a Cascade machine.

OpenStudy (anonymous):

ignore the print statement that was just my debugging (actually what was printed was a memory address to the location of the method Cascade.startState)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!