[Cbc] Pass model and/or data to the executable via standard input
John Forrest
john.forrest at fastercoin.com
Tue Apr 16 10:03:56 EDT 2013
Pietro,
You should be able to read a gmpl file into Cbc (If GMPL installed using
ThirdParty). The format is something like
cbc -import gmpl_model_file%gmpl_data_file -solve
The code may be broken if nobody has used the facility for years but
should be easy to fix.
John Forrest
On 16/04/13 14:22, Pietro Scionti wrote:
>
> Hi,
>
> i am learning CBC in order to transition to it from GLPK.
>
> Since I cannot lose GMPL's capabilities but for various reasons I am
> constrained to use the unmodified executable, my modus operandi is
>
> 1) run GLPK with the "--wlp model.lp --check" option to make the mod->
> lp transition
>
> 2) run cbc solving the .lp model
>
> I would like to know, is there a way to pass the model to be solved
> via the console standard input? My models (all integer) get pretty big
> pretty fast, and I am concerned I might use a huge amount of disk
> space that I then need to clean up, while this could all be avoided if
> I could feed the model to cbc in memory.
>
> If i was not clear, what I want to accomplish in GLPK can be done like
> this (language is C#, i am on Windows 7):
>
> System.Diagnostics.Process process = new
> System.Diagnostics.Process();
>
> process.StartInfo.UseShellExecute = false;
>
> process.StartInfo.FileName = glpsolPath;
>
> process.StartInfo.Arguments = String.Format("--math
> /dev/stdin --output {0} --log {1}", outputStreamPath, logPath);
>
> process.StartInfo.RedirectStandardInput = true;
>
> process.Start();
>
> StreamReader tr = new StreamReader(modelPath);
>
> process.StandardInput.Write(tr.ReadToEnd());
>
> Thanks everyone,
>
> Pietro Scionti
>
>
> ------------------------------------------------------------------------
>
> Archimede S.r.l.
> Sede Legale:
> Via Manzoni, 82
> Ponte S. Giovanni
>
> P.IVA: 01992020543
>
> Tel. 075 515 22 11
> Fax. 075 515 22 99
> www.archinet.it
>
> **********************************************************************************************************************************************************************************************************************
> La presente comunicazione, con le informazioni in essa contenute e
> ogni documento o file allegato, e' rivolta unicamente alla/e persona/e
> cui e' indirizzata ed alle altre da questa autorizzata/e a riceverla.
> Se non siete i destinatari/autorizzati siete avvisati che qualsiasi
> azione, copia, comunicazione, divulgazione o simili basate sul
> contenuto di tali informazioni e' vietata e potrebbe essere contro la
> legge (art. 616 C.P., D.Lgs n. 196/2003 Codice in materia di
> protezione dei dati personali). Se avete ricevuto questa comunicazione
> per errore, vi preghiamo di darne immediata notizia al mittente e di
> distruggere il messaggio originale e ogni file allegato senza farne
> copia alcuna o riprodurne in alcun modo il contenuto.
>
> This e-mail and its attachments are intended for the addressee(s) only
> and are confidential and/or may contain legally privileged
> information. If you have received this message by mistake or are not
> one of the addressees above, you may take no action based on it, and
> you may not copy or show it to anyone; please reply to this e-mail and
> point out the error which has occurred.
> **********************************************************************************************************************************************************************************************************************
>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20130416/0e50474f/attachment.html>
More information about the Cbc
mailing list