0

I want to read a tuple from my Excel file for my OPL model in CPLEX, which has the following format:

tuple A {
  string a;
  int b;
  {string} c;
}

The set {string} c of each tuple element is of variable length.

How can I read this via SheetConnection or is this not possible?

I've tried to read it via named fields in Excel, but that didn't work. I have also read on the CPLEX documentation, that it is only possible to read tuples of fixed width, but my data is not of fixed width.

Raduan Santos
  • 1,023
  • 1
  • 21
  • 45

1 Answers1

0

if you know the number of tuples, you could read 2 arrays with SheetRead

One for

string a;
  int b;

The second for

{string} c;

For that array you could use the max number of strings.

And then in the .mod you turn those 2 arrays into a tuple set.

halfer
  • 19,824
  • 17
  • 99
  • 186
Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15