Monday, 26 August 2013

Adding GUI in tkinter to a simpy simulation

Adding GUI in tkinter to a simpy simulation References I have a problem with implementing some GUI into my simpy simulation. The problem is how to add GUI, preferably made in Tkinter, to a simpy project. Wright now I have even problem with creating a window. I think that it\'s becouse when simulation stops running I can\'t exetue Tkinter code.. I know that this is a very general question, but I don\'t know how to start. What I want to do with Tkinter is to draw a topology for my simulation and maybe be able to make change some parameters, and run it from GUI. I\'ve added part when the simulation starts, and objects are created, the whole thing is more than ten times bigger so I don\'t know if i should add it here. initialize() network=Network() #creating nodes node=Node(name=\'node\', function=\'user\', interfaceNum=2, possition=[160,990], homeAddress=\'0000000000000000020000fffe111111\') node.engine.stateTable={\'wifiassocresp\':\'self.changeIp(interface, self.HO)\',\'dissconnect\':\'node.engine.dissconnect(self.interruptCause, self.interruptCause.passSender)\',\'RngRsp\':\'self.sendBU()\', \'MIPv6BindingAck_LCoA\':\'self.sendBU(RCoA=True)\', \'MihN2nHoCandidateQueryRsp\':\'self.makeHandover()\'} activate(node, node.start()) ap0=Node(name=\'ap0\', function=\'ap\', interfaceNum=2,possition=[200,1000]) ap0.engine.stateTable={\'dissconnect\':\'self.dissconnect(self.interruptCause, self.interruptCause.passSender)\'} activate(ap0, ap0.start()) ..... there is more nodes, but i cut it becouse I thinks that this is not important activate(ha, ha.start()) ha.engine.HAadresses={\'node\':{ \'interfaceAddress\':[node.interfaceList[0], node.interfaceList[0].address], \'homeAddress\':[node.homeAddress],}} simulation=Tasks() network.drawTopology(nodes=[node, ap1,ap2, map1, ap0, internet, ha]) allNodes=[node, internet, ap1, ap2, map1, ap0, ha] node.apList=[ap0,ap1,ap2] ap1.engine.createRouting([node, internet, map1, ap0, ap2, ha]) ap2.engine.createRouting([node, internet, map1, ap0, ap1, ha]) map1.engine.createRouting([node, ap1, internet, ap0,ap2, ha]) ap0.engine.createRouting([node, ap1, ap2, map1, internet, ha]) internet.engine.createRouting([node, ap1, map1, ap0,ap2, ha]) #here starts the simulation activate(simulation, simulation.run(1)) simulate(until=100000.0)

No comments:

Post a Comment