Home | Trees | Indices | Help |
|
---|
|
1 from teamwork.math.Keys import * 2 from teamwork.math.KeyedMatrix import * 3 from teamwork.math.probability import * 4 5 from teamwork.widgets.multiscale import * 6 7 import unittest 810 1436 ## self.assertAlmostEqual(self.dist[row],0.5,9) 37 38 39 if __name__ == '__main__': 40 unittest.main() 4116 # Set up distribution to display 17 self.feature = 'containerDanger' 18 self.key = StateKey({'entity':'Shipper','feature':self.feature}) 19 self.dist = Distribution() 20 row = KeyedVector({self.key:0.0}) 21 self.dist[row] = 0.9 22 row = KeyedVector({self.key:0.1}) 23 self.dist[row] = 0.1 24 # Set up Tk 25 self.root = Tk() 26 Pmw.initialise(self.root) 27 # Run widget 28 marginal = self.dist.getMarginal(self.key) 29 widget = DistributionScale(self.root,tag_text=self.feature, 30 distribution=marginal) 31 widget.pack(fill=X,expand=YES) 32 try: 33 self.root.mainloop() 34 except KeyboardInterrupt: 35 pass
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Aug 19 16:49:29 2009 | http://epydoc.sourceforge.net |