Julia
Julia

Reputation: 13

Is it possible to create a .dat file for CPLEX with java?

I want to generate a set of data for an optimization problem. I want to generate the data with Java and want it to be written to a .dat file that I can use with CPLEX.

Upvotes: 0

Views: 304

Answers (1)

rkersh
rkersh

Reputation: 4465

Yes, it is possible to generate a .dat file with Java. The .dat file is just a text file, so you can use standard techniques to create it and write out the information (e.g., run a google search for "java writing output to a file").

The section on Data Sources in the OPL Reference Manual explains how to format this "external" data. In addition to just creating plain text files, you can connect to external data sources such as Excel spreadsheets, databases, etc.

You should take a look at the .dat files from the examples that are included when you install CPLEX. These are located under <CPLEX_INSTALL_DIR>/opl/examples.

Upvotes: 1

Related Questions