[OS] New Features in OSSolverService

Kipp Martin Kipp.Martin at ChicagoGSB.edu
Mon Feb 18 19:30:21 EST 2008


Hi Joe:
> 
> That's nice. Maybe format for "-h" "--help" "-v" "--version" are more
> usual (this is the GNU getopt format).

Good idea, I just updated trunk 1659 with this information.
> 
> I should mention that any program employing the popular libxml (http://
> xmlsoft.org/) will meet some errors messages on output.
>> file.osil:2: parser warning : xmlns: URI os.optimizationservices.org
>> is not absolute
>> <osil xmlns="os.optimizationservices.org" xmlns:xsi="http://www.w3.org/
>> 2001/XMLS

I will discuss the above with my colleagues. My understanding is that a 
relative path is still valid URI.

Thanks for your input.

Regards,


> 
> To fix this, you may want (or not ?) change the xmlns attribute for
> "http://os.optimizationservices.org". Please find a small patch to
> apply on OS trunk :
> 
> Index: /local/jfdeverg/20080218/OS/OS1.1/OS/applications/amplClient/
> OSAmplClient.cpp
> ===================================================================
> --- /local/jfdeverg/20080218/OS/OS1.1/OS/applications/amplClient/
> OSAmplClient.cpp	(revision 1658)
> +++ /local/jfdeverg/20080218/OS/OS1.1/OS/applications/amplClient/
> OSAmplClient.cpp	(working copy)
> @@ -124,7 +124,7 @@
>  	std::string osrl = "";
>  	std::string sSolverName = "";
>  	// note that default solver is coin and default subSolver is Cbc
> -	std::string osol = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <osol
> xmlns=\"os.optimizationservices.org\" xmlns:xs=\"http://www.w3.org/
> 2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance
> \" xsi:schemaLocation=\"os.optimizationservices.org
> http://www.optimizationservices.org/schemas/OSoL.xsd\"><other> </
> other></osol>";
> +	std::string osol = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <osol
> xmlns=\"http://os.optimizationservices.org\" xmlns:xs=\"http://
> www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/
> XMLSchema-instance\" xsi:schemaLocation=\"os.optimizationservices.org
> http://www.optimizationservices.org/schemas/OSoL.xsd\"><other> </
> other></osol>";
>  	// get the solver set by AMPL
>  	amplclient_options = getenv("amplClient_options");
>  	if(amplclient_options != NULL) cout << "HERE ARE THE AMPL CLIENT
> OPTIONS " <<   amplclient_options << endl;
> Index: /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSCommonInterfaces/
> OSiLWriter.cpp
> ===================================================================
> --- /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSCommonInterfaces/
> OSiLWriter.cpp	(revision 1658)
> +++ /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSCommonInterfaces/
> OSiLWriter.cpp	(working copy)
> @@ -40,7 +40,7 @@
>  	int i, j;
>  	if(m_OSInstance == NULL)  return outStr.str();
>  	outStr << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ;
> -	outStr << "<osil xmlns=\"os.optimizationservices.org\"   xmlns:xsi=
> \"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=
> \"os.optimizationservices.org http://www.optimizationservices.org/schemas/OSiL.xsd\"
>> " ;
> +	outStr << "<osil xmlns=\"http://os.optimizationservices.org\"
> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
> xsi:schemaLocation=\"os.optimizationservices.org
> http://www.optimizationservices.org/schemas/OSiL.xsd\" >" ;
>  	outStr << "<instanceHeader>" ;
>  	if( m_bWhiteSpace == true) outStr << endl;
>  	if(m_OSInstance->instanceHeader != NULL){
> Index: /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSCommonInterfaces/
> OSrLWriter.cpp
> ===================================================================
> --- /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSCommonInterfaces/
> OSrLWriter.cpp	(revision 1658)
> +++ /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSCommonInterfaces/
> OSrLWriter.cpp	(working copy)
> @@ -69,7 +69,7 @@
>  	outStr << "<?xml-stylesheet type = \"text/xsl\" href = \"";
>  	outStr << xsltDir;
>  	outStr << "OSrL.xslt\"?>";
> -	outStr << "<osrl xmlns=\"os.optimizationservices.org\"   xmlns:xsi=
> \"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=
> \"os.optimizationservices.org http://www.optimizationservices.org/schemas/OSrL.xsd\"
>> " ;
> +	outStr << "<osrl xmlns=\"http:://os.optimizationservices.org\"
> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
> xsi:schemaLocation=\"os.optimizationservices.org
> http://www.optimizationservices.org/schemas/OSrL.xsd\" >" ;
>  	outStr << endl;
>  	outStr << "<resultHeader>" << endl;
>  	if(m_OSResult->resultHeader != NULL){
> 
> Index: /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSSolverService.cpp
> ===================================================================
> --- /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSSolverService.cpp
> (revision 1658)
> +++ /local/jfdeverg/20080218/OS/OS1.1/OS/src/OSSolverService.cpp
> (working copy)
> @@ -341,7 +341,7 @@
>  					}
>  				}
>  				else{// no osol string
> -					osoptions->osol = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
> <osol xmlns=\"os.optimizationservices.org\" xmlns:xs=\"http://
> www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/
> XMLSchema-instance\" xsi:schemaLocation=\"os.optimizationservices.org
> http://www.optimizationservices.org/schemas/OSoL.xsd\"><other> </
> other></osol>";
> +					osoptions->osol = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
> <osol xmlns=\"http//os.optimizationservices.org\" xmlns:xs=\"http://
> www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/
> XMLSchema-instance\" xsi:schemaLocation=\"os.optimizationservices.org
> http://www.optimizationservices.org/schemas/OSoL.xsd\"><other> </
> other></osol>";
>  					iStringpos = osoptions->osol.find("</osol");
>  					osoptions->osol.insert(iStringpos, "<other name=\"os_solver\">"
>  							+ osoptions->solverName  + "</other>");
> @@ -569,7 +569,7 @@
>  	FileUtil *fileUtil = NULL;
>  	fileUtil = new FileUtil();
>  	// first get the jobID
> -	std::string sOSoL = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
> <osol xmlns=\"os.optimizationservices.org\" xmlns:xs=\"http://
> www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/
> XMLSchema-instance\" xsi:schemaLocation=\"os.optimizationservices.org
> http://www.optimizationservices.org/schemas/OSoL.xsd\"><general> </
> general></osol>";
> +	std::string sOSoL = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
> <osol xmlns=\"http://os.optimizationservices.org\" xmlns:xs=\"http://
> www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/
> XMLSchema-instance\" xsi:schemaLocation=\"os.optimizationservices.org
> http://www.optimizationservices.org/schemas/OSoL.xsd\"><general> </
> general></osol>";
>  	string::size_type iStringpos;
>  	try{
>  		// call a method here to get OSiL if we have an nl or mps file
> 
> 
> > 


-- 
Kipp Martin
Professor of Operations Research
and Computing Technology
Graduate School of Business
University of Chicago
5807 South Woodlawn Avenue
Chicago, IL 60637
773-702-7456
kipp.martin at chicagogsb.edu
http://gsbkip.chicagogsb.edu
http://www.coin-or.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Optimization Services (OS)" group.
To post to this group, send email to optimizationservices at googlegroups.com
To unsubscribe from this group, send email to optimizationservices-unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/optimizationservices?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the OS mailing list