[Top][All Lists]
[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 00:01:24 +0200 |
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