[OS] New Features in OSSolverService

Joe joe.boublack at gmail.com
Mon Feb 18 11:52:09 EST 2008



On Feb 14, 7:56 am, Kipp Martin <Kipp.Mar... at ChicagoGSB.edu> wrote:
> Hello Users:
>
> As requested, in the current trunk version of OS, for OSSolverService
> you will find:
> If "$ OSSolverService" is typed in at the command line with no options
> the result is now:
> There must be at least one command line argument
> Try -help or --help
> There is now a --help, -help command that explains all of the options
> available if the solve service method is used to solve a problem locally.
> There is now a --version, -version command that will produce

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

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

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


--~--~---------~--~----~------------~-------~--~----~
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