[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] symbolic parameter in set
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] symbolic parameter in set |
Date: |
Fri, 17 Feb 2006 21:46:25 +0300 |
> In version 4.8 there is a nice example: maxflow.mod
>
> regarding this example, how does one declare and assign a
> symbolic (string) parameter within the Arcs set?
>
> i.e., I would like to assign a 'name' parameter to Arcs:
>
> param n, integer, >= 2;
> /* number of nodes */
>
> set Nodes, default {1..n};
> /* set of nodes */
>
> set Arcs, within Nodes cross Nodes;
> /* set of arcs */
>
> param capacity {(i,j) in Arcs}, > 0;
> /* capacity[i,j] is capacity of arc (i,j) */
>
> param name, symbolic, {(i,j) in Arcs};
> .....
>
> data;
>
> param : Arcs : name capacity :=
> 1 2 arc1 14
> 1 4 arc2 23
> ....;
>
>
> with the line 23 as: param name, symbolic, {(i,j) in Arcs};
> I get:
> Reading model section from maxflow.mod...
> maxflow.mod:23: syntax error in parameter statement
> Context: ...city { ( i , j ) in Arcs } , > 0 ; param name , symbolic , {
> Model processing error
>
Your syntax is wrong. The correct syntax is the following:
param name{(i,j) in Arcs} symbolic;
(The comma preceding 'symbolic' is optional and may be omitted.)