help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Issue with symbolic parameters input from csv files


From: joel mortyn
Subject: Re: [Help-glpk] Issue with symbolic parameters input from csv files
Date: Wed, 7 Feb 2018 23:20:53 +0000

Attached are two simplified versions of the model and the CSVs. The model moves loads from blocks through a series of nodes to destinations. 

TransLoads.mod has the data at the end of the model file and solves. TransLoadsCSV.mod reads the data from CSVs and results in an error.


From: Heinrich Schuchardt <address@hidden>
Sent: Thursday, 8 February 2018 8:47 AM
To: joel mortyn; address@hidden
Subject: Re: [Help-glpk] Issue with symbolic parameters input from csv files
 
Hello Joel,

please, provide the model file and the csv file that show the error.
Otherwise it is hard to figure out what your problem is.

Best regards

Heinrich

On 02/07/2018 09:19 PM, joel mortyn wrote:
> Hi,
>
> I have a MIP model and am running into an issue when inputting data from
> csv files versus entering them into the data section of the model file.
> The issue involves symbolic parameters that are referenced in multiple
> data sets. For example, I have two sets:
> {n in Nodes} and {b in Blocks}. The Blocks set has a parameter
> Block_Node that matches one of the Nodes. The data reads just  fine from
> the csv files, as when I use the display statement I get the following:
>
> Display statement at line 153
>    Block_Node[1] = 1
> Display statement at line 154
> Nodes:
>    1
>    719
>    742
>    752
>    787
>    791
>    793
>    796
>    823
>    828
>
> I create a set of BlockNodes using the following:
>    set BlockNodes:=setof{b in Blocks, n in Nodes:
> (Node_ID[n]=Block_Node[b])} (b,n);
>
> However, when the data is input from csv files, glpk does not recognize
> this join. When I try to display the set BlockNodes, I get the following
> error:
>    "no value for Node_ID[1]"
>
> If rather than using csv files, I enter the same data at the end of the
> model file, the model solves with no issue.
>
> I am thinking that using the csv files is causing a data type conversion
> issue. I have tried forcing the Node_IDs and Block_Nodes to text by
> using quotation marks but the issue persisted.
>
> Any help would be much appreciated. Thanks,
>
> Joel
>
>
>
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk
>

Attachment: BlockLoads.csv
Description: BlockLoads.csv

Attachment: Blocks.csv
Description: Blocks.csv

Attachment: DestLoads.csv
Description: DestLoads.csv

Attachment: Dests.csv
Description: Dests.csv

Attachment: Loads.csv
Description: Loads.csv

Attachment: Nodes.csv
Description: Nodes.csv

Attachment: TransLoads.mod
Description: TransLoads.mod

Attachment: TransLoadsCSV.mod
Description: TransLoadsCSV.mod

Attachment: TransNetwork.csv
Description: TransNetwork.csv

Attachment: TransNetworkLoads.csv
Description: TransNetworkLoads.csv


reply via email to

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