Timeit

C

cokofreedom

I've having an annoying problem at the moment. I'm writing code for
the travelling salesmen problem and comparing different techniques.
But I've having a problem using timeit.

I have a file called "testplatform.py" that contains 4 class:
Test() - which is called first to create the cities/routes to be
shared between the other classes
AutoClone() - which uses the variables from Test() (normally test =
Test())
Randomisation() - Ditto
BruteForce() - Ditto

if __name__ == '__main__':
.....test = Test(5, 1000, 100, 100, 100, 14)
.....example1 = AutoClone(test.citynames, test.cityroutes, test.seed,
.........................test.generations, test.mutate)
.....example2 = Randomisation(test.citynames, test.cityroutes,
test.seed,
.........................test.generations)
.....example3 = BruteForce(test.citynames, test.cityroutes)

I am really stuck trying to work out how to pass variables to timeit
to allow me to run any of the examples...

Any help would be great!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top