jfpuget / TSP_USA

2 stars 1 forks source link

Trouble in Computing Shortest Tour on NEOS #1

Open verticeridani opened 7 years ago

verticeridani commented 7 years ago

Hi JFP, Thank you so much for a tremendous tutorial about TSP_USA. I'm quite new on this topic, but your tutorial works so well! Anyway, I got stuck on Computing Shortest Tour on NEOS, some error appear. let me put the input and output below:

INPUT

import time import xmlrpclib NEOS_HOST="www.neos-server.org" NEOS_PORT=3332

neos = xmlrpclib.ServerProxy("http://%s:%d" % (NEOS_HOST, NEOS_PORT),verbose=True) def tsp(tsp_data): with open('usa_50.tsp', 'rb') as file: tsp_xml = base_xml % file.read()

(jobNumber,password) = neos.submitJob(tsp_xml)

status="Waiting"

while status == "Running" or status=="Waiting": time.sleep(1) status = neos.getJobStatus(jobNumber, password)

msg = neos.getFinalResults(jobNumber, password).data


OUTPUT NameError Traceback (most recent call last)

in () 14 while status == "Running" or status=="Waiting": 15 time.sleep(1) ---> 16 status = neos.getJobStatus(jobNumber, password) 17 18 msg = neos.getFinalResults(jobNumber, password).data NameError: name 'jobNumber' is not defined Could you help me what's going on here? Thank You so much!
jfpuget commented 7 years ago

HI,   print jobnumber after you call neos.submit   I see that the line for neos.submit is not formated the same way the others.  Rae you sure it gets executed at all?   Best regards/Cordialement,JFJean-Francois Puget, PhDDistinguished Engineer, Machine Learning and Optimization, IBM AnalyticsMobile: +33(0)6 7000 8815 Email: j-f.puget@fr.ibm.comBlog: http://bit.ly/jfpuget Twitter: @JFPuget     ----- Original message -----From: verticeridani notifications@github.comTo: jfpuget/TSP_USA TSP_USA@noreply.github.comCc:Subject: [jfpuget/TSP_USA] Trouble in Computing Shortest Tour on NEOS (#1)Date: Tue, Dec 13, 2016 11:31 AM  Hi JFP,Thank you so much for a tremendous tutorial about TSP_USA.I'm quite new on this topic, but your tutorial works so well!Anyway, I got stuck on Computing Shortest Tour on NEOS, some error appear.let me put the input and output below: INPUT import timeimport xmlrpclibNEOS_HOST="www.neos-server.org"NEOS_PORT=3332 neos = xmlrpclib.ServerProxy("http://%s:%d" % (NEOS_HOST, NEOS_PORT),verbose=True)def tsp(tsp_data):with open('usa_50.tsp', 'rb') as file:tsp_xml = base_xml % file.read() (jobNumber,password) = neos.submitJob(tsp_xml)status="Waiting" while status == "Running" or status=="Waiting":time.sleep(1)status = neos.getJobStatus(jobNumber, password) msg = neos.getFinalResults(jobNumber, password).data OUTPUTNameError Traceback (most recent call last)in ()14 while status == "Running" or status=="Waiting":15 time.sleep(1)---> 16 status = neos.getJobStatus(jobNumber, password)1718 msg = neos.getFinalResults(jobNumber, password).data NameError: name 'jobNumber' is not defined Could you help me what's going on here?Thank You so much! —You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.

 Sauf indication contraire ci-dessus:/ Unless stated otherwise above: Compagnie IBM France Siège Social : 17 avenue de l'Europe, 92275 Bois-Colombes Cedex RCS Nanterre 552 118 465 Forme Sociale : S.A.S. Capital Social : 657.364.587 € SIREN/SIRET : 552 118 465 03644 - Code NAF 6202A

verticeridani commented 7 years ago

Actually, I don't know why it different than others, I just copy paste from my notebook. But anyway, Thank you so much for a reply in time and suggestion, it works perfectly now! I got bigger than yours, my Optimal Solution is 22.311.853.00 km

Regards, Vertic