Specifying a data source

Shows how to specify the data source for your OPL model.

In order to generate the Concert model, you need to provide data, just as you would add a data file in an OPL project along with the model file. The simplest way to get data is also to provide a file.

C++

        IloOplDataSource dataSource(env, DATADIR "mulprod" DIRSEP "mulprod.dat");
        opl.addDataSource(dataSource);

Java

        IloOplDataSource dataSource = oplF.createOplDataSource(DATADIR
                + "/mulprod.dat");
        opl.addDataSource(dataSource);

.NET (Visual Basic)


        Dim dataSource As OplDataSource = oplF.CreateOplDataSource(DATADIR + "/mulprod.dat")
        opl.AddDataSource(dataSource)