help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Error: requires numeric data.


From: glpk xypron
Subject: Re: [Help-glpk] Error: requires numeric data.
Date: Sun, 05 Sep 2010 03:01:27 +0200

Hello Marcello,

please, run the following:

set I, dimen 2;
table shifts_cost IN "MySQL" 'Database=nsp;UID=nsp;PWD=nurseproblem'
  'SELECT id,cost FROM shifts' :
  I <- [id, cost];
display I;
end;

and send the result.

What is the output of system command locale?

Best regards

Xypron


-------- Original-Nachricht --------
> Datum: Sat, 4 Sep 2010 20:53:14 -0300
> Betreff: Re: [Help-glpk] Error: requires numeric data.

> Hello Xypron,
> 
> mysql> desc shifts;
> +-------------------+------------------+------+-----+---------+----------------+
> | Field             | Type             | Null | Key | Default | Extra     
>     |
> +-------------------+------------------+------+-----+---------+----------------+
> | id                | int(11) unsigned | NO   | PRI | NULL    |
> auto_increment |
> | shift             | varchar(100)     | YES  |     |         |           
>     |
> | duration_in_hours | tinyint(4)       | NO   |     | NULL    |           
>     |
> | cost              | double           | YES  |     | NULL    |           
>     |
> +-------------------+------------------+------+-----+---------+----------------+
> 4 rows in set (0.00 sec)
> 
> mysql> select * from shifts;
> +----+--------+-------------------+------------------+
> | id | shift  | duration_in_hours | cost             |
> +----+--------+-------------------+------------------+
> |  1 | turno1 |                 8 |                1 |
> |  2 | turno2 |                 8 | 1.20000004768372 |
> |  3 | turno3 |                 8 | 1.29999995231628 |
> +----+--------+-------------------+------------------+
> 3 rows in set (0.00 sec)
> 
> $ mysql --version
> mysql  Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (i486) using
> readline 6.1
> 
> $ dpkg -l|grep mysql
> ii  libaprutil1-dbd-mysql   1.3.9+dfsg-3   The Apache Portable Runtime
> Utility Library - MySQL Dri
> ii  libdbd-mysql-perl   4.016-1   Perl5 database interface to the MySQL
> database
> ii  libmysql-ruby   2.8.2-1   MySQL module for Ruby
> ii  libmysql-ruby1.8   2.8.2-1   MySQL module for Ruby 1.8
> ii  libmysqlclient15-dev   5.0.51a-24+lenny2   MySQL database development
> files
> ii  libmysqlclient15off   5.0.51a-24+lenny2   MySQL database client
> library
> ii  libmysqlclient16   5.1.49-1   MySQL database client library
> ii  libqt4-sql-mysql   4:4.6.3-1   Qt 4 MySQL database driver
> ii  mysql-client-5.1   5.1.49-1   MySQL database client binaries
> ii  mysql-common   5.1.49-1   MySQL database common files, e.g.
> /etc/mysql/my.cnf
> ii  mysql-server   5.1.49-1   MySQL database server (metapackage
> depending on the lat
> ii  mysql-server-5.1   5.1.49-1   MySQL database server binaries and
> system database setu
> ii  mysql-server-core-5.1   5.1.49-1   MySQL database server binaries
> ii  php5-mysql   5.3.2-2   MySQL module for php5
> 
> $ glpsol -m nurse.mod
> GLPSOL: GLPK LP/MIP Solver, v4.43
> Parameter(s) specified in the command line:
>  -m nurse.mod
> Reading model section from nurse.mod...
> Reading data section from nurse.mod...
> 30 lines were read
> Reading shifts_cost...
> SELECT shift, cost FROM shifts
> nurse.mod:12: Shifts_cost requires numeric data
> MathProg model processing error
> 
> I was careful to restart mysql, do not you think that strange?
> I await your advice.
> 
> Thanks.
> 
> On Sat, Sep 4, 2010 at 19:01, glpk xypron <address@hidden> wrote:
> > Hello Marcello,
> >
> > your examples runs fine, when I use the following to create the
> > MySQL table:
> >
> > USE nsp;
> >
> > DROP TABLE IF EXISTS shifts;
> >
> > CREATE TABLE shifts (
> >  id   INT,
> >  cost DOUBLE,
> >  PRIMARY KEY ( id )
> >  );
> >
> > INSERT INTO shifts ( id, cost ) VALUES
> >  ( 1, 1.  ),
> >  ( 2, 2.  ),
> >  ( 3, 4.3 );
> >
> >
> > Please, check the definition of column cost in
> > your MySQL table using one of the following commands:
> >
> > SHOW CREATE TABLE shifts;
> > DESCRIBE shifts;
> >
> > Best regards
> >
> > Xypron
> >
> > -------- Original-Nachricht --------
> >> Datum: Sat, 4 Sep 2010 15:27:18 -0300
> >> Betreff: [Help-glpk] Error: requires numeric data.
> >
> >> Hello,
> >>
> >> Looking in my bare bone model, see this error down, can you help me?
> >>
> >> $ glpsol -m nurse.mod
> >> GLPSOL: GLPK LP/MIP Solver, v4.43
> >> Parameter(s) specified in the command line:
> >>  -m nurse.mod
> >> Reading model section from nurse.mod...
> >> Reading data section from nurse.mod...
> >> 32 lines were read
> >> Reading shifts_cost...
> >> SELECT id,cost FROM shifts
> >> nurse.mod:14: Shifts_cost requires numeric data
> >> MathProg model processing error
> >>
> >> /* nurse.mod - Solve simple NSP - Nurse Scneduling Problem
> >> /*** Variables ***/
> >> set SHIFTS;
> >>
> >> /*** Parameters ***/
> >> /* Custo por turno */
> >> param Shifts_cost{i in SHIFTS};
> >> table shifts_cost IN "MySQL" 'Database=nsp;UID=nsp;PWD=nurseproblem'
> >>  'SELECT id,cost FROM shifts' : SHIFTS <- [id], Shifts_cost~cost;
> >>
> >> param Time_work >= 0;
> >>
> >> /*** solve section ***/
> >> solve;
> >> for {i in SHIFTS}
> >> {
> >>  printf "%d",Shifts_cost[i];
> >>  printf "\n";
> >> }
> >>
> >> /*** data  section ***/
> >> data;
> >>
> >> #param Shifts_cost  := 1 1, 2 2, 3 4.3;
> >> end;
> >>
> >> --
> >> Marcello Henrique
> >
> > --
> > GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99
> Euro/mtl.!*
> > http://portal.gmx.net/de/go/dsl
> >
> 
> 
> 
> -- 
> Marcello Henrique
> Blog - http://faraohh.wordpress.com
> Associação Software Livre de Goiás (www.aslgo.org.br)
> Cercomp - UFG (www.cercomp.ufg.br)
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk

-- 
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl



reply via email to

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