help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Mathprog > SQLite/MySQL > GNUPlot - (Graphing LP and MI


From: Noli Sicad
Subject: Re: [Help-glpk] Mathprog > SQLite/MySQL > GNUPlot - (Graphing LP and MIP results)
Date: Sun, 13 Jun 2010 09:38:32 +1000

Hi Xypron,

> The first syntax executes command_line.
> The second syntax invokes a shell (Linux console, or Windows console
> ("cmd"))and returns to AMPL when the shell is terminated.
>
> (see Robert Fourer, AMPL, 2nd edition)
>
> These commands make sense in AMPL, because it is an interactive language.
>
> What will be the added value for GLPK users compared to using a shell
> script?

I think it would useful to run third parties console application e.g. gnuplot.

shell 'wgnuplot.exe lp_result-graph.gnu';
shell;

Display the window graph.

I don't know if this makes sense.

Anyway, back to graphing example in Mathprog. Here is my idea below.
This is not working yet.

solve;
table result{i in I, j in J: x[i,j]} OUT "ODBC"
  'DSN=SQLITE3'
  'DELETE FROM transp_result;'
  'INSERT INTO transp_result VALUES (?,?,?)' :
  i ~ LOC1, j ~ LOC2, x[i,j].val ~ PRIMAL, x[i,j].dual ~ DUAL;

Xypron, how to write LOC1 and LOC2 into one data entry, e.g. ROUTE

ROUTE for LOC1 and LOC2
'Seattle - New York',

# filename for gnuplot
param file, symbolic := 'lp_result_sqlite3.gnu';
# start printing the gnuplot script
printf 'set style data lines\n' > file;
printf 'set datafile separator "|" \n' >> file;
printf 'set style data histograms \n' >>file;

# not working yet. Needs to be fixed with one label "ROUTE"
printf 'plot " < sqlite3 C:\\gusek\\xypron\\transp_sqlite3.db3  select
* from transp_result" \n' >>file;
printf '     using 2:xtic(1) title "primal", "" using 4 t "dual" ' >>file;

Probably would be best using lp_result.dat for gnuplot data for
instead of using SQL statement.

Any gnuplot users in this group who want to help, how we can get
interactive graphing in MathProg.

Thanks. Noli



reply via email to

[Prev in Thread] Current Thread [Next in Thread]